GHSA-8Q6V-474H-WHGG
Vulnerability from github – Published: 2025-08-06 17:11 – Updated: 2025-08-07 15:11Impact
A protocol compliance bug in thinbus-srp-npm versions prior to 2.0.1 causes the client to generate a fixed 252 bits of entropy instead of the intended bit length of the safe prime (defaulted to 2048 bits). RFC 5054 states in section 2.5.4 Client Key Exchange
The client key exchange message carries the client's public value (A). The client calculates this value as A = g^a % N, where a is a random number that SHOULD be at least 256 bits in length.
The client public value is being generated from a private value that is 4 bits below the specification. This reduces the protocol's designed security margin it is now practically exploitable. The servers full sized 2048 bit random number is used to create the shared session key and password proof.
Patches
The issue is fixed in versions >= 2.0.1
Workarounds
It is possible to patch a legacy version:
// WRONG
var hexLength = this.toHex(N).length;
// CORRECT
var hexLength = this.toHex(this.N()).length;
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "thinbus-srp"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "2.0.1"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2025-54885"
],
"database_specific": {
"cwe_ids": [
"CWE-331"
],
"github_reviewed": true,
"github_reviewed_at": "2025-08-06T17:11:42Z",
"nvd_published_at": "2025-08-07T01:15:26Z",
"severity": "MODERATE"
},
"details": "### Impact\nA protocol compliance bug in thinbus-srp-npm versions prior to 2.0.1 causes the client to generate a fixed 252 bits of entropy instead of the intended bit length of the safe prime (defaulted to 2048 bits). RFC 5054 states in section [2.5.4 Client Key Exchange ](https://datatracker.ietf.org/doc/html/rfc5054#section-2.5.4)\n\n\u003e The client key exchange message carries the client\u0027s public value\n (A). The client calculates this value as A = g^a % N, where a is a\n random number that SHOULD be at least 256 bits in length.\n\nThe client public value is being generated from a private value that is 4 bits below the specification. This reduces the protocol\u0027s designed security margin it is now practically exploitable. The servers full sized 2048 bit random number is used to create the shared session key and password proof. \n\n### Patches\n\nThe issue is fixed in versions \u003e= 2.0.1\n\n### Workarounds\n\nIt is possible to patch a legacy version: \n\n```javascript\n// WRONG\nvar hexLength = this.toHex(N).length;\n\n// CORRECT \nvar hexLength = this.toHex(this.N()).length;\n```",
"id": "GHSA-8q6v-474h-whgg",
"modified": "2025-08-07T15:11:48Z",
"published": "2025-08-06T17:11:42Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/simbo1905/thinbus-srp-npm/security/advisories/GHSA-8q6v-474h-whgg"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-54885"
},
{
"type": "WEB",
"url": "https://github.com/simbo1905/thinbus-srp-npm/issues/28"
},
{
"type": "WEB",
"url": "https://github.com/simbo1905/thinbus-srp-npm/pull/30/commits/4aeaea2366e090765a8204059c7bcf3616438d31"
},
{
"type": "WEB",
"url": "https://github.com/simbo1905/thinbus-srp-npm/commit/aa7064c1db7294ce867e9bc92f26fa6c71a5a2cb"
},
{
"type": "PACKAGE",
"url": "https://github.com/simbo1905/thinbus-srp-npm"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N/E:U",
"type": "CVSS_V4"
}
],
"summary": "The Thinbus Javascript Secure Remote Password (SRP) Client Generates Fewer Bits of Entropy Than Intended"
}
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.