bsv-sdk and bsv-wallet Credential Forgery Vulnerability
The bsv-sdk and bsv-wallet packages are vulnerable to credential forgery because the `acquire_certificate` function persists certificate records to storage without verifying the certifier's signature, allowing attackers to forge identity certificates.
The bsv-sdk and bsv-wallet Ruby gems are vulnerable to credential forgery due to a signature verification bypass in the acquire_certificate function. This function, present in both gems, persists certificate records to storage without properly verifying the certifier’s signature. An attacker can exploit this vulnerability through two acquisition paths: by directly supplying certificate fields (direct path) or by controlling a certifier endpoint (issuance path). This allows the attacker to forge identity certificates that are then treated as authentic by other functions like list_certificates and prove_certificate. The vulnerability affects bsv-sdk versions >= 0.3.1 and < 0.8.2, and bsv-wallet versions >= 0.1.2 and < 0.3.4. This vulnerability was identified during a cross-SDK compliance review conducted on 2026-04-08.
Attack Chain
- Attacker gains access to a system that uses either the
bsv-sdkorbsv-walletRuby gem. - The attacker invokes the
acquire_certificatefunction withacquisition_protocol: 'direct'. - The attacker supplies arbitrary certificate fields, including a forged
signature, acertifier,serial_number, andrevocation_outpoint. - Alternatively, the attacker invokes the
acquire_certificatefunction withacquisition_protocol: 'issuance'and specifies a malicious certifier URL they control. - The vulnerable
acquire_certificatefunction persists the attacker-supplied certificate data to storage without verifying the certifier’s signature. - The attacker or a downstream process invokes
list_certificatesorprove_certificateto retrieve the forged certificate. - The application trusts the forged certificate as authentic, leading to credential forgery and potential unauthorized access or privilege escalation.
Impact
Successful exploitation of this vulnerability allows an attacker to forge identity certificates attributed to arbitrary certifier identities. This can lead to credential forgery, where the attacker can assert false attributes about a subject. Applications relying on the wallet’s certificate store for identity attributes, such as KYC assertions or role claims, become vulnerable to credential forgery. This is a credential-forgery primitive, not merely a spec divergence from BRC-52.
Recommendation
- Upgrade to
bsv-sdk >= 0.8.2orbsv-wallet >= 0.3.4to patch the vulnerability. These versions implement signature verification usingBSV::Wallet::CertificateSignatureand raiseBSV::Wallet::CertificateSignature::InvalidErrorfor invalid certificates. - If upgrading is not immediately possible, do not expose
acquire_certificate(either acquisition protocol) to untrusted callers, as described in the Workarounds section of this brief. - If upgrading is not immediately possible, treat any record returned by
list_certificates/prove_certificateas unverified and perform an out-of-band BRC-52 verification against the certifier’s public key before acting on it.
Detection coverage 2
Detect Direct Certificate Acquisition with Arbitrary Signature
highDetects calls to `acquire_certificate` with `acquisition_protocol: 'direct'` which could indicate an attempt to inject a forged certificate.
Detect Issuance Certificate Acquisition from Untrusted Certifier
mediumDetects calls to `acquire_certificate` with `acquisition_protocol: 'issuance'` targeting suspicious or untrusted certifier URLs.
Detection queries are kept inside the platform. Get full rules →