Skip to main content

jsondiffpatch CVE-2026-8656

| EUVDEUVD-2026-30671 LOW
Cross-site Scripting (XSS) (CWE-79)
2026-05-16 snyk GHSA-2f3m-j83v-344c
2.0
CVSS 4.0 · NVD
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Submit malicious JSON with HTML payload
  2. Delivery
    Application compares with jsondiffpatch
  3. Exploit
    Annotated formatter renders unsanitized HTML
  4. Execution
    Victim user views diff page
  5. Persist
    Browser executes attacker script
  6. Impact
    Session 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.

Monitor Track and reassess. Why: LOW severity (CVSS 0.1-3.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

jsondiffpatch 0 <0.7.6

Affected Packages

euvd jsondiffpatch fix: 0.7.6

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

NVD PRIMARY 2.0 LOW
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

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
Active
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
Low
Vulnerable system: Availability
None
Subsequent system: Confidentiality
Low
Subsequent system: Integrity
Low
Subsequent system: Availability
None

Lifecycle Timeline

3
Severity Changed
May 16, 2026 - 06:22 NVD
MEDIUM LOW
CVSS changed
May 16, 2026 - 06:22 NVD
6.1 (MEDIUM) 2.0 (LOW)
Patch available
May 16, 2026 - 06:01 EUVD

DescriptionCVE.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

EPSS Score
0.0%
Top 92% exploitable
Social Media
1
Sightings
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment CIRCL GitHub VulDB

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.

SignalValue
Severity LOW
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
LOW severity (CVSS 0.1-3.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
Poc
System Exposure· derived
Open
Automatable
No
Human Impact· derived
Low
Technical Impact
Partial

Priority Score

10
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +10
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.

Related Vulnerabilities in jsondiffpatch XSS and Prototype Pollution Flaws

View all 2

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy