CVE-2025-69287: @bsv/sdk BSV Blockchain SDK Has An Vulnerability

MODERATE
Advisory Identifier: GHSA-vjpq-xx5g-qvmm
CVSS 5.4
CWE-573
Published
Advisory Summary

CVE-2025-69287 is a MODERATE (CVSS 5.4) bsv blockchain sdk has an vulnerability (CWE-573: Improper Following of Specification by Caller) affecting @bsv/sdk libraries in the npm ecosystem. The issue involves bsv blockchain sdk has an authentication signature data preparation vulnerability. Remediation is available by upgrading affected packages to version 2.0.0.

CVE-2025-69287 at a Glance

CVE Identifier CVE-2025-69287
GHSA Identifier GHSA-vjpq-xx5g-qvmm
Severity MODERATE
CVSS v3.1 Base Score 5.4
CWE Classification CWE-573: Improper Following of Specification by Caller
Affected Product @bsv/sdk
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 5.4

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:L).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity Low (I:L)
Availability Low (A:L)

How to Fix CVE-2025-69287

To remediate this vulnerability, upgrade all affected @bsv/sdk dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@bsv/sdk fixed: 2.0.0
npm install @bsv/sdk@2.0.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @bsv/sdk

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2025-69287, inspect your project dependencies using npm:

npm ls @bsv/sdk

Analyze the terminal output to locate any version of @bsv/sdk in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.0.0), your application is affected.

Note: The npm ls @bsv/sdk command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-573: Improper Following of Specification by Caller, where the product does not follow or incorrectly follows the specifications as required by the implementation language, environment, framework, protocol, or platform. In @bsv/sdk, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

# BRC-104 Authentication Signature Data Preparation Vulnerability ### Summary A critical cryptographic vulnerability in the TypeScript SDK's BRC-104 authentication implementation caused incorrect signature data preparation, resulting in signature incompatibility [between SDK implementations](https://github.com/F1r3Hydr4nt/brc104-cross-language-tests) and potential authentication bypass scenarios. ### Details The vulnerability was located in the `Peer.ts` file of the TypeScript SDK, specifically in the `processInitialRequest` and `processInitialResponse` methods where signature data is prepared for BRC-104 mutual authentication. **Vulnerable Code Locations:** - `ts-sdk/src/auth/Peer.ts` lines 527-531 (signing) - `ts-sdk/src/auth/Peer.ts` lines 584-590 (verification) **Root Cause:** The TypeScript SDK incorrectly prepared signature data by: 1. Concatenating base64-encoded nonce strings: `message.initialNonce + sessionNonce` 2. Then decoding the concatenated base64 string: `base64ToBytes(concatenatedString)` This produced ~32-34 bytes of signature data instead of the correct 64 bytes. **Buggy Implementation (Before Fix):** ```typescript // CRITICAL BUG: Concatenating base64 strings before decoding data: Peer.base64ToBytes(message.initialNonce + sessionNonce) ``` **Correct Implementation (After Fix):** The fix properly decodes each base64 nonce individually, then concatenates the byte arrays: ```typescript data: [ ...Peer.base64ToBytes(message.initialNonce), ...Peer.base64ToBytes(sessionNonce) ] ``` **Why This is Critical:** BRC-104 authentication relies on cryptographic signatures to establish mutual trust between peers. When signature data preparation is incorrect: - Signatures generated by the TypeScript SDK don't match those expected by Go/Python SDKs - Cross-implementation authentication fails - An attacker could potentially exploit this to bypass authentication checks ### PoC The cross-language test suite demonstrates this vulnerability: 1. **Setup**: Use identical nonces and cryptographic inputs across TypeScript, Python, and Go SDKs 2. **Vulnerable behavior**: TypeScript SDK produces different signature data than Go/Python reference implementations 3. **Impact demonstration**: Authentication attempts between TypeScript clients and Go/Python servers fail due to signature mismatch **Test Evidence:** ```typescript // Buggy approach (produces ~32-34 bytes) const concatenatedB64 = INITIAL_NONCE_B64 + SESSION_NONCE_B64; const buggyResult = Array.from(Buffer.from(concatenatedB64, 'base64')); // Correct approach (produces 64 bytes) const correctResult = [...INITIAL_NONCE_BYTES, ...SESSION_NONCE_BYTES]; ``` **Base64 Padding Short Circuit Analysis:** The vulnerability occurs because base64 padding characters (`=`) act as early termination signals for base64 decoders. When concatenating base64 strings before decoding: 1. **Individual nonces:** Each 44-character base64 string decodes to 32 bytes 2. **Concatenated string:** 88-character string containing padding in the middle 3. **Decoding result:** Base64 decoder stops at the first `=` padding character, producing only 32 bytes instead of 64 **Example with test data:** - `INITIAL_NONCE_B64`: `"QUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUE="` (44 chars → 32 bytes) - `SESSION_NONCE_B64`: `"QkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkI="` (44 chars → 32 bytes) - **Concatenated:** `"QUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUE=QkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkI="` - **Buggy decode:** Only 32 bytes (decoder stops at first `=`) - **Correct decode:** 64 bytes (32 + 32, decoded separately then concatenated) ### Impact **Vulnerability Type:** Cryptographic signature verification bypass **Severity:** Critical (CVSS 9.1 - Critical) **Affected Systems:** - TypeScript SDK clients attempting to authenticate with Go or Python SDK servers - Any BRC-104 implementation relying on cross-SDK compatibility - Mutual authentication protocols using the affected signature preparation **Who is Impacted:** - Applications using the TypeScript SDK for BRC-104 authentication - Systems requiring cross-language/SDK authentication compatibility - Any peer-to-peer authentication scenarios where TypeScript clients communicate with non-TypeScript servers **Potential Attack Vectors:** - Authentication bypass through signature verification failure - Man-in-the-middle attacks if authentication is silently ignored - Denial of service through failed authentication attempts The fix ensures all SDKs now produce identical cryptographic signatures, restoring proper mutual authentication across implementations.

