Vulnerability library
Security checkSeptember 22, 2025

jsondiffpatch is vulnerable to Cross-site Scripting (XSS) via HtmlFormatter::nodeBegin

Understand the exposure, see the recommended fix, and check whether your own website has related weaknesses.

Medium severitynpmjsondiffpatch

Check your website

Find this and other vulnerabilities with a free scan.

Your scan runs on your computer. No account required.

Description

Versions of jsondiffpatch prior to 0.7.2 are vulnerable to Cross-site Scripting (XSS) in the HtmlFormatter (HtmlFormatter::nodeBegin). When diffs are rendered to HTML using the built-in formatter, untrusted payloads can inject scripts and execute in the context of a consuming web page.

Affected versions: >= 0, < 0.7.

Recommendation

Update the jsondiffpatch package to the latest compatible version. Followings are version details:

  • Affected version(s): < 0.7.2
  • Patched version(s): 0.7.2

References

Could your website be exposed too?

SmartScanner can check your website for jsondiffpatch is vulnerable to Cross-site Scripting (XSS) via HtmlFormatter::nodeBegin and gives you actionable findings to investigate.

Start a free scan

Related Issues

See something that needs correcting? Let us knowUpdated September 22, 2025