CVE-2018-6341: Cross-Site Scripting in react-dom
Summary
CVE-2018-6341: Cross-Site Scripting in react-dom. Affects react-dom across 5 version ranges.
>= 16.0.0, < 16.0.1
>= 16.1.0, < 16.1.2
>= 16.2.0, < 16.2.1
>= 16.3.0, < 16.3.3
>= 16.4.0, < 16.4.2
Fixed in 5 releases; the minimum fixed version depends on the release line you run. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
React-DOM is a package in the npm ecosystem that provides the rendering capabilities for React applications on the server-side. It allows developers to render React components to HTML using ReactDOMServer. This package is widely used in server-side React applications. However, certain versions of react-dom are vulnerable to Cross-Site Scripting (XSS) attacks.
Vulnerability Detail
The vulnerability in react-dom arises from the package's failure to validate attribute names in HTML tags. This can lead to Cross-Site Scripting in specific scenarios, enabling attackers to execute arbitrary JavaScript code in the victim's browser. To be affected by this vulnerability, the application needs to be a server-side React app, rendered to HTML using ReactDOMServer, and include an attribute name from user input in an HTML tag.
How To Fix
Fixed versions by release line
The minimum fixed version depends on the release line you run.
-
>= 16.0.0, < 16.0.116.0.1npm install react-dom@16.0.1 -
>= 16.1.0, < 16.1.216.1.2npm install react-dom@16.1.2 -
>= 16.2.0, < 16.2.116.2.1npm install react-dom@16.2.1 -
>= 16.3.0, < 16.3.316.3.3npm install react-dom@16.3.3 -
>= 16.4.0, < 16.4.216.4.2npm install react-dom@16.4.2
Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →
Workaround
There is no specific workaround mentioned for this vulnerability.
Conclusion
In conclusion, react-dom versions prior to the recommended versions are vulnerable to Cross-Site Scripting (XSS) attacks. It is crucial to upgrade to the fixed versions to ensure the security of server-side React applications. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for react-dom →
FAQ
React-DOM is a package in the npm ecosystem that provides the rendering capabilities for React applications on the server-side.
Cross-Site Scripting (XSS) is a type of security vulnerability that allows attackers to inject malicious scripts into web pages viewed by other users.
The vulnerability in react-dom arises from the package's failure to validate attribute names in HTML tags, which can lead to Cross-Site Scripting in specific scenarios.
This vulnerability can allow attackers to execute arbitrary JavaScript code in the victim's browser, potentially leading to unauthorized access, data theft, or other malicious activities.
To fix this vulnerability, it is recommended to upgrade to the latest versions of react-dom as mentioned in the 'how_to_fix' section.
Follow Vulert in Google
Get more Vulert vulnerability and dependency-security updates in Google Search and AI results.