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

    Threat Intelligence

    EPSS
    0.05% (17th 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 ID SNYK-GOLANG-GITHUBCOMBTCSUITEBTCDTXSCRIPT-8184988
  • published 13 Oct 2024
  • disclosed 11 Oct 2024
  • credit Niklas Gögge, Antoine Poinsot

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
Expand this section

Snyk

Recommended
8.3 high
  • Attack Vector (AV)
    Network
  • Attack Complexity (AC)
    Low
  • Attack Requirements (AT)
    Present
  • Privileges Required (PR)
    None
  • User Interaction (UI)
    None
  • Confidentiality (VC)
    None
  • Integrity (VI)
    High
  • Availability (VA)
    High
  • Confidentiality (SC)
    None
  • Integrity (SI)
    None
  • Availability (SA)
    None