Skip to main content
QUICK REVIEW

[Paper Review] Silent Spring: Prototype Pollution Leads to Remote Code Execution in Node.js

М. А. Щербаков, Musard Balliu|arXiv (Cornell University)|Jul 22, 2022
Advanced Malware Detection TechniquesComputer Science10 citations
TL;DR

This paper presents the first systematic framework to detect and exploit prototype pollution vulnerabilities in Node.js for Remote Code Execution (RCE), combining multi-label static taint analysis for pollution detection and hybrid static-dynamic analysis to identify universal gadgets in Node.js core. The authors discover 11 universal gadgets in Node.js and manually exploit 8 RCE vulnerabilities in high-profile applications like NPM CLI and Rocket.Chat, demonstrating that prototype pollution can lead to full RCE in real-world systems.

ABSTRACT

Prototype pollution is a dangerous vulnerability affecting prototype-based languages like JavaScript and the Node.js platform. It refers to the ability of an attacker to inject properties into an object's root prototype at runtime and subsequently trigger the execution of legitimate code gadgets that access these properties on the object's prototype, leading to attacks such as Denial of Service (DoS), privilege escalation, and Remote Code Execution (RCE). While there is anecdotal evidence that prototype pollution leads to RCE, current research does not tackle the challenge of gadget detection, thus only showing feasibility of DoS attacks, mainly against Node.js libraries. In this paper, we set out to study the problem in a holistic way, from the detection of prototype pollution to detection of gadgets, with the ambitious goal of finding end-to-end exploits beyond DoS, in full-fledged Node.js applications. We build the first multi-staged framework that uses multi-label static taint analysis to identify prototype pollution in Node.js libraries and applications, as well as a hybrid approach to detect universal gadgets, notably, by analyzing the Node.js source code. We implement our framework on top of GitHub's static analysis framework CodeQL to find 11 universal gadgets in core Node.js APIs, leading to code execution. Furthermore, we use our methodology in a study of 15 popular Node.js applications to identify prototype pollutions and gadgets. We manually exploit eight RCE vulnerabilities in three high-profile applications such as NPM CLI, Parse Server, and Rocket.Chat. Our results provide alarming evidence that prototype pollution in combination with powerful universal gadgets lead to RCE in Node.js.

Motivation & Objective

  • Address the gap in prior research that only detects prototype pollution for DoS attacks, by extending detection to Remote Code Execution (RCE) exploits.
  • Identify and validate universal gadgets in Node.js core APIs that can be chained with prototype pollution to achieve RCE.
  • Develop a scalable, multi-staged framework for end-to-end detection of prototype pollution and gadget-based RCE in real-world Node.js applications.
  • Demonstrate the feasibility and severity of prototype pollution beyond DoS by manually exploiting RCE vulnerabilities in production-grade applications.
  • Establish a principled methodology for detecting prototype-based object injection vulnerabilities (POIVs) as a new class of exploit in JavaScript ecosystems.

Proposed method

  • Employ multi-label static taint analysis on CodeQL to detect prototype pollution by tracking untrusted data flows into Object.prototype mutations.
  • Design a hybrid analysis approach combining static analysis of Node.js source code with dynamic taint tracking to identify universal gadgets in core APIs.
  • Tune static analysis for high recall over precision to improve detection of rare injection sinks in real-world codebases.
  • Manually validate and verify gadget reachability and exploitability through code-level analysis and manual exploitation of real applications.
  • Use a curated dataset of 100 vulnerable packages from security advisories to train and validate the pollution detection component.
  • Apply the framework to 15 popular Node.js applications to identify both pollution vectors and exploitable gadget chains.

Experimental results

Research questions

  • RQ1Can prototype pollution in Node.js be systematically exploited to achieve Remote Code Execution (RCE), beyond known DoS attacks?
  • RQ2What are the characteristics and locations of universal gadgets in Node.js core that can be triggered via prototype pollution?
  • RQ3How can static and dynamic analysis be combined to detect exploitable gadget chains in real-world Node.js applications?
  • RQ4To what extent do existing static analysis tools for prototype pollution miss critical RCE vectors due to low recall?
  • RQ5Can prototype pollution be leveraged to exploit high-profile production applications like NPM CLI, Parse Server, and Rocket.Chat?

Key findings

  • The authors discovered 11 universal gadgets in core Node.js APIs that can be triggered via prototype pollution and used to achieve RCE in any application using those APIs.
  • Eight RCE vulnerabilities were manually exploited in real-world applications, including NPM CLI, Parse Server, and Rocket.Chat, confirming the feasibility of end-to-end attacks.
  • The proposed multi-label static taint analysis framework achieved significantly higher recall than the state-of-the-art tool ODGen, with only a modest drop in precision.
  • Prototype pollution is not limited to DoS; when combined with universal gadgets, it enables full code execution in production applications.
  • The study reveals that universal gadgets in Node.js core introduce a new class of threat—abusing unused code paths through prototype mutation to hijack control flow.
  • The hybrid analysis approach successfully identified gadget chains that static analysis alone would miss, particularly in complex or indirect data flows.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.