Miggo Logo

CVE-2022-36045: Cryptographically weak PRNG in `utils.generateUUID`

9.8

CVSS Score
3.1

Basic Information

EPSS Score
0.46298%
Published
8/30/2022
Updated
1/29/2023
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
nodebbnpm< 1.19.81.19.8
nodebbnpm= 2.0.02.0.1

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability explicitly references utils.generateUUID as the weak component. Commit diffs show: 1) Client-side code (public/src/utils.js) originally used Math.random() for UUID generation 2) Server-side code (src/utils.js) imported this insecure client-side implementation before being patched with crypto.randomBytes. Both implementations used the vulnerable Math.random() PRNG prior to the security patches, making them the clear attack vectors.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

### In *ri** `utils.**n*r*t*UUI*`, * **lp*r *un*tion *v*il**l* in *ss*nti*lly *ll v*rsions o* No**** (*s **r ***k *s v*.*.* *n* pot*nti*lly **rli*r) us** * *rypto*r*p*i**lly ins**ur* Ps*u*o-r*n*om num**r **n*r*tor (`M*t*.r*n*om()`), w*i** m**nt t**t

Reasoning

T** vuln*r**ility *xpli*itly r***r*n**s `utils.**n*r*t*UUI*` *s t** w**k *ompon*nt. *ommit *i**s s*ow: *) *li*nt-si** *o** (`pu*li*/sr*/utils.js`) ori*in*lly us** `M*t*.r*n*om()` *or UUI* **n*r*tion *) S*rv*r-si** *o** (`sr*/utils.js`) import** t*is