# GHSA-ccrp-c664-8p4j: Cross-Site Scripting in markdown-to-jsx

> Attackers can execute malicious JavaScript in user browsers via crafted markdown links, requiring an upgrade to the markdown-to-jsx library.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 3 Sep 2020

## What is GHSA-ccrp-c664-8p4j?

GHSA-ccrp-c664-8p4j is a cross-site scripting vulnerability in markdown-to-jsx, published on 3 Sep 2020. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

Versions of `markdown-to-jsx` prior to 6.11.4 are vulnerable to Cross-Site Scripting. Due to insufficient input sanitization the package may render output containing malicious JavaScript. This vulnerability can be exploited through input of links containing `data` or VBScript URIs and a base64-encoded payload.

## Recommendation

Upgrade to version 6.11.4 or later.

## Which versions are affected by GHSA-ccrp-c664-8p4j?

2 open source packages ship an affected version, including markdown-to-jsx.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `markdown-to-jsx` | npm | All versions | 6.11.4 |
| `markdown-to-jsx` | npm | All versions | 6.11.4 |

## How do I fix GHSA-ccrp-c664-8p4j?

Upgrade markdown-to-jsx to 6.11.4 or later.

## Is GHSA-ccrp-c664-8p4j being exploited?

There is no known exploitation of GHSA-ccrp-c664-8p4j in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-ccrp-c664-8p4j and fix it if it is affected.

What it is: GHSA-ccrp-c664-8p4j is a cross-site scripting vulnerability in markdown-to-jsx, published on 3 Sep 2020. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of GHSA-ccrp-c664-8p4j in the wild and no public exploit code.

Affected packages and fixed versions:
- markdown-to-jsx (npm): affected all versions; fixed in 6.11.4
- markdown-to-jsx (npm): affected all versions; fixed in 6.11.4

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-ccrp-c664-8p4j/ (Markdown: https://insights.sbomify.com/GHSA-ccrp-c664-8p4j/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-ccrp-c664-8p4j

---
From sbomify Insights: https://insights.sbomify.com/GHSA-ccrp-c664-8p4j/
Summaries are generated and may contain mistakes; the official description above is the record.
