GHSA-8q6v-474h-whgg

Suggest an improvement
Source
https://github.com/advisories/GHSA-8q6v-474h-whgg
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/08/GHSA-8q6v-474h-whgg/GHSA-8q6v-474h-whgg.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-8q6v-474h-whgg
Aliases
  • CVE-2025-54885
Published
2025-08-06T17:11:42Z
Modified
2025-08-07T15:11:48Z
Severity
  • 6.9 (Medium) CVSS_V4 - 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 CVSS Calculator
Summary
The Thinbus Javascript Secure Remote Password (SRP) Client Generates Fewer Bits of Entropy Than Intended
Details

Impact

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;
Database specific
{
    "cwe_ids": [
        "CWE-331"
    ],
    "nvd_published_at": "2025-08-07T01:15:26Z",
    "severity": "MODERATE",
    "github_reviewed": true,
    "github_reviewed_at": "2025-08-06T17:11:42Z"
}
References

Affected packages

npm / thinbus-srp

Package

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
2.0.1