Miggo Logo

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

N/A

CVSS Score

Basic Information

EPSS Score
-
Published
8/6/2025
Updated
8/6/2025
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
-
Package NameEcosystemVulnerable VersionsFirst Patched Version
thinbus-srpnpm< 2.0.12.0.1

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability is a classic case of insufficient entropy due to a programming error in the thinbus-srp-npm Javascript library. The core of the issue lies in the SRP6JavascriptClientSession.randomA function, which is responsible for generating the client's private ephemeral key, a. According to RFC 5054, this key should have at least 256 bits of entropy.

The vulnerable code attempted to determine the required entropy from the length of the safe prime N. However, a bug caused the N accessor function to be passed to the length calculation logic instead of the actual prime value. When toHex(N) was called, N.toString() was invoked on the function object, yielding its source code as a string. The length of this static string was then used to seed the random number generator, resulting in a fixed and insufficient entropy of 252 bits, which is below the recommended 256 bits and significantly less than the intended 2048 bits.

The patch addressed this by changing N and g from accessor functions to properties that hold the BigInteger values directly. Consequently, the randomA function was modified to access this.N as a property, ensuring that the length calculation is performed on the actual prime number, thus restoring the intended entropy. The function generateA which calls randomA would be the primary indicator in a runtime profile during an exploitation attempt.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

### Imp**t * proto*ol *ompli*n** *u* in t*in*us-srp-npm v*rsions prior to *.*.* **us*s t** *li*nt to **n*r*t* * *ix** *** *its o* *ntropy inst*** o* t** int*n*** *it l*n*t* o* t** s*** prim* (****ult** to **** *its). R** **** st*t*s in s**tion [*.*.*

Reasoning

T** vuln*r**ility is * *l*ssi* **s* o* insu**i*i*nt *ntropy *u* to * pro*r*mmin* *rror in t** `t*in*us-srp-npm` J*v*s*ript li*r*ry. T** *or* o* t** issu* li*s in t** `SRP*J*v*s*ript*li*ntS*ssion.r*n*om*` *un*tion, w*i** is r*sponsi*l* *or **n*r*tin*