# CVE-2025-9910: jsondiffpatch is vulnerable to Cross-site Scripting (XSS) via HtmlFormatter::nodeBegin

> An attacker can inject malicious scripts via HTML payloads in jsondiffpatch, potentially leading to code execution on websites using the built-in HTML formatter.

- **Severity:** Low 2.3 (`CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N/E:P`)
- **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:** 11 Sep 2025
- **Updated:** 11 Sep 2025
- **Also known as:** CLEANSTART-2026-OP77740, ECHO-a209-1045-04e4, GHSA-33vc-wfww-vjfv, MINI-4hjm-r75h-43w8, MINI-5vcf-2p87-rmx8, MINI-8x9p-573x-mjmf, MINI-9rjc-989r-c698, MINI-f3cj-33w9-qff9, MINI-hc79-xgh8-j74q, MINI-p985-j29q-xwm6, MINI-rr7h-4j8f-r9xf, ROOT-APP-NPM-CVE-2025-9910

## What is CVE-2025-9910?

CVE-2025-9910 is a low-severity cross-site scripting vulnerability in jsondiffpatch, published on 11 Sep 2025. 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 the package jsondiffpatch before 0.7.2 are vulnerable to Cross-site Scripting (XSS) via HtmlFormatter::nodeBegin. An attacker can inject malicious scripts into HTML payloads that may lead to code execution if untrusted payloads were used as source for the diff, and the result renderer using the built-in html formatter on a private website.

Weakness: CWE-79 (Improper Neutralization of Input During Web Page Generation)

## Which versions are affected by CVE-2025-9910?

2 open source packages ship an affected version, including jsondiffpatch.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `jsondiffpatch` | npm | All versions | 0.7.2 |
| `jsondiffpatch` | npm | All versions | 0.7.2 |

## How do I fix CVE-2025-9910?

Upgrade jsondiffpatch to 0.7.2 or later.

## Is CVE-2025-9910 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-9910 exists.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-9910 and fix it if it is affected.

What it is: CVE-2025-9910 is a low-severity cross-site scripting vulnerability in jsondiffpatch, published on 11 Sep 2025. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-9910 exists.

Affected packages and fixed versions:
- jsondiffpatch (npm): affected all versions; fixed in 0.7.2
- jsondiffpatch (npm): affected all versions; fixed in 0.7.2

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/CVE-2025-9910/ (Markdown: https://insights.sbomify.com/CVE-2025-9910/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-9910
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-9910
- OSV: https://osv.dev/vulnerability/CVE-2025-9910

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-9910/
Summaries are generated and may contain mistakes; the official description above is the record.
