@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.
- Pause optimistic minting.
- Deploy new Bridge implementation with Deposit library containing a fix, WITHOUT VERIFYING THE CODE on Etherscan.
- Schedule upgrade transaction.
- After 24 hours, finalize upgrade.
- Unpause optimistic minting.
Software afectado
Haz clic en una tecnología para ver todas sus vulnerabilidades.
| Plataforma | Paquete | Versiones vulnerables | Corregida en |
|---|---|---|---|
| Paquete de npm | @keep-network/tbtc-v2 | < 1.8.2 | 1.8.2 |
Referencias
- https://github.com/threshold-network/tbtc-v2/security/advisories/GHSA-8986-v76q-8vr2
- https://bugs.immunefi.com/magnus/672/projects/502/bug-bounty/reports/55982
- https://github.com/keep-network/bitcoin-spv/blob/856849612ef49114af18c0f407eaa74afc2ee4be/solidity/contracts/BTCUtils.sol#L610-L612
- https://github.com/threshold-network/tbtc-v2
- Vector CVSS
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H- Debilidad (CWE)
CWE-328- Plataforma
- npm
- Paquete
@keep-network/tbtc-v2- Publicada
- 02.03.2026
- Actualizado
- 11.10.2026 10:22
Fuentes y licencias
OSV / GitHub Advisory Database - GHSA-8986-v76q-8vr2 - CC BY 4.0
Historial de vulnerabilidades: @keep-network/tbtc-v2
Todas las vulnerabilidades publicadas de este paquete (Paquete de npm), de la más reciente a la más antigua. Muestra si es un fallo aislado o un paquete que hay que vigilar.
- Entradas en total
- 2
- Primera → última
- 01.2024 03.2026
- Sin corrección
- 0
- Explotada en ataques
- 0
Distribución por gravedad
- Alta 2
Divulgaciones por año
- 2024: 1
- 2025: 0
- 2026: 1
-
@keep-network/tbtc-v2 revealing P2PKH deposit with a wrapped P2SH script esta entrada
Identifica las vulnerabilidades de tu aplicación
Con la integración de DockRay y el inventario de software activado, DockRay compara las versiones notificadas de los componentes con las vulnerabilidades conocidas y avisa de las coincidencias confirmadas. La cobertura depende de la tecnología compatible y de los avisos disponibles.