RUSTSEC-2026-0334 — Vulnerability in bip322 — Advisory Details
BIP-322 address ownership verification bypass for P2WPKH and P2SH-P2WPKH addresses
Does your project use an affected bip322 version?
Paste your Cargo.lock to check it for RUSTSEC-2026-0334 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
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 verify_simple, verify_simple_encoded, verify_full, or
verify_full_encoded as proof that a user controls a Bitcoin address.
In verify_full, the verifier obtained the public key from the
caller-controlled witness and passed it to verify_full_p2wpkh, 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 pub_key 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 message_signature satisfy the message_challenge (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.
Advisory Timeline
- First published August 14, 2026 (104 days ago).
- Last revised October 9, 2026 — 56 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
cargo update -p bip322 --precise 0.0.11
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (1)
Affects 1 ecosystem: crates.io (1).
| Package | Fixed In |
|---|---|
| bip322 crates.io · Affected: All versions | 0.0.11 |
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 9.1 score means for each attack dimension.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
References
Frequently Asked Questions
- What is RUSTSEC-2026-0334?
- BIP-322 address ownership verification bypass for P2WPKH and P2SH-P2WPKH addresses. This vulnerability has been assigned a severity rating of CRITICAL (CVSS score: 9.1/10).
- How do I check if my project is affected by RUSTSEC-2026-0334?
- RUSTSEC-2026-0334 affects bip322. Use GeekWala's free vulnerability scanner to check your dependencies against RUSTSEC-2026-0334 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Maximum impact if exploited, often with little effort or access required.
Also Known As
Related CVEs
- RUSTSEC-2026-0501CRITICAL
Shamir backup recovery accepts a share at x = 0, so a supplied share can substitute the recovered private key
- CVE-2026-69157CRITICAL
Atomic Server: Unauthenticated `/setup` invite grants write access to the entire Drive