Description
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.
Published: 2026-05-16
Score: 5.1 Medium
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

This vulnerability exists in versions of the jsondiffpatch JavaScript library older than 0.7.6. The annotated formatter component fails to sanitize JSON values and property names before rendering them into the browser DOM. An attacker can supply malicious JSON that contains embedded HTML or JavaScript, causing the formatter output to be processed as real markup and executing the injected code in the context of any user viewing the page. The weakness aligns with CWE‑79, which denotes Cross‑Site Scripting flaws.

Affected Systems

Any web application or front‑end project that uses the jsondiffpatch library and renders the annotated formatter output in a browser is susceptible. Versions of the library released prior to 0.7.6 are affected. The vendor is the open‑source jsondiffpatch project. The problem does not apply to releases 0.7.6 and later. The list of specific distributors or products is not available, but the default library name should suffice for identification.

Risk and Exploitability

The CVSS score of 5.1 indicates a medium‑severity vulnerability, while the EPSS score is not available, suggesting that the exploitation probability may not yet be well known. The vulnerability is not currently listed in the CISA KEV catalog. The implication is a typical cross‑site scripting scenario that could be leveraged if an attacker can insert malicious JSON into a page that performs annotation. Therefore, the attack could arise from user‑controlled input that is diffed and displayed, or from a compromised script that generates JSON for the formatter. The impact is limited to the browser context and depends on whether the page allows privileged actions or could be tricked into revealing sensitive data. The overall risk is moderate, but mitigations should be applied promptly due to the ubiquity of JSON diffing in web applications.

Generated by OpenCVE AI on May 16, 2026 at 06:21 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade jsondiffpatch to version 0.7.6 or newer.
  • If an update cannot be performed immediately, disable or avoid rendering the annotated formatter with any untrusted JSON data; process diffs only for trusted internal information or use the library in a server‑side or headless environment.
  • If disabling the formatter is not an option, sanitize or escape all JSON values and property names before feeding them to the formatter, ensuring that any embedded markup is neutralized before insertion into the DOM.

Generated by OpenCVE AI on May 16, 2026 at 06:21 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Sat, 16 May 2026 06:45:00 +0000

Type Values Removed Values Added
Title Cross‑Site Scripting via jsondiffpatch Annotated Formatter

Sat, 16 May 2026 05:30:00 +0000

Type Values Removed Values Added
Description 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.
Weaknesses CWE-79
References
Metrics cvssV3_1

{'score': 6.1, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N/E:P'}

cvssV4_0

{'score': 5.1, 'vector': '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'}


Subscriptions

No data.

cve-icon MITRE

Status: PUBLISHED

Assigner: snyk

Published:

Updated: 2026-05-16T05:00:04.462Z

Reserved: 2026-05-15T06:27:53.788Z

Link: CVE-2026-8656

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-05-16T06:16:18.347

Modified: 2026-05-16T06:16:18.347

Link: CVE-2026-8656

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-05-16T06:30:17Z

Weaknesses