JSAI: A static analysis platform for JavaScript

V Kashyap, K Dewey, EA Kuefner, J Wagner… - Proceedings of the …, 2014 - dl.acm.org
V Kashyap, K Dewey, EA Kuefner, J Wagner, K Gibbons, J Sarracino, B Wiedermann
Proceedings of the 22nd ACM SIGSOFT international symposium on Foundations …, 2014dl.acm.org
JavaScript is used everywhere from the browser to the server, including desktops and
mobile devices. However, the current state of the art in JavaScript static analysis lags far
behind that of other languages such as C and Java. Our goal is to help remedy this lack. We
describe JSAI, a formally specified, robust abstract interpreter for JavaScript. JSAI uses
novel abstract domains to compute a reduced product of type inference, pointer analysis,
control-flow analysis, string analysis, and integer and boolean constant propagation. Part of …
JavaScript is used everywhere from the browser to the server, including desktops and mobile devices. However, the current state of the art in JavaScript static analysis lags far behind that of other languages such as C and Java. Our goal is to help remedy this lack. We describe JSAI, a formally specified, robust abstract interpreter for JavaScript. JSAI uses novel abstract domains to compute a reduced product of type inference, pointer analysis, control-flow analysis, string analysis, and integer and boolean constant propagation. Part of JSAI's novelty is user-configurable analysis sensitivity, i.e., context-, path-, and heap-sensitivity. JSAI is designed to be provably sound with respect to a specific concrete semantics for JavaScript, which has been extensively tested against a commercial JavaScript implementation. We provide a comprehensive evaluation of JSAI's performance and precision using an extensive benchmark suite, including real-world JavaScript applications, machine generated JavaScript code via Emscripten, and browser addons. We use JSAI's configurability to evaluate a large number of analysis sensitivities (some well-known, some novel) and observe some surprising results that go against common wisdom. These results highlight the usefulness of a configurable analysis platform such as JSAI.
ACM Digital Library