Learn about CVE-2023-25572 affecting react-admin, allowing XSS attacks. Mitigation steps include upgrading to versions 3.19.12 or 4.7.6 and implementing server-side sanitization.
This CVE details a vulnerability in
react-admin
that makes it susceptible to a Cross-Site Scripting (XSS) attack when using the <RichTextField>
component.
Understanding CVE-2023-25572
This vulnerability affects
react-admin
versions prior to 3.19.12 and 4.7.6, as well as ra-ui-materialui versions before 3.19.12 and 4.7.6. The vulnerability arises due to improper handling of user input in the <RichTextField>
component, leading to a potential XSS attack.
What is CVE-2023-25572?
The vulnerability in
react-admin
allows attackers to inject malicious scripts into web pages viewed by other users. This can result in the theft of sensitive information, session hijacking, or other malicious activities.
The Impact of CVE-2023-25572
The impact of this vulnerability is rated as MEDIUM severity with a CVSS base score of 5.4. Attackers with low privileges can exploit this vulnerability over the network, requiring user interaction. While the availability impact is none, confidentiality and integrity impacts are low.
Technical Details of CVE-2023-25572
This section provides more insights into the vulnerability, including its description, affected systems and versions, and the exploitation mechanism.
Vulnerability Description
The vulnerability stems from the
<RichTextField>
component in react-admin
which outputs field values using dangerouslySetInnerHTML
without proper client-side sanitization. This can lead to XSS attacks if the data is not sanitized server-side. Versions 3.19.12 and 4.7.6 have incorporated DOMPurify
to escape HTML before outputting, addressing the issue.
Affected Systems and Versions
= 4.0.0, < 4.7.6
Exploitation Mechanism
Attackers can exploit this vulnerability by injecting malicious scripts into user input fields that utilize the
<RichTextField>
component, allowing the execution of unauthorized scripts in the context of other users' sessions.
Mitigation and Prevention
To secure systems and prevent exploitation of CVE-2023-25572, consider the following mitigation strategies:
Immediate Steps to Take
react-admin
to versions 3.19.12 or 4.7.6 to implement the necessary fixes.<RichTextField>
component with a custom field that conducts proper sanitization.Long-Term Security Practices
Patching and Updates
Stay informed about security advisories and releases from marmelab regarding
react-admin
. Apply patches and updates promptly to address security vulnerabilities and strengthen system defenses.