@keep-network/tbtc-v2
Affected
- introduced
0, fixed1.8.2(semver)
Fixed versions
1.8.2
Fix
- Fixed version
1.8.2npm install @keep-network/[email protected]
Advisory
Also known as: None
@keep-network/tbtc-v2 revealing P2PKH deposit with a wrapped P2SH script
Overview
P2PKH has 20 bytes just like P2SH. We protect against revealing P2PKH deposits by manually assembling the expected P2SH script in the smart contract and comparing hashes. However, we missed the case when the attacker embeds a valid P2SH inside of P2PKH as an output script. bitcoin-spv library extracts the P2SH from P2PKH and we treat it as a valid P2SH output.
This does not lead to stealing funds but can lead to protocol insolvency.
The off-chain client handles this case correctly, but the problem is in the optimistic minting bot. The bot assumes that if the funding TX exists on Bitcoin with the right amount and it was successfully revealed, the transaction is valid.
https://bugs.immunefi.com/magnus/672/projects/502/bug-bounty/reports/55982
Steps
Since there is a 24-hour governance delay on upgrading the Bridge smart contract, we are going to pause optimistic minting.
High Basis: The source's own band: HIGH
0, fixed 1.8.2 (semver)1.8.2
1.8.2npm install @keep-network/[email protected]Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0