Lune

USENIX Security2023Top-tier venue

Silent Spring: Prototype Pollution Leads to Remote Code Execution in Node.js

Mikhail Shcherbakov, Musard Balliu, Cristian-Alexandru Staicu

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.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

24 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Undefined-oriented Programming: Detecting and Chaining Prototype Pollution Gadgets in Node.js Template Engines for Malicious Consequences cites Small World with High Risks: A Study of Security Threats in the npm Ecosystem
  • SecBench.js: An Executable Security Benchmark Suite for Server-Side JavaScript cites Finding and Preventing Bugs in JavaScript Bindings
  • SecBench.js: An Executable Security Benchmark Suite for Server-Side JavaScript cites SYNODE: Understanding and Automatically Preventing Injection Attacks on NODE.JS
  • SecBench.js: An Executable Security Benchmark Suite for Server-Side JavaScript cites BreakApp: Automated, Flexible Application Compartmentalization
  • SecBench.js: An Executable Security Benchmark Suite for Server-Side JavaScript cites Freezing the Web: A Study of ReDoS Vulnerabilities in JavaScript-based Web Servers
  • SecBench.js: An Executable Security Benchmark Suite for Server-Side JavaScript cites Small World with High Risks: A Study of Security Threats in the npm Ecosystem
  • SYNODE: Understanding and Automatically Preventing Injection Attacks on NODE.JS cites Freezing the Web: A Study of ReDoS Vulnerabilities in JavaScript-based Web Servers
  • DONAPI: Malicious NPM Packages Detector using Behavior Sequence Knowledge Mapping cites Small World with High Risks: A Study of Security Threats in the npm Ecosystem
  • Jack-in-the-box: An Empirical Study of JavaScript Bundling on the Web and its Security Implications cites Finding and Preventing Bugs in JavaScript Bindings
  • Jack-in-the-box: An Empirical Study of JavaScript Bundling on the Web and its Security Implications cites SecBench.js: An Executable Security Benchmark Suite for Server-Side JavaScript
  • Jack-in-the-box: An Empirical Study of JavaScript Bundling on the Web and its Security Implications cites SYNODE: Understanding and Automatically Preventing Injection Attacks on NODE.JS
  • Jack-in-the-box: An Empirical Study of JavaScript Bundling on the Web and its Security Implications cites Freezing the Web: A Study of ReDoS Vulnerabilities in JavaScript-based Web Servers
  • Jack-in-the-box: An Empirical Study of JavaScript Bundling on the Web and its Security Implications cites Small World with High Risks: A Study of Security Threats in the npm Ecosystem
  • Unveiling the Invisible: Detection and Evaluation of Prototype Pollution Gadgets with Dynamic Taint Analysis cites Finding and Preventing Bugs in JavaScript Bindings
  • Unveiling the Invisible: Detection and Evaluation of Prototype Pollution Gadgets with Dynamic Taint Analysis cites SYNODE: Understanding and Automatically Preventing Injection Attacks on NODE.JS
  • Unveiling the Invisible: Detection and Evaluation of Prototype Pollution Gadgets with Dynamic Taint Analysis cites Small World with High Risks: A Study of Security Threats in the npm Ecosystem
  • Small World with High Risks: A Study of Security Threats in the npm Ecosystem cites Finding and Preventing Bugs in JavaScript Bindings
  • Small World with High Risks: A Study of Security Threats in the npm Ecosystem cites SYNODE: Understanding and Automatically Preventing Injection Attacks on NODE.JS
  • Small World with High Risks: A Study of Security Threats in the npm Ecosystem cites BreakApp: Automated, Flexible Application Compartmentalization
  • Small World with High Risks: A Study of Security Threats in the npm Ecosystem cites Freezing the Web: A Study of ReDoS Vulnerabilities in JavaScript-based Web Servers
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers24

  1. DONAPI: Malicious NPM Packages Detector using Behavior Sequence Knowledge MappingCheng Huang, Nannan Wang, Ziyan Wang, Siqi Sun et al.USENIX Security 2024 · 38 citations
  2. SecBench.js: An Executable Security Benchmark Suite for Server-Side JavaScriptMasudul Hasan Masud Bhuiyan, Adithya Srinivas Parthasarathy, Nikos Vasilakis, Michael Pradel et al.ICSE 2023 · 20 citations
  3. Undefined-oriented Programming: Detecting and Chaining Prototype Pollution Gadgets in Node.js Template Engines for Malicious ConsequencesZhengyu Liu, Kecheng An, Yinzhi CaoS&P 2024 · 17 citations
  4. Jack-in-the-box: An Empirical Study of JavaScript Bundling on the Web and its Security ImplicationsJeremy Rack, Cristian-Alexandru StaicuCCS 2023 · 11 citations
  5. Unveiling the Invisible: Detection and Evaluation of Prototype Pollution Gadgets with Dynamic Taint AnalysisMikhail Shcherbakov, Paul Moosbrugger, Musard BalliuWWW 2024 · 8 citations

Builds on20

  1. Small World with High Risks: A Study of Security Threats in the npm EcosystemMarkus Zimmermann, Cristian-Alexandru Staicu, Cam Tenny, Michael PradelUSENIX Security 2019 · 281 citations
  2. Freezing the Web: A Study of ReDoS Vulnerabilities in JavaScript-based Web ServersCristian-Alexandru Staicu, Michael PradelUSENIX Security 2018 · 125 citations
  3. SYNODE: Understanding and Automatically Preventing Injection Attacks on NODE.JSCristian-Alexandru Staicu, Michael Pradel, Benjamin LivshitsNDSS 2018 · 91 citations
  4. BreakApp: Automated, Flexible Application CompartmentalizationNikos Vasilakis, Ben Karel, Nick Roessler, Nathan Dautenhahn et al.NDSS 2018 · 66 citations
  5. Finding and Preventing Bugs in JavaScript BindingsFraser Brown, Shravan Narayan, Riad S. Wahby, Dawson R. Engler et al.S&P 2017 · 63 citations

Related papers

  1. GHunter: Universal Prototype Pollution Gadgets in JavaScript RuntimesEric Cornelissen, Mikhail Shcherbakov, Musard BalliuUSENIX Security 2024 · 5 citations
  2. Detecting Node.js prototype pollution vulnerabilities via object lookup analysisSong Li, Mingqing Kang, Jianwei Hou, Yinzhi CaoFSE 2021 · 49 citations
  3. Bullseye: Detecting Prototype Pollution in NPM Packages with Proof of Concept ExploitsTariq Houis, Shaoqi Jiang, Mohammad Mannan, Amr YoussefNDSS 2026 · 2 citations
  4. Follow My Flow: Unveiling Client-Side Prototype Pollution Gadgets from One Million Real-World WebsitesZifeng Kang, Muxi Lyu, Zhengyu Liu, Jianjia Yu et al.S&P 2025
  5. Extracting taint specifications for JavaScript librariesCristian-Alexandru Staicu, Martin Toldam Torp, Max Schäfer, Anders Møller et al.ICSE 2020 · 34 citations
Dusk over the sea between two cliffs drawn in fine vertical lines