CVE-2018-6341: Cross-Site Scripting in react-dom
6.1
CVSS Score
3.0
Basic Information
CVE ID
GHSA ID
EPSS Score
0.94458%
CWE
Published
1/4/2019
Updated
9/13/2023
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
react-dom | npm | = 16.0.0 | 16.0.1 |
react-dom | npm | >= 16.1.0, < 16.1.2 | 16.1.2 |
react-dom | npm | = 16.2.0 | 16.2.1 |
react-dom | npm | >= 16.3.0, < 16.3.3 | 16.3.3 |
react-dom | npm | >= 16.4.0, < 16.4.2 | 16.4.2 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The core vulnerability exists in HTML attribute handling during SSR:
- createMarkupForProperty was missing attribute name validation (added in patch via isAttributeNameSafe check)
- isAttributeNameSafe had prototype pollution risks in cache handling
These functions appear in runtime profiles when:
- Processing props with user-controlled attribute names
- Generating HTML markup from React components
- Validating DOM properties during server-side rendering
The test cases show direct exploitation through ReactDOMServer.renderToString() with malicious attribute names, which would flow through these functions. The patch adds validation at the attribute serialization layer (createMarkupForProperty) and hardens the validation helper (isAttributeNameSafe).