Miggo Logo

CVE-2024-47075: Layui has DOM Clobbering gadgets that leads to Cross-site Scripting

6.4

CVSS Score
3.1

Basic Information

EPSS Score
0.06834%
Published
9/26/2024
Updated
9/26/2024
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
layuinpm< 2.9.172.9.17

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from Layui's path resolution logic in getPath() where doc.currentScript was trusted without proper validation. The patch adds a tagName check (doc.currentScript.tagName.toUpperCase() === 'SCRIPT') to prevent DOM clobbering. This matches the CVE description of DOM clobbering via name attributes and the commit diff modifying this exact code path. The function's role in determining script locations makes it a critical gadget for XSS exploitation when manipulated through injected HTML elements.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

### Summ*ry * *OM *lo***rin* vuln*r**ility **s ***n *is*ov*r** in `l*yui` t**t **n l*** to *ross-sit* S*riptin* (XSS) on w** p***s w**r* *tt**k*r-*ontroll** *TML *l*m*nts (*.*., `im*` t**s wit* uns*nitiz** `n*m*` *ttri*ut*s) *r* pr*s*nt. It's wort*

Reasoning

T** vuln*r**ility st*ms *rom L*yui's p*t* r*solution lo*i* in `**tP*t*()` w**r* `*o*.*urr*ntS*ript` w*s trust** wit*out prop*r v*li**tion. T** p*t** ***s * `t**N*m*` ****k (`*o*.*urr*ntS*ript.t**N*m*.toUpp*r**s*() === 'S*RIPT'`) to pr*v*nt *OM *lo***