A Leader in the 2026 Gartner® Magic Quadrant™ for Endpoint Protection. Six years running.Six years. Gartner® Magic Quadrant™ Leader.Find Out Why
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2026-8657

CVE-2026-8657: jsondiffpatch Prototype Pollution Flaw

CVE-2026-8657 is a prototype pollution vulnerability in jsondiffpatch before version 0.7.6 that allows attackers to modify Object.prototype. This article covers the technical details, affected versions, and mitigation steps.

Published: May 21, 2026

CVE-2026-8657 Overview

CVE-2026-8657 is a prototype pollution vulnerability [CWE-1321] in the jsondiffpatch npm package, affecting all versions before 0.7.6. The flaw exists in the jsondiffpatch.patch() and jsondiffpatch/formatters/jsonpatch.patch() APIs. Attackers can supply crafted delta or JSON Patch documents containing special property names such as __proto__, constructor, or prototype. The library traverses these attacker-controlled path segments without filtering, allowing modification of Object.prototype. This pollution propagates across every object in the running Node.js process, enabling downstream attacks such as denial of service, logic bypass, and in some cases remote code execution depending on the host application.

Critical Impact

Successful exploitation allows attackers to modify Object.prototype globally, corrupting application state and enabling secondary attacks against any code that reads from JavaScript objects.

Affected Products

  • jsondiffpatch npm package versions before 0.7.6
  • Applications calling jsondiffpatch.patch() with untrusted delta input
  • Applications calling jsondiffpatch/formatters/jsonpatch.patch() with untrusted RFC 6902 JSON Patch input

Discovery Timeline

  • 2026-05-16 - CVE-2026-8657 published to NVD
  • 2026-05-19 - Last updated in NVD database

Technical Details for CVE-2026-8657

Vulnerability Analysis

The jsondiffpatch library applies structured delta documents to JavaScript objects to reproduce changes between two states. The patch() function walks the delta tree and assigns values to keys on the target object using attacker-controlled property names. The JSON Patch formatter parses RFC 6902 path strings and traverses nested objects using each path segment as an index.

Neither code path validated property names against JavaScript's reserved prototype-related keys. When a delta or JSON Patch document specified __proto__, constructor, or prototype as a key, the library wrote through to Object.prototype rather than the intended target object. Because every JavaScript object inherits from Object.prototype, any modification immediately affected every other object in the process.

Root Cause

The root cause is missing key validation in two locations within the patch application logic. In packages/jsondiffpatch/src/filters/nested.ts, the nested-object diff and patch filters iterated object children without excluding __proto__. In packages/jsondiffpatch/src/formatters/jsonpatch-apply.ts, the parsePathFromRFC6902 helper returned raw path segments that were then used as bracket-notation accessors during traversal, with no allowlist or denylist applied.

Attack Vector

An attacker who controls a delta document or a JSON Patch operation submitted to a vulnerable application can craft a payload with paths such as /__proto__/polluted or a delta keyed on constructor.prototype. When the application calls jsondiffpatch.patch() or the JSON Patch patch() API, the library walks the attacker-controlled segments and assigns the supplied value to Object.prototype. The attack requires no authentication when the receiving endpoint accepts JSON input from untrusted sources.

typescript
// Security patch in packages/jsondiffpatch/src/filters/nested.ts
 import ReverseContext from "../contexts/reverse.js";
 import type { ArrayDelta, Delta, Filter, ObjectDelta } from "../types.js";
 
