NewApp Monitoring is liveSign up free
AgentbeamBeta
Open-source package vulnerability · npm

CVE-2025-54885: The Thinbus Javascript Secure Remote Password (SRP) Client Generates Fewer Bits of Entropy Than Intended

mediumCVSS 4.0 6.9GHSA-8q6v-474h-whgg

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).

Published Aug 6, 2025 · Updated Aug 7, 2025

Affected packages

thinbus-srp

Ecosystem
npm
Affected
< 2.0.1
Fixed in
2.0.1
Check
npm ls thinbus-srp

Advisory details

From the GitHub Advisory Database (CC BY 4.0).

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;

Credited to SvenSchindler.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology