{"id":"CVE-2025-69287","aliases":["CVE-2025-69287","GHSA-vjpq-xx5g-qvmm"],"related":[],"kind":"vulnerability","state":"published","title":"BSV Blockchain SDK has an Authentication Signature Data Preparation Vulnerability","summary":"The BSV Blockchain SDK is a unified TypeScript SDK for developing scalable apps on the BSV Blockchain. Prior to version 2.0.0, a cryptographic vulnerability in the TypeScript SDK's BRC-104 authentication implementation caused incorrect signature data preparation, resulting in signature incompatibility between SDK implementations and potential authentication bypass scenarios. 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. The TypeScript SDK incorrectly prepared signature data by concatenating base64-encoded nonce strings (`message.initialNonce + sessionNonce`) then decoding the concatenated base64 string (`base64ToBytes(concatenatedString)`). This produced ~32-34 bytes of signature data instead of the correct 64 bytes. 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; and an attacker could potentially exploit this to bypass authentication checks. The fix in version 2.0.0 ensures all SDKs now produce identical cryptographic signatures, restoring proper mutual authentication across implementations.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"The BSV Blockchain SDK is a unified TypeScript SDK for developing scalable apps on the BSV Blockchain. Prior to version 2.0.0, a cryptographic vulnerability in the TypeScript SDK's BRC-104 authentication implementation caused incorrect signature data preparation, resulting in signature incompatibility between SDK implementations and potential authentication bypass scenarios. 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. The TypeScript SDK incorrectly prepared signature data by concatenating base64-encoded nonce strings (`message.initialNonce + sessionNonce`) then decoding the concatenated base64 string (`base64ToBytes(concatenatedString)`). This produced ~32-34 bytes of signature data instead of the correct 64 bytes. 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; and an attacker could potentially exploit this to bypass authentication checks. The fix in version 2.0.0 ensures all SDKs now produce identical cryptographic signatures, restoring proper mutual authentication across implementations.","source":"cvelist"},{"lang":"en","text":"# 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.","format":"markdown","source":"ghsa"},{"lang":"es","text":"El SDK de BSV Blockchain es un SDK unificado de TypeScript para desarrollar aplicaciones escalables en la BSV Blockchain. Antes de la versión 2.0.0, una vulnerabilidad criptográfica en la implementación de autenticación BRC-104 del SDK de TypeScript causó una preparación incorrecta de los datos de la firma, lo que resultó en incompatibilidad de firmas entre implementaciones de SDK y posibles escenarios de omisión de autenticación. La vulnerabilidad se encontraba en el archivo 'Peer.ts' del SDK de TypeScript, específicamente en los métodos 'processInitialRequest' y 'processInitialResponse' donde se preparan los datos de la firma para la autenticación mutua BRC-104. El SDK de TypeScript preparó incorrectamente los datos de la firma al concatenar cadenas nonce codificadas en base64 ('message.initialNonce + sessionNonce') y luego decodificar la cadena base64 concatenada ('base64ToBytes(concatenatedString)'). Esto produjo ~32-34 bytes de datos de firma en lugar de los 64 bytes correctos. La autenticación BRC-104 se basa en firmas criptográficas para establecer confianza mutua entre pares. Cuando la preparación de los datos de la firma es incorrecta, las firmas generadas por el SDK de TypeScript no coinciden con las esperadas por los SDK de Go/Python; la autenticación entre implementaciones falla; y un atacante podría potencialmente explotar esto para omitir las comprobaciones de autenticación. La corrección en la versión 2.0.0 asegura que todos los SDK ahora produzcan firmas criptográficas idénticas, restaurando la autenticación mutua adecuada entre implementaciones.","source":"nvd"}],"published":"2026-02-17T16:13:48.000Z","modified":"2026-06-17T10:00:25.970Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:L","score":5.4,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:L","score":5.4,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:L","score":5.4,"rating":"MEDIUM"}],"cwes":["CWE-573"],"affected":[{"ranges":[{"version":"< 2.0.0","status":"affected"}],"vendor":"bsv-blockchain","product":"ts-sdk","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.0.0"}],"ecosystem":"npm","package":"@bsv/sdk","purl":"pkg:npm/%40bsv/sdk","source":"ghsa"}],"references":[{"url":"https://github.com/bsv-blockchain/ts-sdk/security/advisories/GHSA-vjpq-xx5g-qvmm","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/bsv-blockchain/ts-sdk/commit/d8cf6930028372079d977138ae9eaa03ae2f50bb","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-69287","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/bsv-blockchain/ts-sdk","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-02-18T19:26:20.981Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-69287","url":"https://www.cve.org/CVERecord?id=CVE-2025-69287","licence":"CVE Terms of Use","modified":"2026-02-18T19:26:38.840Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-vjpq-xx5g-qvmm","url":"https://github.com/advisories/GHSA-vjpq-xx5g-qvmm","licence":"CC-BY-4.0","modified":"2026-02-22T23:25:55.685Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-69287","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-69287","licence":"Public domain","modified":"2026-06-17T10:00:25.970Z"}],"updatedAt":"2026-11-25T22:59:11.291Z","epss":{"score":0.00337,"percentile":0.29021,"date":"2026-12-02T12:00:21.000Z"}}