CVE-2023-50550 — layui
MEDIUMCVE-2023-50550 is a medium-severity (CVSS 5.4) Cross-site Scripting (XSS) vulnerability in layui. A fix is available for layui — see the affected versions and patch details below.
Layui cross-site scripting (XSS) vulnerability
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
layuinpmDescription
layui up to v2.74 was discovered to contain a cross-site scripting (XSS) vulnerability via the data-content parameter.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | layui | all versions | 2.7.5npm install layui@2.7.5 |
Affected Products
layuilayuiDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for layui, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update layui to 2.7.5 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2023-50550 is resolved across your whole dependency graph.
Workarounds
Escape or sanitise the affected output on the server side rather than relying on client-side filtering, and add a Content-Security-Policy that blocks inline script execution so injected markup cannot run even if it reaches the page.
Frequently Asked Questions
Is CVE-2023-50550 in your dependencies?
Find it across npm, including transitive dependencies.