SYNODE: Understanding and Automatically Preventing Injection Attacks on NODE.JS
Cristian-Alexandru Staicu, Michael Pradel, Benjamin Livshits · Network and Distributed System Security Symposium · 2018
The Node.js ecosystem has lead to the creation of many modern applications, such as serverside web applications and desktop applications.Unlike client-side JavaScript code, Node.js applications can interact freely with the operating system without the benefits of a security sandbox.As a result, command injection attacks can cause significant harm, which is compounded by the fact that independently developed Node.jsmodules interact in uncontrolled ways.This paper presents a large-scale study across 235,850 Node.js modules to explore injection vulnerabilities.We show that injection vulnerabilities are prevalent in practice, both due to eval, which was previously studied for browser code, and due to the powerful exec API introduced in Node.js.Our study suggests that thousands of modules may be vulnerable to command injection attacks and that fixing them takes a long time, even for popular projects.Motivated by these findings, we present Synode, an automatic mitigation technique that combines static analysis and runtime enforcement of security policies to use vulnerable modules in a safe way.The key idea is to statically compute a template of values passed to APIs that are prone to injections, and to synthesize a grammar-based runtime policy from these templates.Our mechanism is easy to deploy: it does not require any modification of the Node.jsplatform, it is fast (sub-millisecond runtime overhead), and it protects against attacks of vulnerable modules, while inducing very few false positives (less than 10%).
Cited by 86 works. doi:10.14722/ndss.2018.23071 Open-access PDF
Authors
References
- Compilers: Principles, Techniques, and Tools
- Principles of Program Analysis
- The essence of command injection attacks in web applications
- Using parse tree validation to prevent SQL injection attacks
- The Matter of Heartbleed
- Static detection of cross-site scripting vulnerabilities
- Automatic creation of SQL Injection and cross-site scripting attacks
- JavaScript instrumentation for browser security
- You are what you include
- GATEKEEPER: mostly static enforcement of security and reliability policies for javascript code