KJS: a complete formal semantics of JavaScript
Daejun Park, Andrei R Stefanescu, Grigore Roşu · ACM SIGPLAN Notices · 2015
This paper presents KJS, the most complete and throughly tested formal semantics of JavaScript to date. Being executable, KJS has been tested against the ECMAScript 5.1 conformance test suite, and passes all 2,782 core language tests. Among the existing implementations of JavaScript, only Chrome V8's passes all the tests, and no other semantics passes more than 90%. In addition to a reference implementation for JavaScript, KJS also yields a simple coverage metric for a test suite: the set of semantic rules it exercises. Our semantics revealed that the ECMAScript 5.1 conformance test suite fails to cover several semantic rules. Guided by the semantics, we wrote tests to exercise those rules. The new tests revealed bugs both in production JavaScript engines (Chrome V8, Safari WebKit, Firefox SpiderMonkey) and in other semantics. KJS is symbolically executable, thus it can be used for formal analysis and verification of JavaScript programs. We verified non-trivial programs and found a known security vulnerability.
Cited by 13 works. doi:10.1145/2813885.2737991
Authors
References
- Conditional rewriting logic as a unified model of concurrency
- GATEKEEPER: mostly static enforcement of security and reliability policies for javascript code
- Emscripten
- Test-case reduction for C compiler bugs
- Using static analysis for Ajax intrusion detection
- An Operational Semantics for JavaScript
- An executable formal semantics of C with applications
- VEX: vetting browser extensions for security vulnerabilities
- Saving the world wide web from vulnerable JavaScript
- Automated Analysis of Security-Critical JavaScript APIs