Full Disclosure: CVE-2021-31876 Defect in Bitcoin Core's bip125 logic



Summary:

Antoine Riard reported a defect in the Bitcoin Core bip125 logic with minor security and operational implications for downstream projects. The defect affects Bitcoin Core nodes 0.12.0 and above, but base layer safety is not affected. The Bip 125 specification describes two ways a transaction can signal that it is replaceable. An unconfirmed child transaction with nSequence = 0xff_ff_ff_ff spending an unconfirmed parent with nSequence the child transaction signals "through inheritance". However, the replacement code as implemented in Core's `PreChecks()` shows that this behavior isn't enforced and Core's mempool rejects replacement attempts of an unconfirmed child transaction.The defect has not been patched yet. Downstream projects affected include LN, Onchain DLC/Coinswap/Vault, Coinjoin/Cut-Through, and Simple wallets. LN nodes operators concerned by this defect might favor anchor outputs channels, fully mitigating this specific pinning vector. To the best of Riard's knowledge, he didn't identify other deployed protocols of which coins safety are impacted by this defect.The lack of an established policy for coordinated security disclosures between a base layer implementation and its downstream projects, the lack of a clear methodology to identify downstream projects affected by a transaction relay policy wreckage, and the lack of minimally-disruptive, emergency upgrade mechanisms implemented by downstream projects are some interesting points underlined by this defect. Finally, security implications for downstream projects provoked by base layer issues shouldn't be minimized as they do have a risk of windblow on base layer operations.The timeline for this defect report started from 2021-03-18 to 2021-05-06. The information reported by Antoine Riard reflects the best of his knowledge.


Updated on: 2023-06-14T20:42:30.764397+00:00