jsondiffpatch
- < 0.7.2
A cross-site scripting (XSS) vulnerability has been identified in the jsondiffpatch package, specifically in versions prior to 0.7.2. The issue arises in the HtmlFormatter's nodeBegin method, where an attacker can inject malicious scripts into HTML payloads. If untrusted payloads are used as the source for the diff, and the resulting renderer employs the built-in HTML formatter on a private website, this could lead to code execution.
Exploitation of this vulnerability allows for cross-site scripting, where injected scripts are executed in the context of the user's browser, potentially leading to session hijacking or cookie theft.
The vulnerability can be reproduced by using jsondiffpatch version 0.6.0. Inject a script tag containing a fetch command into the JSON payloads being compared. When the diff is rendered using the HTML formatter, the script will execute, demonstrating the XSS vulnerability.
Users are advised to upgrade jsondiffpatch to version 0.7.2 or higher.
Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.