Always-Incorrect Control Flow Implementation Affecting github.com/btcsuite/btcd/txscript package, versions >=0.20.0-beta <0.24.2


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.05% (18th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-GOLANG-GITHUBCOMBTCSUITEBTCDTXSCRIPT-8184988
  • published13 Oct 2024
  • disclosed11 Oct 2024
  • creditNiklas Gögge, Antoine Poinsot

Introduced: 11 Oct 2024

CVE-2024-38365  (opens in a new tab)
CWE-670  (opens in a new tab)

How to fix?

Upgrade github.com/btcsuite/btcd/txscript to version 0.24.2 or higher.

Overview

Affected versions of this package are vulnerable to Always-Incorrect Control Flow Implementation through the removeOpcodeByData function, which incorrectly removes any data push from the executed script that contains the signature, unlike the intended behavior of only removing exact matches. Exploiting this vulnerability is possible by using public key recovery to create a script containing a signature check and an extraneous data push, which, when committed to in a P2SH output and spent by a standard transaction, would be considered valid by compliant nodes but invalid by affected ones.

CVSS Scores

version 4.0
version 3.1