Skip to main content

CVE-2018-6341: Improper Neutralization of Input During Web Page Generation (CWE-79) in Facebook react-dom

Medium
VulnerabilityCVE-2018-6341cvecve-2018-6341cwe-79
Published: Mon Dec 31 2018 (12/31/2018, 22:00:00 UTC)
Source: CVE
Vendor/Project: Facebook
Product: react-dom

Description

React applications which rendered to HTML using the ReactDOMServer API were not escaping user-supplied attribute names at render-time. That lack of escaping could lead to a cross-site scripting vulnerability. This issue affected minor releases 16.0.x, 16.1.x, 16.2.x, 16.3.x, and 16.4.x. It was fixed in 16.0.1, 16.1.2, 16.2.1, 16.3.3, and 16.4.2.

AI-Powered Analysis

AILast updated: 07/05/2025, 17:54:35 UTC

Technical Analysis

CVE-2018-6341 is a cross-site scripting (XSS) vulnerability identified in Facebook's react-dom library, specifically affecting React applications that use the ReactDOMServer API for server-side rendering of HTML. The vulnerability arises from improper neutralization of user-supplied input during web page generation, classified under CWE-79. In affected versions (16.0.x through 16.4.x), react-dom failed to escape user-supplied attribute names at render-time, allowing malicious actors to inject crafted input that could be executed as script code in the context of the rendered page. This flaw could be exploited when untrusted data is passed as attribute names in React components rendered on the server side, potentially leading to client-side code execution. The vulnerability was addressed in patch releases 16.0.1, 16.1.2, 16.2.1, 16.3.3, and 16.4.2, which implemented proper escaping mechanisms to neutralize malicious input. The CVSS v3.1 base score is 6.1 (medium severity), reflecting a network attack vector with low attack complexity, no privileges required, but requiring user interaction, and impacting confidentiality and integrity with a scope change. No known exploits in the wild have been reported, but the vulnerability remains critical to address due to the widespread use of React in modern web applications and the potential for XSS to facilitate session hijacking, credential theft, or further exploitation.

Potential Impact

For European organizations, this vulnerability poses a significant risk primarily to web applications that utilize server-side rendering with vulnerable react-dom versions. Given React's popularity in enterprise and consumer-facing applications across Europe, exploitation could lead to unauthorized disclosure of sensitive user data, session hijacking, and defacement or manipulation of web content. This could undermine user trust, violate GDPR requirements concerning data protection and breach notification, and result in regulatory penalties. Industries with high web exposure such as finance, e-commerce, healthcare, and government services are particularly at risk. Additionally, the vulnerability could be leveraged as an initial vector for more complex multi-stage attacks, especially in environments where React applications integrate with other critical backend services. The medium severity score suggests a moderate but tangible threat, especially if combined with social engineering to induce user interaction. The lack of known exploits does not diminish the importance of remediation given the potential impact on confidentiality and integrity of data.

Mitigation Recommendations

European organizations should prioritize upgrading react-dom to patched versions 16.0.1, 16.1.2, 16.2.1, 16.3.3, or 16.4.2 or later. Beyond patching, developers should audit server-side rendering code to ensure no untrusted user input is used directly as attribute names or in other contexts that could lead to injection. Implement strict Content Security Policies (CSP) to reduce the impact of potential XSS attacks by restricting script execution sources. Employ input validation and sanitization at the application layer to complement React's escaping mechanisms. Conduct thorough security testing, including automated and manual penetration tests focusing on server-side rendering paths. Monitor web application logs for unusual input patterns or errors related to rendering. Educate development teams on secure coding practices specific to React and server-side rendering. Finally, maintain an inventory of React versions in use across all web properties to ensure timely identification and remediation of vulnerable instances.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
facebook
Date Reserved
2018-01-26T00:00:00.000Z
Cisa Enriched
true
Cvss Version
3.1
State
PUBLISHED

Threat ID: 682d981cc4522896dcbda34e

Added to database: 5/21/2025, 9:08:44 AM

Last enriched: 7/5/2025, 5:54:35 PM

Last updated: 8/16/2025, 12:01:55 AM

Views: 16

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats