/

CVE-2026-55388

Severity:

HIGH RISK

(8.1)

Prototype Pollution to RCE (CWE-94) in Piscina Pool

CVE-2026-55388

Deferred

Vulnerability type

Category:

Remote Code Execution via Prototype Pollution

CWE:

CWE-94, CWE-1321

Impact:

Arbitrary Code Execution in Worker Threads

Severity:

HIGH RISK

(8.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Piscina's worker pool constructor and run() logic can inherit a polluted filename property from Object.prototype when the caller does not provide its own filename field.

If an attacker can influence prototype pollution in the hosting application, they may cause Piscina to spawn worker threads that load and execute an attacker-controlled .mjs module.

Affected context

This vulnerability appears in Node.js applications that use Piscina worker pools and accept options objects that may be influenced by untrusted data.

It manifests when:

  • The code relies on plain property access (options.filename) without guarding against prototype inheritance.
  • Object.prototype has been polluted so that filename is defined upstream.
  • Piscina instantiates worker_threads.Worker using the inherited filename value.

The risk is greatest in complex codebases where shared objects, JSON parsing, or third-party libraries can lead to prototype pollution.

Exploit preconditions

  • Attack surface: Node.js application using Piscina to manage worker threads.
  • Required access: Ability to trigger or control prototype pollution on Object.prototype.filename (often via another input-handling flaw).
  • Trigger point: Invocations of new Piscina(options) or piscina.run(...) when options.filename is not set as an own property.
  • Why exploitation is possible: The implementation reads options.filename through simple member access, allowing the read to traverse the prototype chain, which in turn feeds an attacker-controlled path into worker_threads.Worker.

Why this happens

The root cause is unsafe reliance on inherited object properties for security-sensitive configuration, combined with the broader risk of JavaScript prototype pollution.

Instead of restricting configuration reads to own properties or validating the source of filename, the code accesses options.filename directly.

Under prototype pollution (CWE-1321), Object.prototype is modified so that filename resolves to an attacker-controlled string, which is then used as the module path for worker instantiation.

This aligns with CWE-94 (Improper Control of Generation of Code) because user-influenced input determines which code module is loaded and executed inside a worker thread.

Potential impact

  • Attacker-controlled JavaScript or TypeScript module may run inside Piscina worker threads.
  • Compromise of application integrity, including manipulation of data processed in workers.
  • Unauthorized access to in-process secrets that workers can reach (API keys, tokens, configuration).
  • Potential lateral movement within the application environment and escalation of impact if workers share resources or credentials.

General mitigation guidance

Effective mitigation centers on isolating configuration from prototype pollution and hardening how options are read:

  • Treat all options objects as potentially polluted and only read own properties, for example by using safe object creation patterns or explicit property checks.
  • Normalize and validate configuration objects before passing them into Piscina, ensuring filename is defined, sanitized, and not inherited.
  • Reduce the attack surface for prototype pollution by avoiding mixing untrusted data into global objects and by freezing or sealing core prototypes where operationally viable.
  • Restrict what module paths workers may load by enforcing allowlists, controlled resolution logic, or fixed entry points rather than arbitrary filenames drawn from configuration.
  • Apply least-privilege design to worker threads, including limiting accessible environment variables, filesystem paths, and network permissions.

How teams detect issues like this

Detection strategies typically combine code-level review and automated analysis:

  • Use static analysis or linters to flag direct use of user-controllable configuration in security-sensitive APIs, especially where property access can traverse Object.prototype.
  • During code review, look for patterns where options objects are created from or merged with untrusted input and then passed into Piscina, worker_threads, or dynamic import logic.
  • Add runtime assertions or logging around worker instantiation to record resolved module paths and detect unexpected or anomalous values.
  • Employ security-focused test cases and fuzzing that attempt prototype pollution (e.g., injecting __proto__ or constructor properties) and observe whether worker creation behavior changes.

Sources

SourceLink
github.comgithub.com/piscinajs/piscina/security/advisories/GHSA-x9g3-xrwr-cwfg

Frequently asked

questions

It can be, but only if an attacker can first trigger prototype pollution in the Node.js application or otherwise control Object.prototype.filename. If that prerequisite exists through another bug or unsafe input handling, remote exploitation becomes possible through crafted requests.

The attacker needs the ability to influence upstream data flows that lead to Object.prototype being polluted, directly or via a vulnerable library. They do not need direct access to Piscina itself; they only need to cause the application to create or use options objects without a local filename property.

The robust pattern is to treat configuration as trusted-only data: read only own properties from options objects, validate filename against strict rules or allowlists, and avoid letting inherited properties influence which modules workers load.

Preventive strategies include systematically defending against prototype pollution, avoiding dynamic module loading from loosely validated configuration, applying secure object construction patterns in JavaScript/TypeScript, and incorporating security checks for prototype-related issues into code review and CI pipelines.

Find out what's already
exploitable in your codebase.