+// '__proto__' must never be used as a property key — it bypasses normal
+// property assignment and directly modifies the object's prototype chain.
+// 'constructor' and 'prototype' are handled by the hasOwnProperty guard below
+// (we only traverse own properties of left, so inherited 'constructor' is
+// never followed into Object.prototype).
+const UNSAFE_KEYS = new Set(["__proto__"]);
+
 export const collectChildrenDiffFilter: Filter<DiffContext> = (context) => {
 	if (!context || !context.children) {
 		return;

Source: jsondiffpatch commit 381c0125

typescript
// Security patch in packages/jsondiffpatch/src/formatters/jsonpatch-apply.ts
-const parsePathFromRFC6902 = (path: string) => {
-	// see https://datatracker.ietf.org/doc/html/rfc6902#appendix-A.14
+const UNSAFE_KEYS = new Set(["__proto__", "constructor", "prototype"]);
+
+// see https://datatracker.ietf.org/doc/html/rfc6902#appendix-A.14
+function parsePathFromRFC6902(
+	path: string,
+	opts: { safe: false },
+): string[] | null;
+function parsePathFromRFC6902(path: string, opts?: { safe?: true }): string[];
+function parsePathFromRFC6902(
+	path: string,
+	{ safe = true }: { safe?: boolean } = {},
+): string[] | null {
 	if (typeof path !== "string") return path;
 	if (path.substring(0, 1) !== "/") {
 		throw new Error("JSONPatch paths must start with '/'");
 	}

Source: jsondiffpatch commit 381c0125

The patch introduces an UNSAFE_KEYS allowlist filter and refactors parsePathFromRFC6902 to optionally reject paths containing reserved property names.

Detection Methods for CVE-2026-8657

Indicators of Compromise

  • HTTP request bodies or JSON payloads containing __proto__, constructor, or prototype as JSON keys or as segments in RFC 6902 path fields such as /__proto__/....
  • Unexpected properties appearing on unrelated objects at runtime, indicating that Object.prototype has been modified.
  • Node.js process behavior changes such as new fields returned by JSON.stringify({}) containing keys not defined in source code.

Detection Strategies

  • Inspect dependency manifests (package.json, package-lock.json, yarn.lock, pnpm-lock.yaml) for jsondiffpatch versions below 0.7.6.
  • Add request-body inspection to API gateways or WAFs to flag JSON documents whose keys or path fields contain __proto__, constructor, or prototype.
  • Run a startup assertion that checks Object.prototype for unexpected enumerable properties before and after processing untrusted input.

Monitoring Recommendations

  • Log all calls to jsondiffpatch.patch() and jsonpatch.patch() along with the source IP and authenticated principal supplying the delta.
  • Alert on application error spikes following deserialization of patch documents, which often follow successful prototype pollution.
  • Track Software Composition Analysis (SCA) findings for the jsondiffpatch package and route them to the application owners responsible for ingesting external JSON.

How to Mitigate CVE-2026-8657

Immediate Actions Required

  • Upgrade jsondiffpatch to version 0.7.6 or later in all production and development environments.
  • Audit application code paths that pass user-supplied data into jsondiffpatch.patch() or jsondiffpatch/formatters/jsonpatch.patch().
  • Reject any inbound JSON Patch document whose path contains __proto__, constructor, or prototype until the upgrade is deployed.

Patch Information

The fix is shipped in jsondiffpatch version 0.7.6. See the upstream fix in jsondiffpatch commit 381c0125 and the advisory at Snyk SNYK-JS-JSONDIFFPATCH-16322990. The patch adds an UNSAFE_KEYS set covering __proto__, constructor, and prototype, and rewrites parsePathFromRFC6902 to validate segments before traversal.

Workarounds

  • Wrap calls to jsondiffpatch.patch() in a pre-processing step that recursively rejects any object containing keys equal to __proto__, constructor, or prototype.
  • Freeze Object.prototype at application startup with Object.freeze(Object.prototype) to prevent any code path from mutating it.
  • Run the Node.js process with --disable-proto=delete to remove the __proto__ accessor from Object.prototype entirely.
bash
# Upgrade jsondiffpatch to the patched release
npm install jsondiffpatch@^0.7.6

# Verify the installed version
npm ls jsondiffpatch

# Harden the Node.js runtime against prototype-pollution exploitation
node --disable-proto=delete app.js

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeOther

  • Vendor/TechJsondiffpatch

  • SeverityHIGH

  • CVSS Score7.8

  • EPSS Probability0.05%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:L/SC:N/SI:N/SA:N/E:P/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityLow
  • CWE References
  • CWE-1321
  • Technical References
  • GitHub Gist Code Snippet

  • GitHub Source Code Reference

  • GitHub Source Code Reference

  • GitHub Source Code Reference

  • GitHub Source Code Reference

  • GitHub Commit History

  • Snyk Vulnerability Report
  • Related CVEs
  • CVE-2026-8656: jsondiffpatch XSS Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English