Cyber Resilience

CVE-2024-38365

Btcd Project Btcd 0.10.0 – 0.24.2

Published
11 October 2024
Modified
20 August 2025
Patch / advisory
CVSS Score v3.1 7.4
Click a component to see what it means
Raw vectorCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:H
EPSS Score 0.010 60th percentile
Risk Priority 57 floored blend · peak EPSS

Summary

CVE-2024-38365 is a high-severity Always-Incorrect Control Flow Implementation (CWE-670) vulnerability in Btcd Project Btcd. Its CVSS base score is 7.4 (High).

Operationally, ranked in the top 40% of CVEs by exploit likelihood; it is not currently listed in the CISA KEV catalog.

The strongest mitigations our analysis identified map to SA-11 (Developer Testing and Evaluation) and SA-15 (Development Process, Standards, and Tools) — see the control section below for these in your framework.

EU & UK References

Vulnerability Data

btcd is an alternative full node bitcoin implementation written in Go (golang). The btcd Bitcoin client (versions 0.10 to 0.24) did not correctly re-implement Bitcoin Core's "FindAndDelete()" functionality. This logic is consensus-critical: the difference in behavior with the other Bitcoin…

more

clients can lead to btcd clients accepting an invalid Bitcoin block (or rejecting a valid one). This consensus failure can be leveraged to cause a chain split (accepting an invalid Bitcoin block) or be exploited to DoS the btcd nodes (rejecting a valid Bitcoin block). An attacker can create a standard transaction where FindAndDelete doesn't return a match but removeOpCodeByData does making btcd get a different sighash, leading to a chain split. Importantly, this vulnerability can be exploited remotely by any Bitcoin user and does not require any hash power. This is because the difference in behavior can be triggered by a "standard" Bitcoin transaction, that is a transaction which gets relayed through the P2P network before it gets included in a Bitcoin block. `removeOpcodeByData(script []byte, dataToRemove []byte)` removes any data pushes from `script` that contain `dataToRemove`. However, `FindAndDelete` only removes exact matches. So for example, with `script = "<data> <data||foo>"` and `dataToRemove = "data"` btcd will remove both data pushes but Bitcoin Core's `FindAndDelete` only removes the first `<data>` push. This has been patched in btcd version v0.24.2. Users are advised to upgrade. There are no known workarounds for this issue.

CWE(s)

Related Threats

CVEs Like This One

CVE-2024-34478Same product: Btcd Project Btcd
CVE-2025-32996Shared CWE-670
CVE-2024-25622Shared CWE-670
CVE-2023-41058Shared CWE-670
CVE-2023-52781Shared CWE-670
CVE-2026-6608Shared CWE-670
CVE-2026-55276Shared CWE-670
CVE-2025-21607Shared CWE-670
CVE-2026-40394Shared CWE-670
CVE-2024-33431Shared CWE-670

Affected Assets

btcd project
btcd
0.10.0 — 0.24.2

Mitigating Controls

Control response

Prevent
Stop it (NIST 800-53)

Detect
Catch it (NIST detect / respond)

Harden
Shrink the surface (DISA STIG)

Validate
Prove the fix (OWASP ASVS)
  • V9.2.1

Mitigating Controls (NIST 800-53 r5) AI

Developer testing and evaluation at post-design stages directly exercises control-flow paths and reveals mismatches between implemented and intended behavior.

Requiring a documented development process and supporting tools reduces the chance that incorrect control-flow logic is introduced in the first place.

Flaw identification and remediation processes can locate and correct control-flow errors once they manifest as incorrect runtime behavior.

Mitigating Controls (NIST CSF 2.0) AI

Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→CSF cross-walk (authority under review) — links open the control.

PR.PS-06 mostly match
prevents

Secure SDLC practices directly prevent incorrect control-flow implementations via reviews, testing, and static analysis.

Mitigating Controls (ISO/IEC 27001:2022 Annex A) AI

Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→ISO cross-walk (authority under review) — links open the control.

finds

Security testing in development and acceptance can detect paths that deviate from intended logic.

prevents

Secure development lifecycle processes can catch incorrect control-flow logic during design and code review.

prevents

Secure coding standards and reviews directly target flawed control-flow implementations.

prevents

Change-management gates may prevent deployment of flawed logic but do not address the coding defect itself.

References