---
id: "CVE-2026-122234"
kind: "vulnerability"
aliases: ["CVE-2026-122234"]
title: "jsondiffpatch: unescaped array-move index lets attackers inject script"
severity: "medium"
cvss: 4.7
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["javascript", "npm", "package", "web-frontend"]
not_affected_if: ["internal-data-only", "no-html-formatter"]
published_at: "2026-11-04T21:18:10+00:00"
first_seen_at: "2026-11-04T21:49:21+00:00"
updated_at: "2026-11-04T21:51:28+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-122234", "first_seen_at": "2026-11-04T21:49:21+00:00"}]
exploit_sources: []
---

# jsondiffpatch: unescaped array-move index lets attackers inject script

jsondiffpatch before 0.7.7 fails to escape an array-move destination index when rendering a delta as HTML. An attacker who controls the delta can run script in the origin of the application that renders it.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Check the installed version with `npm ls jsondiffpatch` and compare it to `0.7.7`.
- Search the codebase for calls to `formatters.html.format()` or `formatters.annotated.format()`.
- Confirm whether any delta passed to those formatters comes from user input.

## Fix

- Move `jsondiffpatch` to `0.7.7` or later, per the advisory.

## Timeline

- 2026-11-04T21:49:21+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-122234

## Documents

- [advisory] Vendor advisory: github.com https://github.com/benjamine/jsondiffpatch/security/advisories/GHSA-jhmf-rq89-q58p
- [advisory] Third-party advisory: www.vulncheck.com https://www.vulncheck.com/advisories/jsondiffpatch-before-0.7.7-xss-via-array-move-destination-in-html-formatters
- [fix] Patch: github.com https://github.com/benjamine/jsondiffpatch/commit/c6b2d97b34bc2356c816d8dd0f8b1c8af16bb6af

## From the sources

jsondiffpatch before 0.7.7 contains a cross-site scripting vulnerability that allows attackers to inject markup by supplying an unescaped array-move destination index in a delta. Attackers who control a delta passed to formatters.html.format() or formatters.annotated.format() can embed script that executes in the application's origin when output is rendered.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
