cargo package report

Is bip322 safe?

1 known vulnerability, worst severity CRITICAL.

// reach

0 direct dependencies

none carry a known advisory

    0 packages depend on it

    an advisory here reaches each of them

      Create a free accountfor every dependency path, dependent and what to upgrade
      // ai model usage

      Tracked for PyPI packages. HuggingFace models declare Python dependencies, so cargo packages are not covered.


      cvss
      0.0
      critical

      severity band, no base score published

      epss
      not scored

      chance of exploitation in 30 days

      xyz score
      0.0
      medium

      CyberXYZ composite out of 10

      fig. 01 — GHSA-5chw-87w3-j9cv, the advisory selected below

      // 1 advisories

      GHSA-5chw-87w3-j9cv

      CRITICAL

      Affected versions of bip322 accepted a BIP-322 proof created with an attacker-controlled private key as a valid signature for an unrelated victim P2WPKH or P2SH-P2WPKH address, allowing complete authentication bypass in applications using verifysimple, verifysimpleencoded, verifyfull, or verifyfullencoded as proof that a user controls a Bitcoin address.

      In verifyfull, the verifier obtained the public key from the caller-controlled witness and passed it to verifyfullp2wpkh, where the supposed public-key mismatch check read the key from the same witness and compared it with itself:

      let witness_pub_key = &witness.to_vec()[1];
      
      if &pub_key.to_bytes() != witness_pub_key {
          return Err(Error::PublicKeyMismatch);
      }

      Since pubkey was originally parsed from that exact witness element, this comparison was tautological. The code verified that the signature was valid for the public key embedded in the witness, but never verified that this public key hashes to the claimed address, violating BIP-322's requirement that the messagesignature satisfy the messagechallenge (the claimed address's scriptPubKey).

      As a result, an attacker could select any victim P2WPKH or P2SH-P2WPKH address, construct the BIP-322 challenge for that address and message, sign it with their own unrelated private key, and have the proof accepted. No victim key or victim interaction was required. Application-level nonces do not mitigate this, since the attacker can construct and sign the current challenge message with their own key.

      P2TR verification is not affected: the public key is derived from the address's witness program rather than from the caller-controlled witness.

      The flaw was corrected in commit e8accbe by deriving the expected scriptPubKey from the witness public key (P2WPKH(HASH160(pubkey)), wrapped in P2SH for the nested case) and requiring it to exactly equal the scriptPubKey of the claimed address before signature verification, failing with Error::PublicKeyMismatch otherwise. The fix is included in version 0.0.11. Affected versions 0.0.6 through 0.0.10 have been yanked from crates.io.

      There is no known workaround that mitigates the vulnerability. Upgrading to version 0.0.11 is the recommended course of action.


      Checked 2026-10-11 at 01:01 UTC. The most recent advisory here was published 2026-08-14. Updated continuously from NVD, GHSA, OSV and CNA feeds.

      Think a verdict here is wrong? Tell us — we respond within 2 business days.