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-2023-3696

CVE-2023-3696: Mongoosejs Mongoose Prototype Pollution

CVE-2023-3696 is a prototype pollution vulnerability in Mongoosejs Mongoose affecting versions prior to 7.3.4. This flaw allows attackers to modify object prototypes. This article covers technical details, impact, and mitigation.

Updated: May 15, 2026

CVE-2023-3696 Overview

CVE-2023-3696 is a prototype pollution vulnerability in the automattic/mongoose MongoDB object modeling library for Node.js. The flaw affects versions prior to 7.3.4 and resides in the document initialization logic. Attackers can inject properties into Object.prototype by supplying crafted keys such as __proto__ or constructor during document initialization. This vulnerability is tracked under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes. Exploitation can lead to remote code execution, denial of service, or authentication bypass depending on how downstream application logic consumes polluted object properties.

Critical Impact

Network-reachable applications using Mongoose for document initialization with attacker-controlled input can suffer prototype pollution, leading to remote code execution and full compromise of confidentiality, integrity, and availability.

Affected Products

  • automattic/mongoose versions prior to 7.3.4
  • Node.js applications using Mongoose for MongoDB object modeling
  • Downstream packages and services that pass untrusted input through Mongoose document initialization

Discovery Timeline

  • 2023-07-17 - CVE-2023-3696 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2023-3696

Vulnerability Analysis

The vulnerability resides in the _init function within lib/document.js of Mongoose. During document initialization, the function iterates over keys from an input object and assigns corresponding values without filtering reserved JavaScript property names. When an attacker supplies keys such as __proto__ or constructor, the assignment propagates into Object.prototype, affecting every object in the running Node.js process.

Protocol pollution attacks against Node.js applications commonly lead to denial of service, security control bypass, or remote code execution when polluted properties intersect with template engines, child process spawning, or deserialization routines. The Mongoose initialization path is reachable through standard query result hydration and document construction APIs used in typical web applications.

Root Cause

The root cause is missing validation of object keys during document field initialization. The pre-patch _init function trusts all keys from the source object and proceeds to set schema paths without rejecting reserved prototype-modifying identifiers.

Attack Vector

The attack vector is network-based, requires no privileges, and needs no user interaction. An attacker submits a JSON payload containing __proto__ or constructor keys to any endpoint that constructs a Mongoose document from untrusted input. Once the prototype is polluted, the impact extends across the entire Node.js process lifetime.

javascript
// Security patch in lib/document.js - fix: avoid prototype pollution on init
function _init(index) {
    i = keys[index];
    // avoid prototype pollution
    if (i === '__proto__' || i === 'constructor') {
      return;
    }
    path = prefix + i;
    schemaType = docSchema.path(path);
}
// Source: https://github.com/automattic/mongoose/commit/305ce4ff789261df7e3f6e72363d0703e025f80d

The patch in commit 305ce4f adds an explicit check that returns early when the key matches __proto__ or constructor, preventing assignment to prototype-modifying property names.

Detection Methods for CVE-2023-3696

Indicators of Compromise

  • HTTP request bodies or query parameters containing literal __proto__, constructor, or prototype keys submitted to Node.js endpoints
  • Unexpected new properties appearing on built-in objects at runtime, such as enumeration of Object.prototype returning attacker-controlled values
  • Anomalous Node.js process behavior including unexpected child process execution following document save or hydration calls
  • Application errors referencing Mongoose document initialization paths after processing untrusted JSON input

Detection Strategies

  • Inventory all Node.js services and identify Mongoose versions in package-lock.json and yarn.lock files to flag instances below 7.3.4
  • Add runtime assertions that check Object.prototype for unexpected enumerable properties at startup and after request handling
  • Deploy web application firewall rules that inspect JSON payloads for reserved property names like __proto__ and constructor
  • Review application logs for Mongoose schema validation errors that correlate with malformed or unusual key names

Monitoring Recommendations

  • Forward Node.js application logs and HTTP request metadata to a centralized analytics platform for prototype pollution pattern matching
  • Alert on outbound connections or process spawns originating from Node.js workers shortly after document creation operations
  • Track dependency drift through software composition analysis to maintain visibility into vulnerable Mongoose versions across services

How to Mitigate CVE-2023-3696

Immediate Actions Required

  • Upgrade mongoose to version 7.3.4 or later in all Node.js services and rebuild deployment artifacts
  • Audit application code that passes user-supplied objects directly into Mongoose document constructors or Model.hydrate calls
  • Add input validation middleware that rejects requests containing __proto__, constructor, or prototype keys before they reach the ORM layer
  • Restart all Node.js processes after upgrading to clear any potentially polluted runtime state

Patch Information

The fix is available in Mongoose 7.3.4, applied via commit 305ce4ff789261df7e3f6e72363d0703e025f80d. Review the GitHub Mongoose Commit Change and the Huntr Bounty Report for technical context.

Workarounds

  • Use Object.freeze(Object.prototype) at Node.js process startup to prevent any modification of the global prototype
  • Run Node.js with the --disable-proto=delete flag to remove the __proto__ accessor from runtime objects
  • Sanitize all incoming JSON payloads using a schema validator such as Ajv or Joi configured to strip unknown and reserved keys before passing data to Mongoose
bash
# Configuration example: upgrade Mongoose and harden Node.js runtime
npm install mongoose@^7.3.4 --save

# Verify installed version
npm ls mongoose

# Launch Node.js with prototype protection
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/TechMongoosejs

  • SeverityCRITICAL

  • CVSS Score9.8

  • EPSS Probability0.46%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-1321
  • Vendor Resources
  • GitHub Mongoose Commit Change

  • Huntr Bounty Report
  • Related CVEs
  • CVE-2025-23061: Mongoosejs Mongoose SQLi Vulnerability

  • CVE-2024-53900: Mongoosejs Mongoose SQLi 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