Interlay
The interBTC bridge's fraud proof functions had parsing flaws: trailing bytes in raw transactions allowed bypassing double payment checks, and address extraction from ScriptSig could be forged to frame other vaults. An attacker could force liquidation of any vault's collateral or steal collateral by misattributing transactions.
pwning.mirror.xyz
Published on pwning.mirror.xyz
Hanging out in the Immunefi discord leads me to new wonderlands! Last month I was notified of a new bounty program from Interlay, who claimed the maximal bounty payout could be $1M.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the transaction and address parsing logic was incomplete: it ignored trailing bytes and used heuristics that could be tricked by specially crafted scripts.
Impact
An attacker could force liquidation of any vault with at least one processed request, stealing 5% of its collateral and potentially causing all vaults to be banned, breaking the system.
What the attacker needed
Access to the bridge's extrinsic calls; a vault with at least one processed request; ability to submit crafted Bitcoin transactions
The fix
The vulnerable theft reporting functions were deactivated by the Interlay team.
How it was found
- Craft a fake transaction by appending an extra byte to a valid transaction.
- Call report_vault_double_payment with the original and the fake transaction.
- The parser ignores the extra byte, so both transactions are considered identical, bypassing the double payment check.
- For the second bug, create a P2SH redeem script that consumes fake signature and pubkey, then verifies a real signature.
- Spend from the P2SH address using a ScriptSig that includes the fake signature and pubkey.
- The address extraction misinterprets the ScriptSig as a P2PKH address from the fake pubkey, allowing forgery.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
The bridge checks whether a vault misbehaved by reading Bitcoin transactions. Two bugs let an attacker craft transactions that look valid to the bridge but are actually different, so the bridge wrongly punishes honest vaults or lets dishonest ones escape. This could destroy trust in the system and cause financial loss.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.