Jul 31, 2026·5 min read·64 visits
A prototype pollution vulnerability in the recursive merging function of @phun-ky/defaults-deep versions prior to 2.0.5 allows remote attackers to execute arbitrary modification of Object.prototype attributes via crafted inputs.
CVE-2026-54737 is a high-severity Prototype Pollution vulnerability in the @phun-ky/defaults-deep npm library prior to version 2.0.5. Due to unsafe recursive object merging, unauthenticated attackers can supply structured payloads that modify the properties of Object.prototype, compromising the runtime process state.
The NPM package @phun-ky/defaults-deep is designed to apply recursive fallback values to input configurations, maintaining array structures without depending on the heavier Lodash library. The application surface area for this library includes configuration parsers, form processors, and API endpoints that ingest unstructured user input.
When applications process untrusted JSON objects and pass them to the library's defaultsDeep() or mergeWith() routines, they expose the runtime memory. The lack of key-level isolation during the recursive object merging phase exposes the environment to target-specific attribute manipulation.
This vulnerability is mapped to CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution'). Because all standard structures in JavaScript inherit from the top-level base object, any mutation occurring on the root prototype propagates directly through the entire active application memory space.
JavaScript objects resolve property requests using a prototype-based lookup mechanism. If a requested property is not explicitly defined on an instance, the engine traverses backward along the chain via the implicit __proto__ accessor until it hits the terminal root at Object.prototype. Alternatively, standard constructors expose their base class prototype via constructor.prototype.
The root cause of CVE-2026-54737 resides inside the deep merging module at src/utils/merge-with.ts. The primary recursive helper function baseMerge receives both target and source objects, evaluates properties using a custom ownKeys() iteration helper, and updates target properties without checking for reserved identifiers.
During processing, an input payload containing the key __proto__ maps to target['__proto__'], which immediately exposes the global Object.prototype. The subsequent recursive iteration steps directly into this reference and appends properties to it. Similarly, nested configurations using the keys constructor and prototype can traverse and corrupt properties on standard constructors.
An analysis of the source code before version 2.0.5 demonstrates that the recursive loop executes unchecked evaluation steps over source properties:
// Pre-2.0.5 vulnerable recursive merge processing
for (const key of ownKeys(source)) {
const srcValue = (source as any)[key];
const objValue = (target as any)[key];
if (isObjectLoose(srcValue)) {
if (!isObjectLoose(objValue)) {
(target as any)[key] = {};
}
baseMerge((target as any)[key], srcValue);
} else {
(target as any)[key] = srcValue;
}
}The maintainers resolved this issue in pull request 49 by introducing an immutable blocklist and integrating an early validation check inside the properties loop:
// Remediated key-validation block inside merge-with.ts
const UNSAFE_KEYS = new Set<string>(['__proto__', 'constructor', 'prototype']);
// ... within baseMerge
for (const key of ownKeys(source)) {
if (typeof key === 'string' && UNSAFE_KEYS.has(key)) {
continue;
}
const srcValue = (source as any)[key];
// ... process remaining properties safely
}The fix defines an explicit Set of system keys and implements a short-circuit branch that skips properties matching any banned strings. The constraint typeof key === 'string' preserves processing compatibility for symbol keys, which bypasses potential casting errors. This remediation effectively eliminates both direct and indirect lookup-path traversal vectors.
An attacker can exploit this flaw by passing a specifically structured JSON payload to an endpoint that deserializes the request and merges it with existing default state definitions.
To pollute the environment directly, the attacker structure utilizes the standard prototype accessor:
// Direct prototype pollution vector
import defaultsDeep from '@phun-ky/defaults-deep';
const payload = JSON.parse('{"__proto__": {"pollutedProperty": "compromised"}}');
defaultsDeep({}, payload);
const validationInstance = {};
console.log(validationInstance.pollutedProperty); // Output: "compromised"If basic sanitizers attempt to strip the __proto__ string, attackers can leverage constructor-based chaining to achieve the same result:
// Indirect constructor traversal vector
import { mergeWith } from '@phun-ky/defaults-deep/dist/utils/merge-with';
const target = {};
const payload = {
constructor: {
prototype: {
pollutedProperty: 'compromised'
}
}
};
mergeWith(target, payload);
console.log(({}).pollutedProperty); // Output: "compromised"The concrete impact of this vulnerability depends on how the host application utilizes objects subsequent to the merge operation. If down-stream logic evaluates administrative privilege checks by looking for uninitialized variables (e.g., checking if (user.isAdmin)), an attacker can escalate privileges globally by polluting Object.prototype.isAdmin with true.
In scenarios where the Node.js application uses template compilation libraries (like EJS, Pug, or Handlebars), attackers can exploit prototype pollution to perform Remote Code Execution (RCE). By corrupting global properties that dictate template output formatting or load internal helper modules, an attacker can hijack the shell context.
Furthermore, modifying standard object behavior can result in application-wide crash states. Corrupting basic operations like toString or valueOf raises unhandled runtime exceptions, inducing a persistent Denial of Service (DoS) across the active Node.js server container.
To remediate this vulnerability, immediate dependency upgrades must be performed. Ensure @phun-ky/defaults-deep is updated to version 2.0.5 or later:
npm install @phun-ky/defaults-deep@2.0.5If systems cannot be updated immediately, implement custom recursive payload sanitization filters to scrub dangerous keywords before passing inputs to the merge utility:
function sanitizeObject(input) {
if (typeof input !== 'object' || input === null) return input;
const unsafeProperties = ['__proto__', 'constructor', 'prototype'];
for (const property of Object.getOwnPropertyNames(input)) {
if (unsafeProperties.includes(property)) {
delete input[property];
} else {
sanitizeObject(input[property]);
}
}
return input;
}Additionally, defense-in-depth measures such as locking down the runtime base environment will help neutralize prototype modifications. Developers can enforce prototype freezing inside primary entry scripts to prevent modifications:
Object.freeze(Object.prototype);
Object.freeze(Array.prototype);CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L| Product | Affected Versions | Fixed Version |
|---|---|---|
@phun-ky/defaults-deep @phun-ky | < 2.0.5 | 2.0.5 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-1321 |
| Attack Vector | Network (AV:N) |
| CVSS Score | 7.3 (High) |
| EPSS Status | Not Registered |
| Impact | Prototype Pollution (Privilege Escalation, DoS, RCE) |
| Exploit Status | PoC Available |
| KEV Status | Not Listed |
The application receives input from an upstream component, but does not sanitize or incorrectly sanitizes the input before utilizing it to modify the attributes of an object prototype.
CVE-2026-126295 (also tracked as GHSA-fg9w-wfp5-j933) is a path confinement bypass vulnerability in the Natural Language Toolkit (NLTK) affecting versions 3.10.0 prior to 3.10.4. The flaw resides in nltk/parse/bllip.py within the BllipParser class and its factory method BllipParser.from_unified_model_dir(). Unlike sibling tool wrappers in NLTK that enforce data-root confinement via the nltk.pathsec module, BllipParser passes caller-supplied filesystem paths directly into the third-party bllipparser native C extension without validation. When an application passes untrusted input as model paths or directories to BllipParser, an attacker can force the native extension to open arbitrary files on the local filesystem. This leads to information disclosure through parser diagnostic oracles, local model tampering via shared directories, and denial of service by hanging worker threads on blocking special files (such as FIFOs or device nodes) or exhausting memory via oversized files.
CVE-2026-126300 (GHSA-ffr9-mgrr-wcvr) is an inefficient algorithmic complexity vulnerability (CWE-407) in the Natural Language Toolkit (NLTK) Python library affecting versions 3.2.5 prior to 3.10.4. The flaw resides in the quote-restoration routine of TreebankWordTokenizer.span_tokenize and NLTKWordTokenizer.span_tokenize, where repeated calls to list.pop(0) over matched quote tokens introduce quadratic O(n^2) time complexity. An unauthenticated remote attacker who supplies input containing long sequences of double-quote characters can exhaust CPU resources and degrade service availability.
The Natural Language Toolkit (NLTK) versions 3.6 through 3.10.3 contain an algorithmic complexity vulnerability in the LegalitySyllableTokenizer.tokenize method. When processing tokens composed of continuous runs of vowels, an unguarded string reversal and set membership lookup loop executes in quadratic time relative to the input token length. Remote attackers capable of submitting arbitrary text to applications utilizing this tokenizer can trigger sustained single-core CPU exhaustion and application-level denial of service.
CVE-2026-126304 is a symlink path traversal vulnerability (CWE-59) in the Natural Language Toolkit (NLTK) versions 3.10.0 prior to 3.10.4. The YCOECorpusReader class constructs internal sub-readers for the 'psd' and 'pos' subdirectories using FileSystemPathPointer.join(), which relies exclusively on lexical string-prefix validation rather than canonical path resolution. An attacker who supplies a crafted YCOE corpus containing symbolic links in place of the 'psd' or 'pos' subdirectories can bypass directory confinement and read arbitrary files from sibling corpora or sensitive directories within the NLTK data sandbox.
CVE-2026-128077 (GHSA-r99w-jh2x-3mg9) is an authorization bypass and interpretation conflict vulnerability affecting Nuxt and its underlying @nuxt/nitro-server package in versions 4.6.0 through 4.6.3. When an incoming HTTP request path begins with a double forward slash (e.g., //x/admin), the WHATWG URL parser within the Nuxt server-side page renderer interprets the initial segment as a network host/authority and resolves the remaining path (/admin) against the application's page router. Because Nitro server middleware, route-scoped serverHandlers, and Nitro routeRules evaluate the unparsed request path (//x/admin), path-based access controls, redirects, and security header policies configured for /admin fail to match and are bypassed.
Prior to version 2.10.2, the sqlite3-ruby gem explicitly cast 64-bit Ruby string lengths (long) to 32-bit signed integers (int) when invoking the underlying SQLite C API. On 64-bit platforms, providing a string of 4 GiB (2^32 bytes) or larger causes integer truncation, instructing SQLite to process only a prefix of the string. This flaw affects SQL query preparation, bound parameter values, and return values from custom Ruby-defined SQL functions and aggregates, allowing trailing SQL clauses such as WHERE restrictions to be silently dropped under specific conditions.