Miggo Logo

CVE-2024-43370:
gettext.js has a Cross-site Scripting injection

7.2

CVSS Score
3.1

Basic Information

EPSS Score
0.40869%
Published
8/15/2024
Updated
8/16/2024
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
gettext.jsnpm< 2.0.32.0.3

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from improper input validation of plural_form definitions in .po files. The commit 8150aeb shows the patch changed validation from regex.test() to a full string match check, indicating the original regex allowed dangerous payloads via partial matches. The vulnerable code path processes untrusted plural_form inputs which are later evaluated, creating XSS opportunities when combined with malicious plural form definitions. Though dist/ files are shown in diffs, the core logic resides in lib/gettext.js where plural form handling occurs.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

### Imp**t Possi*l* vuln*r**ility to XSS inj**tion i* .po *i*tion*ry ***inition *il*s is *orrupt** ### P*t***s Up**t* **tt*xt.js to *.*.* ### Work*roun*s M*k* sur* you *ontrol t** ori*in o* t** ***inition **t*lo* to pr*v*nt t** us* o* t*is *l*w in

Reasoning

T** vuln*r**ility st*ms *rom improp*r input v*li**tion o* plur*l_*orm ***initions in .po *il*s. T** *ommit ******* s*ows t** p*t** ***n*** v*li**tion *rom r***x.t*st() to * *ull strin* m*t** ****k, in*i**tin* t** ori*in*l r***x *llow** **n**rous p*yl