{"answers":{"affected":"2 open source packages ship an affected version, including @keep-network/tbtc-v2.","exploited":"There is no known exploitation of GHSA-8986-v76q-8vr2 in the wild and no public exploit code.","fix":"Upgrade @keep-network/tbtc-v2 to 1.8.2 or later.","what":"GHSA-8986-v76q-8vr2 is a vulnerability in @keep-network/tbtc-v2, published on 2 Mar 2026. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for GHSA-8986-v76q-8vr2 and fix it if it is affected.\n\nWhat it is: GHSA-8986-v76q-8vr2 is a vulnerability in @keep-network/tbtc-v2, published on 2 Mar 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: There is no known exploitation of GHSA-8986-v76q-8vr2 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- @keep-network/tbtc-v2 (npm): affected all versions; fixed in 1.8.2\n- @keep-network/tbtc-v2 (npm): affected all versions; fixed in 1.8.2\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/GHSA-8986-v76q-8vr2/ (Markdown: https://insights.sbomify.com/GHSA-8986-v76q-8vr2/index.md)","id":"GHSA-8986-v76q-8vr2","markdown":"https://insights.sbomify.com/GHSA-8986-v76q-8vr2/index.md","name":"GHSA-8986-v76q-8vr2","record":{"aliases":[],"analysis":{"component_type":"library","fix_type":"patch","impacts":["other"],"network_reachable":"yes","non_default_config":false,"product_category":"Bitcoin SPV library","requires_auth":"none","summary":"An attacker can cause protocol insolvency by embedding a valid P2SH script inside a P2PKH output, bypassing deposit validation checks in the optimistic minting bot.","user_interaction":"not_required","vuln_class":"business_logic"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"# Overview\n\nP2PKH 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](https://github.com/keep-network/bitcoin-spv/blob/856849612ef49114af18c0f407eaa74afc2ee4be/solidity/contracts/BTCUtils.sol#L610-L612) and we treat it as a valid P2SH output.\n\nThis does not lead to stealing funds but can lead to protocol insolvency.\n\nThe 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.\n\nhttps://bugs.immunefi.com/magnus/672/projects/502/bug-bounty/reports/55982\n\n# Steps\n\nSince there is a 24-hour governance delay on upgrading the Bridge smart contract, we are going to pause optimistic minting.\n\n1. Pause optimistic minting.\n2. Deploy new Bridge implementation with Deposit library containing a fix, WITHOUT VERIFYING THE CODE on Etherscan.\n3. Schedule upgrade transaction.\n4. After 24 hours, finalize upgrade.\n5. Unpause optimistic minting.","ecosystems":["npm"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":true,"headline":"@keep-network/tbtc-v2 revealing P2PKH deposit with a wrapped P2SH script","id":"GHSA-8986-v76q-8vr2","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"npm","product":null,"products":[],"type":"business_logic","year":"2026"},"n_packages":2,"n_references":null,"packages":[{"ecosystem":"npm","fixed":["1.8.2"],"introduced":["0"],"last_affected":[],"package":"@keep-network/tbtc-v2","purl":null,"source":"GHSA-8986-v76q-8vr2"},{"ecosystem":"npm","fixed":["1.8.2"],"introduced":["0"],"last_affected":[],"package":"@keep-network/tbtc-v2","purl":"pkg:npm/%40keep-network/tbtc-v2","source":"GHSA-8986-v76q-8vr2"}],"products":null,"published":"2026-03-02","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"An attacker can cause protocol insolvency by embedding a valid P2SH script inside a P2PKH output, bypassing deposit validation checks in the optimistic minting bot.","url":"https://insights.sbomify.com/GHSA-8986-v76q-8vr2/"}