CVE-2023-36475
CVE-2023-36475
Weakness (CWE)
CVSS Vector
v3.1- Attack Vector
- Network
- Attack Complexity
- Low
- Privileges Required
- None
- User Interaction
- None
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Description
Parse Server is an open source backend that can be deployed to any infrastructure that can run Node.js. Prior to versions 5.5.2 and 6.2.1, an attacker can use a prototype pollution sink to trigger a remote code execution through the MongoDB BSON parser. A patch is available in versions 5.5.2 and 6.2.1.
Comprehensive Technical Analysis of CVE-2023-36475 (Parse Server Prototype Pollution to RCE)
1. Vulnerability Assessment and Severity Evaluation
CVE ID: CVE-2023-36475 CVSS Score: 9.8 (Critical) – AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H Vulnerability Type: Prototype Pollution → Remote Code Execution (RCE) Affected Component: Parse Server (Node.js-based backend framework) with MongoDB BSON parser integration.
Severity Justification
The vulnerability is classified as Critical (CVSS 9.8) due to:
- Network-based exploitation (AV:N) – Attackers can trigger the flaw remotely without authentication.
- Low attack complexity (AC:L) – No special conditions are required for exploitation.
- No user interaction (UI:N) – The attack does not require victim participation.
- High impact on confidentiality, integrity, and availability (C:H/I:H/A:H) – Successful exploitation leads to full system compromise via RCE.
The flaw stems from prototype pollution, a well-known JavaScript vulnerability where attackers manipulate the Object.prototype to inject malicious properties, which are then processed by the MongoDB BSON parser, leading to arbitrary code execution.
2. Potential Attack Vectors and Exploitation Methods
Exploitation Chain
-
Prototype Pollution (Initial Attack Vector)
- Parse Server processes untrusted input (e.g., API requests, user-controlled data) without proper sanitization.
- An attacker crafts a malicious payload that pollutes the
Object.prototypeby injecting properties (e.g.,__proto__,constructor.prototype). - Example payload:
{ "__proto__": { "toBSON": "malicious_function()" } }
-
BSON Parser Exploitation (RCE Trigger)
- The polluted object is passed to the MongoDB BSON parser, which processes the injected properties.
- If the BSON parser evaluates the polluted
toBSONmethod (or similar properties), it executes attacker-controlled JavaScript. - This leads to arbitrary code execution in the context of the Parse Server process.
Exploitation Requirements
- Unauthenticated access to a Parse Server instance (if exposed to the internet).
- Knowledge of the Parse Server API structure (though some endpoints may be guessable).
- No prior authentication required, making this a pre-authentication RCE.
Proof-of-Concept (PoC) Considerations
- A PoC would involve:
- Identifying an endpoint that processes user input (e.g.,
/parse/classes,/parse/functions). - Crafting a payload that pollutes
Object.prototypewith a malicioustoBSONmethod. - Sending the payload to the server, triggering BSON parsing and RCE.
- Identifying an endpoint that processes user input (e.g.,
- Public PoCs may emerge given the severity, increasing exploitation risk.
3. Affected Systems and Software Versions
Vulnerable Versions
- Parse Server < 5.5.2 (5.x branch)
- Parse Server < 6.2.1 (6.x branch)
Affected Deployments
- Self-hosted Parse Server instances (common in mobile app backends, IoT platforms, and custom web services).
- Cloud-based Parse Server deployments (e.g., AWS, Azure, Heroku) if running vulnerable versions.
- Applications using Parse Server as a backend (e.g., mobile apps, web apps, APIs).
Unaffected Versions
- Parse Server ≥ 5.5.2
- Parse Server ≥ 6.2.1
4. Recommended Mitigation Strategies
Immediate Actions
-
Upgrade Parse Server Immediately
- For 5.x users: Upgrade to 5.5.2 or later.
- For 6.x users: Upgrade to 6.2.1 or later.
- Patch URLs:
-
Apply Workarounds (If Upgrade is Not Possible)
- Disable BSON parsing for untrusted input (if feasible).
- Implement strict input validation to block prototype pollution attempts.
- Use a Web Application Firewall (WAF) with rules to detect and block prototype pollution payloads (e.g., ModSecurity with OWASP CRS).
-
Network-Level Protections
- Restrict access to Parse Server via firewall rules (allow only trusted IPs).
- Disable unnecessary API endpoints if not in use.
Long-Term Security Hardening
- Regularly update dependencies (Node.js, MongoDB, Parse Server).
- Implement runtime application self-protection (RASP) to detect and block prototype pollution.
- Conduct security audits of Parse Server configurations and custom code.
- Monitor for exploitation attempts (e.g., unusual BSON parsing errors, unexpected process spawns).
5. Impact on the Cybersecurity Landscape
Exploitation Risk
- High likelihood of exploitation due to:
- Publicly disclosed vulnerability with clear attack vectors.
- No authentication required for exploitation.
- Widespread use of Parse Server in mobile and web applications.
- Potential for mass exploitation if PoCs are released (similar to past Node.js RCEs like CVE-2021-21315).
Targeted Industries
- Mobile app backends (Parse Server is commonly used for iOS/Android apps).
- IoT platforms (Parse Server powers many IoT device management systems).
- SaaS providers using Parse Server for backend services.
- Startups and enterprises with custom Node.js backends.
Broader Implications
- Supply chain risks if Parse Server is used as a dependency in other frameworks.
- Increased scrutiny on JavaScript prototype pollution in other Node.js applications.
- Potential for lateral movement if Parse Server is deployed in internal networks.
6. Technical Details for Security Professionals
Root Cause Analysis
-
Prototype Pollution Vulnerability
- Parse Server fails to sanitize user-controlled input before processing it in JavaScript objects.
- Attackers can inject properties into
Object.prototype, which are inherited by all objects. - Example:
const maliciousPayload = JSON.parse('{"__proto__": {"toBSON": "require(\'child_process\').exec(\'id\')"}}'); // Pollutes Object.prototype.toBSON
-
BSON Parser Exploitation
- The MongoDB BSON parser (used by Parse Server) evaluates certain properties (e.g.,
toBSON) during serialization/deserialization. - If
Object.prototype.toBSONis polluted, the BSON parser executes the injected code.
- The MongoDB BSON parser (used by Parse Server) evaluates certain properties (e.g.,
Exploitation Flow
- Attacker sends a crafted request to a Parse Server endpoint (e.g.,
/parse/classes). - Parse Server processes the input, leading to prototype pollution.
- BSON parser processes the polluted object, executing the malicious
toBSONmethod. - Arbitrary code execution occurs in the context of the Node.js process.
Detection and Forensics
- Log Analysis:
- Check for unusual BSON parsing errors in Parse Server logs.
- Monitor for unexpected child processes spawned by the Node.js runtime.
- Network Traffic Analysis:
- Look for anomalous API requests containing
__proto__orconstructor.prototype.
- Look for anomalous API requests containing
- Endpoint Detection & Response (EDR):
- Monitor for suspicious process execution (e.g.,
child_process.exec,spawn).
- Monitor for suspicious process execution (e.g.,
Patch Analysis
- Fix Commit 1: 3dd99dd8
- Adds input sanitization to prevent prototype pollution.
- Fix Commit 2: 5fad2928
- Hardens BSON parsing to reject polluted objects.
Recommended Security Testing
- Static Application Security Testing (SAST):
- Scan Parse Server code for prototype pollution sinks.
- Dynamic Application Security Testing (DAST):
- Fuzz API endpoints to detect prototype pollution vulnerabilities.
- Manual Code Review:
- Audit all user-controlled input processing in Parse Server.
Conclusion
CVE-2023-36475 is a critical vulnerability that allows unauthenticated RCE via prototype pollution in Parse Server. Organizations using affected versions must upgrade immediately to mitigate the risk. Given the severity and ease of exploitation, this vulnerability poses a significant threat to exposed Parse Server instances. Security teams should monitor for exploitation attempts, apply patches, and harden their deployments to prevent compromise.
For further details, refer to the official advisory.