CVE-2025-9910: jsondiffpatch Vulnerable to Cross-site Scripting (XSS)

jsondiffpatch Updated 02 Oct 2025

Summary

11/09/2025
Yes i
Low
4.7

CVE-2025-9910: jsondiffpatch is vulnerable to Cross-site Scripting (XSS) via HtmlFormatter::nodeBegin. Affects jsondiffpatch versions < 0.7.2. Fixed in 0.7.2. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

jsondiffpatch is an open-source JavaScript library that allows developers to compute and visualize the differences between JSON objects. It is widely used for its ability to generate diffs and apply patches to JSON data structures. The library features an HtmlFormatter that can render differences in HTML format, making it easier for users to view changes. However, certain versions of jsondiffpatch are susceptible to a Cross-site Scripting (XSS) vulnerability, which can pose significant security risks if exploited.

Vulnerability Detail

Versions of jsondiffpatch prior to 0.7.2 are vulnerable to Cross-site Scripting (XSS) via the HtmlFormatter::nodeBegin method. This vulnerability allows an attacker to inject malicious scripts into HTML payloads. If untrusted payloads are used as the source for the diff and the built-in HTML formatter is employed on a private website, it may lead to code execution, compromising the security of the application and its users.

How To Fix

Latest published version: 0.7.6 as of 22 Oct 2026

npm install jsondiffpatch@0.7.6

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

0.7.2

This is the first release that contains the fix.

npm install jsondiffpatch@0.7.2

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If you cannot immediately update the package, consider sanitizing any HTML input that is passed to the HtmlFormatter to prevent script injection. You can use libraries like DOMPurify to clean the HTML content before rendering it.

Conclusion

The jsondiffpatch library has a known vulnerability (CVE-2025-9910) that allows for Cross-site Scripting (XSS) attacks in versions prior to 0.7.2. It is crucial for developers to update to the latest version to protect their applications from potential exploits. Additionally, using tools like Vulert can help monitor and identify vulnerabilities in real-time.

See every vulnerability recorded for jsondiffpatch →

Share this vulnerability

FAQ

XSS is a security vulnerability that allows attackers to inject malicious scripts into web pages viewed by other users, potentially leading to data theft or unauthorized actions.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software. You can also check your application using the Vulert playground without any signup.

Failure to address this vulnerability could lead to unauthorized access, data breaches, and compromised user accounts, resulting in significant security risks.

Yes, you can sanitize HTML inputs using libraries like DOMPurify to prevent script injection until you can update the package.

The CVSS score of this vulnerability is 4.7, indicating a moderate level of risk.

Related vulnerabilities

Recent vulnerabilities recorded for jsondiffpatch.

How To Fix

Latest published version: 0.7.6 as of 22 Oct 2026

npm install jsondiffpatch@0.7.6

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

0.7.2

This is the first release that contains the fix.

npm install jsondiffpatch@0.7.2

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback