Technical impact
jsondiffpatch prior to version 0.7.7 contains a cross‑site scripting flaw that enables attacker‑controlled injection of script content into HTML output. The vulnerability is triggered when an unescaped array‑move destination index is present in a delta, which is then processed by formatters.html.format() or formatters.annotated.format(). The injected code is executed in the context of the application’s origin whenever the formatted output is rendered, allowing an attacker to hijack user sessions, steal cookies, or deface the user interface. The weakness is a classic reflected XSS flaw (CWE‑79).
Affected Systems
The affected vendor is Benjamini. The product is jsondiffpatch, a JavaScript library for computing differences between JSON objects. Any deployment of jsondiffpatch version earlier than 0.7.7 is susceptible, regardless of which JavaScript environment it runs in, as the flaw resides in the core formatter functions that are part of the public API.
Risk and Exploitability
The CVSS score of 2.3 indicates a low severity according to vendor criteria, and the exploit probability (EPSS) is not disclosed. Because the flaw manifests when a user controls the delta supplied to the formatter, it is best suited for scenarios where the application accepts user‑generated or third‑party deltas. An attacker who can deliver a malicious delta will be able to cause arbitrary script execution in the browser context of anyone who views the rendered output. The vulnerability is not currently listed in the CISA KEV catalog, implying no widely known or active exploitation, but the lack of a hard boundary means inadvertent exposure can occur in interactive or collaborative settings. The attack requires the victim to render the formatted delta, making it an “exploit‑through‑browser” risk with limited persistence.