Miggo Logo

CVE-2022-24773: Improper Verification of Cryptographic Signature in `node-forge`

5.3

CVSS Score
3.1

Basic Information

EPSS Score
0.19147%
Published
3/18/2022
Updated
1/27/2023
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
node-forgenpm< 1.3.01.3.0

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from two key issues: 1) Incomplete validation of DigestInfo's ASN.1 structure in RSA verification, and 2) Lenient DER parsing that allowed unprocessed bytes. The verify() function in rsa.js directly used asn1.fromDer without structural validation of DigestInfo, while asn1.fromDer's previous behavior allowed trailing bytes. The commit introduced digestInfoValidator and strict byte parsing to address these, confirming these functions were vulnerable pre-patch.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

### Imp**t RS* PK*S#* v*.* si*n*tur* v*ri*i**tion *o** is not prop*rly ****kin* `*i**stIn*o` *or * prop*r *SN.* stru*tur*. T*is **n l*** to su***ss*ul v*ri*i**tion wit* si*n*tur*s t**t *ont*in inv*li* stru*tur*s *ut * v*li* *i**st. ### P*t***s T**

Reasoning

T** vuln*r**ility st*ms *rom two k*y issu*s: *) In*ompl*t* v*li**tion o* *i**stIn*o's *SN.* stru*tur* in RS* v*ri*i**tion, *n* *) L*ni*nt **R p*rsin* t**t *llow** unpro**ss** *yt*s. T** `v*ri*y()` *un*tion in `rs*.js` *ir**tly us** `*sn*.*rom**r` wit