Skip to content
Heist/ feed
Back to feed
Medium

Security advisory

Type: advisorySources: OSVCVE: CVE-2021-31876

Bitcoin Core 0.12.0 through 0.21.1 does not properly implement the replacement policy specified in BIP125, which makes it easier for attackers to trigger a loss of funds, or a denial of service attack against downstream projects such as Lightning network nodes. An unconfirmed child transaction with nSequence = 0xff_ff_ff_ff, spending an unconfirmed parent with nSequence <= 0xff_ff_ff_fd, should be replaceable because there is inherited signaling by the child transaction. However, the actual PreChecks implementation does not enforce this. Instead, mempool rejects the replacement attempt of the unconfirmed child transaction.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2021-31876
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 11:16 UTC · Revision 1

Source evidence

CVE-2021-31876

core-osv · Original source

Published 13 May 2021, 22:15 UTC

Bitcoin Core 0.12.0 through 0.21.1 does not properly implement the replacement policy specified in BIP125, which makes it easier for attackers to trigger a loss of funds, or a denial of service attack against downstream projects such as Lightning network nodes. An unconfirmed child transaction with nSequence = 0xff_ff_ff_ff, spending an unconfirmed parent with nSequence <= 0xff_ff_ff_fd, should be replaceable because there is inherited signaling by the child transaction. However, the actual PreChecks implementation does not enforce this. Instead, mempool rejects the replacement attempt of the unconfirmed child transaction.

osv:CVE-2021-31876
Complete source record
{
  "id": "48252b0116c459770933e949ff7efcf6a11c7a3b0bf5482d8a2e9234e757ddc3",
  "url": "https://osv.dev/vulnerability/CVE-2021-31876",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "CVE-2021-31876",
    "summary": "Bitcoin Core 0.12.0 through 0.21.1 does not properly implement the replacement policy specified in BIP125, which makes it easier for attackers to trigger a loss of funds, or a denial of service attack against downstream projects such as Lightning network nodes. An unconfirmed child transaction with nSequence = 0xff_ff_ff_ff, spending an unconfirmed parent with nSequence <= 0xff_ff_ff_fd, should be replaceable because there is inherited signaling by the child transaction. However, the actual PreChecks implementation does not enforce this. Instead, mempool rejects the replacement attempt of the unconfirmed child transaction.",
    "evidence": "osv:CVE-2021-31876",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2021-31876",
      "aliases": [
        "CVE-2021-31876"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/bitcoin/bitcoin",
              "type": "GIT",
              "events": [
                {
                  "introduced": "188ca9c305d3dd0fb462b9d6a44048b1d99a05f3"
                },
                {
                  "last_affected": "194b9b8792d9b0798fdb570b79fa51f1d1f5ebaf"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:bitcoin:bitcoin:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "0.12.0"
                      },
                      {
                        "last_affected": "0.21.1"
                      }
                    ],
                    "source": "CPE_RANGE"
                  }
                ]
              }
            }
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-31876.json"
          }
        }
      ],
      "modified": "2026-10-20T10:53:44.787277248Z",
      "provider": "osv",
      "references": [
        "https://bitcoinops.org/en/newsletters/2021/05/12/",
        "https://bitcoinops.org/en/topics/replace-by-fee/",
        "https://en.bitcoin.it/wiki/Common_Vulnerabilities_and_Exposures#CVE-2021-31876",
        "https://github.com/bitcoin/bitcoin",
        "https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-May/018893.html"
      ],
      "provider_metadata": {}
    },
    "related_cves": [
      {
        "value": "CVE-2021-31876",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 384568,
  "published_at": "2021-05-13T22:15:07.547+00:00"
}