CVE-2025-69287 Affected @bsv/sdk Versions

1 component(s)
Fixed Versions:
2.0.0
Product / Package Ecosystem Affected Versions Fixed Version
@bsv/sdk
npm
< 2.0.0
2.0.0

References

Frequently Asked Questions

What is CVE-2025-69287?
CVE-2025-69287 is a security vulnerability in @bsv/sdk involving BSV Blockchain SDK has an Authentication Signature Data Preparation Vulnerability under CWE-573: Improper Following of Specification by Caller.
Which @bsv/sdk versions are affected?
Affected versions include releases prior to 2.0.0 across affected packages: @bsv/sdk.
What version fixes CVE-2025-69287?
Upgrading to 2.0.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @bsv/sdk affected?
Yes, @bsv/sdk is affected in releases prior to 2.0.0. Upgrade your dependency to 2.0.0 or later.
What is the CVSS score of CVE-2025-69287?
CVE-2025-69287 has a CVSS v3.1 base score of 5.4 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:L.
What CWE is associated with CVE-2025-69287?
CVE-2025-69287 is classified under CWE-573: Improper Following of Specification by Caller (The product does not follow or incorrectly follows the specifications as required by the implementation language, environment, framework, protocol, or platform.).
How can I check npm dependencies for CVE-2025-69287?
Run the dependency tree command: 'npm ls @bsv/sdk'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-vjpq-xx5g-qvmm",
  "modified" : "2026-02-18T23:48:50Z",
  "published" : "2026-02-17T16:13:48Z",
  "aliases" : [ "CVE-2025-69287" ],
  "summary" : "BSV Blockchain SDK has an Authentication Signature Data Preparation Vulnerability",
  "details" : "# BRC-104 Authentication Signature Data Preparation Vulnerability\n\n### Summary\nA critical cryptographic vulnerability in the TypeScript SDK's BRC-104 authentication implementation caused incorrect signature data preparation, resulting in signature incompatibility [between SDK implementations](https://github.com/F1r3Hydr4nt/brc104-cross-language-tests) and potential authentication bypass scenarios.\n\n### Details\nThe vulnerability was located in the `Peer.ts` file of the TypeScript SDK, specifically in the `processInitialRequest` and `processInitialResponse` methods where signature data is prepared for BRC-104 mutual authentication.\n\n**Vulnerable Code Locations:**\n- `ts-sdk/src/auth/Peer.ts` lines 527-531 (signing)\n- `ts-sdk/src/auth/Peer.ts` lines 584-590 (verification)\n\n**Root Cause:**\nThe TypeScript SDK incorrectly prepared signature data by:\n1. Concatenating base64-encoded nonce strings: `message.initialNonce + sessionNonce`\n2. Then decoding the concatenated base64 string: `base64ToBytes(concatenatedString)`\n\nThis produced ~32-34 bytes of signature data instead of the correct 64 bytes.\n\n**Buggy Implementation (Before Fix):**\n```typescript\n// CRITICAL BUG: Concatenating base64 strings before decoding\ndata: Peer.base64ToBytes(message.initialNonce + sessionNonce)\n```\n\n**Correct Implementation (After Fix):**\nThe fix properly decodes each base64 nonce individually, then concatenates the byte arrays:\n```typescript\ndata: [\n  ...Peer.base64ToBytes(message.initialNonce),\n  ...Peer.base64ToBytes(sessionNonce)\n]\n```\n\n**Why This is Critical:**\nBRC-104 authentication relies on cryptographic signatures to establish mutual trust between peers. When signature data preparation is incorrect:\n- Signatures generated by the TypeScript SDK don't match those expected by Go/Python SDKs\n- Cross-implementation authentication fails\n- An attacker could potentially exploit this to bypass authentication checks\n\n### PoC\nThe cross-language test suite demonstrates this vulnerability:\n\n1. **Setup**: Use identical nonces and cryptographic inputs across TypeScript, Python, and Go SDKs\n2. **Vulnerable behavior**: TypeScript SDK produces different signature data than Go/Python reference implementations\n3. **Impact demonstration**: Authentication attempts between TypeScript clients and Go/Python servers fail due to signature mismatch\n\n**Test Evidence:**\n```typescript\n// Buggy approach (produces ~32-34 bytes)\nconst concatenatedB64 = INITIAL_NONCE_B64 + SESSION_NONCE_B64;\nconst buggyResult = Array.from(Buffer.from(concatenatedB64, 'base64'));\n\n// Correct approach (produces 64 bytes)\nconst correctResult = [...INITIAL_NONCE_BYTES, ...SESSION_NONCE_BYTES];\n```\n\n**Base64 Padding Short Circuit Analysis:**\n\nThe vulnerability occurs because base64 padding characters (`=`) act as early termination signals for base64 decoders. When concatenating base64 strings before decoding:\n\n1. **Individual nonces:** Each 44-character base64 string decodes to 32 bytes\n2. **Concatenated string:** 88-character string containing padding in the middle\n3. **Decoding result:** Base64 decoder stops at the first `=` padding character, producing only 32 bytes instead of 64\n\n**Example with test data:**\n- `INITIAL_NONCE_B64`: `\"QUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUE=\"` (44 chars → 32 bytes)\n- `SESSION_NONCE_B64`: `\"QkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkI=\"` (44 chars → 32 bytes)\n- **Concatenated:** `\"QUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUE=QkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkI=\"`\n- **Buggy decode:** Only 32 bytes (decoder stops at first `=`)\n- **Correct decode:** 64 bytes (32 + 32, decoded separately then concatenated)\n\n### Impact\n**Vulnerability Type:** Cryptographic signature verification bypass\n\n**Severity:** Critical (CVSS 9.1 - Critical)\n\n**Affected Systems:**\n- TypeScript SDK clients attempting to authenticate with Go or Python SDK servers\n- Any BRC-104 implementation relying on cross-SDK compatibility\n- Mutual authentication protocols using the affected signature preparation\n\n**Who is Impacted:**\n- Applications using the TypeScript SDK for BRC-104 authentication\n- Systems requiring cross-language/SDK authentication compatibility\n- Any peer-to-peer authentication scenarios where TypeScript clients communicate with non-TypeScript servers\n\n**Potential Attack Vectors:**\n- Authentication bypass through signature verification failure\n- Man-in-the-middle attacks if authentication is silently ignored\n- Denial of service through failed authentication attempts\n\nThe fix ensures all SDKs now produce identical cryptographic signatures, restoring proper mutual authentication across implementations.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@bsv/sdk"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.0.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/bsv-blockchain/ts-sdk/security/advisories/GHSA-vjpq-xx5g-qvmm"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-69287"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/bsv-blockchain/ts-sdk/commit/d8cf6930028372079d977138ae9eaa03ae2f50bb"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/bsv-blockchain/ts-sdk"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-573" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-02-17T16:13:48Z",
    "nvd_published_at" : "2026-02-18T19:21:42Z"
  }
}