Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSubmit malicious JSON with HTML payload
-
DeliveryApplication compares with jsondiffpatch
-
ExploitAnnotated formatter renders unsanitized HTML
-
ExecutionVictim user views diff page
-
PersistBrowser executes attacker script
-
ImpactSession hijacking or data exfiltration
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding, context-aware escaping
MITRE ATT&CK
2 techniques across 2 tactics: Initial Access, Execution The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires the target web application to: (1) use jsondiffpatch's annotated formatter specifically (not the console or json formatters), (2) invoke jsondiffpatch.diff() and annotatedFormatter.format() on attacker-controllable JSON data (user uploads, external API responses, form submissions, database records modifiable by untrusted parties), and (3) render the resulting HTML output in a browser DOM without additional output encoding. Attack vector is network-based (AV:N) with no authentication required to submit malicious JSON (PR:N), but victim interaction is necessary (UI:R) - a privileged user must navigate to or refresh the page displaying the diff. Applications only comparing trusted internal configuration files or using non-HTML formatters are not vulnerable. Default configurations are exploitable if the application architecture meets the above conditions; no specific non-default settings required in jsondiffpatch itself. |
| Impact | CVSS 6.1 (Medium) reflects network attack vector with low complexity but required user interaction and changed scope. The PR:N indicates no authentication required to submit malicious JSON, but UI:R means a victim must view the rendered diff output. The Scope:Changed (S:C) designation is critical - successful XSS escapes the jsondiffpatch context to compromise the entire hosting web application, enabling session hijacking, credential theft, or malicious actions on behalf of authenticated users. CVSS Exploit maturity E:P (Proof-of-concept) confirmed by Gist reference showing working payload examples. Real-world risk depends heavily on application architecture: high for admin dashboards comparing user-submitted data, configuration management UIs, or API monitoring tools; lower for internal-only developer tools comparing trusted data sources. The fix is straightforward (standard HTML entity encoding) with no reported bypass, reducing residual risk post-patch. No CISA KEV listing suggests exploitation remains opportunistic rather than widespread, but the public POC and common usage pattern (rendering untrusted JSON diffs) make this exploitable in practice for affected applications. |
| Exploit ScenarioDerived | An attacker uploads a malicious JSON configuration file or submits crafted API data containing property names like '</pre><img src=x onerror=alert(document.cookie)><pre>'. When an administrator views the diff comparison in the application's web UI (which uses jsondiffpatch's annotated formatter), the unescaped HTML breaks out of the intended context and executes the onerror handler. The attacker's JavaScript runs in the victim's browser session, exfiltrating session tokens to an attacker-controlled server. Proof-of-concept code demonstrating this exact attack pattern is available in the referenced Gist. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – May 16, 2026
Cross-site scripting (XSS) in jsondiffpatch library versions before 0.7.6 allows remote attackers to inject malicious HTML/JavaScript through crafted JSON property names or values when the annotated formatter output is rendered in a browser. The vulnerability enables attackers to execute arbitrary client-side code in victim browsers when applications compare untrusted JSON data and display formatted diffs to users. Publicly available exploit code exists (EPSS not provided in data, no CISA KEV listing), with fix version 0.7.6 confirmed via vendor advisory and GitHub commit 232338b34.
RemediationAI
Upgrade jsondiffpatch to version 0.7.6 or later, which introduces HTML entity encoding via the htmlEscape() function applied to all user-controlled data before HTML rendering (vendor-released patch confirmed via GitHub commit 232338b34c4653148ca2f44e897a765b72c8c98f and Snyk advisory SNYK-JS-JSONDIFFPATCH-16635946). For Node.js projects, run 'npm update jsondiffpatch' or 'yarn upgrade jsondiffpatch' and verify package.json reflects >=0.7.6. If immediate upgrade is not feasible, implement server-side output sanitization using a proven HTML sanitizer library (DOMPurify, js-xss) on annotated formatter output before serving to browsers, though this adds latency and complexity. Alternatively, switch to non-HTML formatters (console, json) if visual diff rendering is not required, though this sacrifices user experience. Content Security Policy (CSP) with 'unsafe-inline' restrictions can limit but not eliminate XSS impact, as attackers may inject data exfiltration or UI redress attacks not requiring script execution. Review application code to identify all locations invoking annotatedFormatter.format() on untrusted data and prioritize patching those code paths first.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
jsondiffpatch is a JavaScript library (NPM package) for computing differences between JSON objects and rendering those diffs in various formats. The annotated formatter generates HTML output for browser display. Prior to version 0.7.6, this formatter concatenated JSON values and property names directly into HTML strings without sanitization, creating CWE-79 (Improper Neutralization of Input During Web Page Generation) vulnerabilities. The fix introduces an htmlEscape() function that encodes HTML metacharacters (&, <, >, ', ") before embedding user-controlled data into HTML context. The vulnerable code paths include text diff spans, object property names, and stringified delta values - all of which could contain attacker-controlled content from compared JSON objects. Applications using this library to compare untrusted external data (user uploads, API responses, database records) and render the annotated HTML output are affected.
Know when Jsondiffpatch gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:L/VA:N/SC:L/SI:L/SA:N/E:P
Primary rating from NVD · only source for this CVE.
CVSS VectorNVD
Lifecycle Timeline
3DescriptionCVE.org
Versions of the package jsondiffpatch before 0.7.6 are vulnerable to Cross-site Scripting (XSS) via the annotated formatter due to improper sanitization of JSON values and property names. If an application compares untrusted JSON/object data and renders annotated formatter output in the DOM, attacker-controlled HTML can be interpreted by the browser, resulting in XSS.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.
EUVD-2026-30671
GHSA-2f3m-j83v-344c
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB