Skip to main content

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

Low
VulnerabilityCVE-2025-9910cvecve-2025-9910
Published: Thu Sep 11 2025 (09/11/2025, 05:00:02 UTC)
Source: CVE Database V5
Product: jsondiffpatch

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.

AI-Powered Analysis

AILast updated: 09/11/2025, 13:18:08 UTC

Technical Analysis

CVE-2025-9910 is a Cross-site Scripting (XSS) vulnerability identified in the jsondiffpatch package, specifically affecting versions prior to 0.7.2. Jsondiffpatch is a JavaScript library used to compute the difference between JSON objects and render these differences in various formats, including HTML. The vulnerability arises in the HtmlFormatter::nodeBegin function, which is responsible for generating HTML output from JSON diffs. If untrusted or malicious JSON payloads are used as the source for the diff operation, an attacker can inject malicious scripts into the resulting HTML output. This can lead to the execution of arbitrary JavaScript code in the context of the user viewing the diff output, potentially compromising the confidentiality and integrity of the affected web application. The vulnerability is exploitable remotely without requiring authentication but does require user interaction to trigger the malicious script execution, such as viewing the crafted diff output on a private website. The CVSS 4.0 base score is 2.3, indicating a low severity primarily due to limited impact and the requirement for user interaction. No known exploits are currently reported in the wild. The vulnerability is relevant for applications that use jsondiffpatch to render JSON diffs in HTML format, especially in environments where untrusted input might be diffed and displayed without proper sanitization or escaping.

Potential Impact

For European organizations, the impact of this vulnerability depends on the extent to which jsondiffpatch is used within their web applications or internal tools for JSON diff rendering. Organizations that utilize jsondiffpatch in private or internal web portals to display JSON differences could be at risk of XSS attacks if untrusted data sources are diffed and rendered without proper input validation. Successful exploitation could lead to session hijacking, unauthorized actions performed on behalf of users, or theft of sensitive information accessible through the web application. While the vulnerability is rated low severity, it could be leveraged as part of a multi-stage attack chain, especially in sectors handling sensitive data such as finance, healthcare, or government services. The requirement for user interaction and the absence of known active exploits reduce the immediate risk, but the vulnerability still poses a threat to confidentiality and integrity if left unmitigated.

Mitigation Recommendations

European organizations should upgrade jsondiffpatch to version 0.7.2 or later, where this vulnerability is fixed. If immediate upgrade is not feasible, implement strict input validation and sanitization on all JSON data before performing diff operations and rendering HTML output. Employ Content Security Policy (CSP) headers to restrict the execution of unauthorized scripts in the web application context. Additionally, avoid rendering diffs of untrusted or user-supplied JSON data in HTML format or use alternative rendering methods that do not involve HTML output. Conduct thorough code reviews and security testing focusing on XSS vectors in any custom usage of jsondiffpatch. Monitoring web application logs for unusual script injection attempts and educating developers about secure handling of JSON diff rendering can further reduce risk.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
snyk
Date Reserved
2025-09-03T08:48:06.729Z
Cvss Version
4.0
State
PUBLISHED

Threat ID: 68c2cc018a22ab8ffbcec2df

Added to database: 9/11/2025, 1:17:53 PM

Last enriched: 9/11/2025, 1:18:08 PM

Last updated: 9/11/2025, 2:27:24 PM

Views: 3

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats