Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/3385412.3385968acmconferencesArticle/Chapter ViewAbstractPublication PagespldiConference Proceedingsconference-collections
research-article

Towards a verified range analysis for JavaScript JITs

Published: 11 June 2020 Publication History

Abstract

We present VeRA, a system for verifying the range analysis pass in browser just-in-time (JIT) compilers. Browser developers write range analysis routines in a subset of C++, and verification developers write infrastructure to verify custom analysis properties. Then, VeRA automatically verifies the range analysis routines, which browser developers can integrate directly into the JIT. We use VeRA to translate and verify Firefox range analysis routines, and it detects a new, confirmed bug that has existed in the browser for six years.

References

[1]
18.23 FJCVTZS. http://infocenter.arm.com/help/index.jsp?topic= /com.arm.doc.dui0801g/hko1477562192868.html.
[2]
Bug 1027510. https://bugzilla.mozilla.org/show_bug.cgi?id=1027510.
[3]
Bug 1493900. https://bugs.webkit.org/show_bug.cgi?id=1493900.
[4]
Bug 1595329. https://bugzilla.mozilla.org/show_bug.cgi?id=1595329.
[5]
Bug 185694. https://bugs.webkit.org/show_bug.cgi?id=185694.
[6]
Bug 765127. https://bugzilla.mozilla.org/show_bug.cgi?id=765127.
[7]
Bug 765128. https://bugzilla.mozilla.org/show_bug.cgi?id=765128.
[8]
Bug 943303. https://bugzilla.mozilla.org/show_bug.cgi?id=943303.
[9]
Bug 950438. https://bugzilla.mozilla.org/show_bug.cgi?id=950438.
[10]
Bug 950438. https://bugzilla.mozilla.org/show_bug.cgi?id=950438. googleprojectzero/fuzzilli. https://github.com/googleprojectzero/ fuzzilli.
[11]
Issue 1390. https://bugs.chromium.org/p/project-zero/issues/detail? id=1390.
[12]
Issue 1396. https://bugs.chromium.org/p/project-zero/issues/detail? id=1396.
[13]
Issue 1530. https://bugs.chromium.org/p/project-zero/issues/detail? id=1530. PLDI ’20, June 15–20, 2020, London, UK F. Brown, J. Renner, A. Nötzli, S. Lerner, H. Shacham, and D. Stefan
[14]
Issue 1544386. https://bugzilla.mozilla.org/show_bug.cgi?id=1544386.
[15]
Issue 1669. https://bugs.chromium.org/p/project-zero/issues/detail? id=1699.
[16]
Issue 1775. https://bugs.chromium.org/p/project-zero/issues/detail? id=1775.
[17]
Issue 1791. https://bugs.chromium.org/p/project-zero/issues/detail? id=1791.
[18]
Issue 1809. https://bugs.chromium.org/p/project-zero/issues/detail? id=1809.
[19]
Issue 1810. https://bugs.chromium.org/p/project-zero/issues/detail? id=1810.
[20]
Issue 1876. https://bugs.chromium.org/p/project-zero/issues/detail? id=1876.
[21]
Issue 762874. https://bugs.chromium.org/p/chromium/issues/detail? id=762874.
[22]
Issue 880207. https://bugs.chromium.org/p/chromium/issues/detail? id=880207.
[23]
Klee and C++ Analysis Target. https://github.com/klee/klee/issues/ 852.
[24]
Promote Memory to Register. https://llvm.org/docs/Passes.html# mem2reg-promote-memory-to-register.
[25]
Range::ursh. https://searchfox.org/mozilla-central/source/js/src/jit/ RangeAnalysis.cpp#1026.
[26]
Security/CryptoEngineering/HACL*. https://wiki.mozilla.org/ Security/CryptoEngineering/HACL*.
[27]
Testengineering/performance/Talos/tests. https://wiki.mozilla.org/ TestEngineering/Performance/Talos/Tests.
[28]
The C++ Standard. https://isocpp.org/std/the-standard.
[29]
z3: Bindings for the Z3 Theorem Prover. https://hackage.haskell.org/ package/z3.
[30]
J. Ansel, P. Marchenko, Ú. Erlingsson, E. Taylor, B. Chen, D. L. Schuff, D. Sehr, C. L. Biffle, and B. Yee. Language-Independent Sandboxing of Just-in-Time Compilation and Self-Modifying Code. In PLDI, 2011.
[31]
Apple. JetStream 2. https://browserbench.org/JetStream/.
[32]
Apple. SunSpider 1.0.2 JavaScript Benchmark. https://webkit.org/ perf/sunspider-1.0.2/sunspider-1.0.2/driver.html.
[33]
S. Barati. Spread’s Effects are Modeled Incorrectly Both in AI and in Clobberize. https://bugs.webkit.org/show_bug.cgi?id=181867.
[34]
M. Barbosa, G. Barthe, K. Bhargavan, B. Blanchet, C. Cremers, K. Liao, and B. Parno. SoK: Computer-Aided Cryptography. Cryptology ePrint Archive, Report 2019/1393, 2019.
[35]
https://eprint.iacr.org/2019/ 1393.
[36]
C. Barrett, P. Fontaine, and C. Tinelli. The Satisfiability Modulo Theories Library (SMT-LIB). www.smt-lib.org.
[37]
C. Barrett, A. Stump, and C. Tinelli. The SMT-LIB Standard: Version 2.0. In Workshop on Satisfiability Modulo Theories, 2010.
[38]
A. Barrière, S. Blazy, and D. Pichardie. Towards Formally Verified Just-in-Time Compilation. In CoqPL, 2020.
[39]
H. Becker, E. Darulova, M. O. Myreen, and Z. Tatlock. Icing: Supporting Fast-Math Style Optimizations in a Verified Compiler. In CAV, 2019.
[40]
H. Becker, P. Panchekha, E. Darulova, and Z. Tatlock. Combining Tools for Optimization and Analysis of Floating-Point Computations. In International Symposium on Formal Methods, 2018.
[41]
I. Beer. A Very Deep Dive into iOS Exploit Chains Found in the Wild. https://googleprojectzero.blogspot.com/2019/08/a-very-deepdive-into-ios-exploit.html, Aug. 2019.
[42]
K. Bhargavan, C. Fournet, and M. Kohlweiss. mitls: Verifying Protocol Implementations Against Real-World Attacks. IEEE Security & Privacy, 2016.
[43]
A. Biondo. Exploiting the Math.expm1 typing bug in V8. https: //abiondo.me/2019/01/02/exploiting-math-expm1-v8, Jan. 2019.
[44]
D. Blazakis. Interpreter exploitation. In WOOT, Aug. 2010.
[45]
M. Bodin, A. Charguéraud, D. Filaretti, P. Gardner, S. Maffeis, D. Naudziuniene, A. Schmitt, and G. Smith. A Trusted Mechanised JavaScript Specification. In POPL, 2014.
[46]
M. Bodin and A. Schmitt. A Certified JavaScript Interpreter. In JFLA, 2013.
[47]
S. Boldo, J.-H. Jourdan, X. Leroy, and G. Melquiond. A Formally-Verified C Compiler Supporting Floating-Point Arithmetic. In Symposium on Computer Arithmetic, 2013.
[48]
F. Brown, J. Renner, A. Nötzli, S. Lerner, H. Shacham, and D. Stefan. Towards a Verified Range Analysis for JavaScript JITs: Extended Version. https://vera-extended.programming.systems, 2020.
[49]
C. Cadar, D. Dunbar, and D. R. Engler. KLEE: Unassisted and Automatic Generation of High-Coverage Tests for Complex Systems Programs. In OSDI, 2008.
[50]
H. Chen, T. Chajed, A. Konradi, S. Wang, A. İleri, A. Chlipala, M. F. Kaashoek, and N. Zeldovich. Verifying a High-Performance Crash-Safe File System Using a Tree Specification. In SOSP, 2017.
[51]
H. Chen, D. Ziegler, T. Chajed, A. Chlipala, M. F. Kaashoek, and N. Zeldovich. Using Crash Hoare Logic for Certifying the FSCQ File System. In SOSP, 2015.
[52]
K. Claessen and J. Hughes. QuickCheck: A Lightweight Tool For Random Testing of Haskell Programs. In ICFP, 2000.
[53]
P. Cousot and R. Cousot. Abstract Interpretation: a Unified Lattice Model for Static Analysis of Programs by Construction or Approximation of Fixpoints. In POPL, 1977.
[54]
E. Darulova, A. Izycheva, F. Nasir, F. Ritter, H. Becker, and R. Bastian. Daisy - Framework for Analysis and Optimization of Numerical Programs (Tool Paper). In TACAS, 2018.
[55]
D. Delmas and J. Souyris. Astrée: from Research to Industry. In International Static Analysis Symposium, 2007.
[56]
K. Dewey, J. Roesch, and B. Hardekopf. Fuzzing the Rust Typechecker using CLP. In ASE, 2015.
[57]
E. ECMAScript, E. C. M. Association, et al. Ecmascript language specification, 2011.
[58]
J. Fetiveau. A Journey into IonMonkey: Root-Causing CVE- 2019-9810.
[59]
https://doar-e.github.io/blog/2019/06/17/a-journey-intoionmonkey-root-causing-cve-2019-9810/, June 2019.
[60]
J. Fetiveau. Attacking TurboFan. TyphoonCon, June 2019.
[61]
https://doar-e.github.io/typhooncon2019/AttackingTurboFan_ TyphoonCon_2019.pdf.
[62]
J. Fetiveau. Circumventing Chrome’s Hardening of Typer Bugs. https://doar-e.github.io/blog/2019/05/09/circumventingchromes-hardening-of-typer-bugs/, May 2019.
[63]
J. Fetiveau. Introduction to TurboFan. https://doar-e.github.io/blog/ 2019/01/28/introduction-to-turbofan/, Jan. 2019.
[64]
P. Gardner, S. Maffeis, and G. Smith. Towards a Program Logic for JavaScript. In POPL, 2012.
[65]
P. Gardner, G. Smith, C. Watt, and T. Wood. A Trusted Mechanised Specification of JavaScript: One Year On. In CAV, 2015.
[66]
S. Groß. The Art of Exploitation: Attacking JavaScript Engines: A Case Study of JavaScriptCore and CVE-2016-4622. Phrack, Oct. 2016. http://phrack.org/papers/attacking_javascript_engines.html.
[67]
S. Groß. Attacking Client-Side JIT Compilers. Black Hat, Aug. 2018.
[68]
https://saelo.github.io/presentations/blackhat_us_18_ attacking_client_side_jit_compilers.pdf.
[69]
S. Groß. FuzzIL: Coverage guided fuzzing for JavaScript engines. Master’s thesis, Karlsruhe Institute of Technology, 2018.
[70]
https://saelo. github.io/papers/thesis.pdf.
[71]
S. Groß. Fuzzilli: (Guided)-Fuzzing for JavaScript Engines. OffensiveCon 2019, Feb. 2019.
[72]
https://saelo.github.io/presentations/ offensivecon_19_fuzzilli.pdf.
[73]
S. Groß. JIT Exploitation Tricks. 0x41Con 2019, May 2019. https:// saelo.github.io/presentations/41con_19_jit_exploitation_tricks.pdf. Towards a Verified Range Analysis for JavaScript JITs PLDI ’20, June 15–20, 2020, London, UK
[74]
S. Groß. JSC Exploits. https://googleprojectzero.blogspot.com/2019/ 08/jsc-exploits.html, Aug. 2019.
[75]
S. Groß. The Art of Exploitation: Compile Your Own Type Confusions: Exploiting Logic Bugs in JavaScript JIT Engines. Phrack, May 2019. http://phrack.org/papers/jit_exploitation.html.
[76]
A. Guha, C. Saftoiu, and S. Krishnamurthi. The Essence of JavaScript. In ECOOP, 2010.
[77]
S. Guo and J. Palsberg. The Essence of Compiling with Traces. In POPL, 2011.
[78]
S. Guo and J. Palsberg. The Essence of Compiling with Traces. In POPL, 2011.
[79]
B. Hackett and S. Guo. Fast and Precise Hybrid Type Inference for JavaScript. In PLDI, 2012.
[80]
H. Han, D. Oh, and S. K. Cha. CodeAlchemist: Semantics-Aware Code Generation to Find Vulnerabilities in JavaScript Engines. In NDSS, 2019.
[81]
D. Jang, Z. Tatlock, and S. Lerner. Establishing Browser Security Guarantees Through Formal Shim Verification. In USENIX Security, 2012.
[82]
J.-H. Jourdan, V. Laporte, S. Blazy, X. Leroy, and D. Pichardie. A Formally-Verified C Static Analyzer. In POPL, 2015.
[83]
B. Keith. Attacking Edge through the JavaScript Compiler. OffensiveCon 2019, Feb. 2019.
[84]
https://github.com/bkth/Attacking-Edge-Through-the-JavaScript-Compiler.
[85]
G. Klein, K. Elphinstone, G. Heiser, J. Andronick, D. Cock, P. Derrin, D. Elkaduwe, K. Engelhardt, R. Kolanski, M. Norrish, et al. seL4: Formal Verification of an OS Kernel. In SOSP, 2009.
[86]
R. Kumar, M. O. Myreen, M. Norrish, and S. Owens. CakeML: A Verified Implementation of ML. In POPL, 2014.
[87]
S. Kundu, Z. Tatlock, and S. Lerner. Proving Optimizations Correct Using Parameterized Program Equivalence. In PLDI, 2009.
[88]
S. Lerner, T. Millstein, and C. Chambers. Automatically Proving the Correctness of Compiler Optimizations. In PLDI, 2003.
[89]
S. Lerner, T. Millstein, E. Rice, and C. Chambers. Automated Soundness Proofs for Dataflow Analyses and Transformations via Local Rules. In POPL, 2005.
[90]
X. Leroy. Formal Certification of a Compiler Back-end or: Programming a Compiler with a Proof Assistant. In POPL, 2006.
[91]
W. Lian, H. Shacham, and S. Savage. Too LeJIT to Quit: Extending JIT Spraying to ARM. In NDSS, 2015.
[92]
W. Lian, H. Shacham, and S. Savage. A Call to ARMs: Understanding the Costs and Benefits of JIT Spraying Mitigations. In NDSS, 2017.
[93]
N. P. Lopes, D. Menendez, S. Nagarakatte, and J. Regehr. Provably Correct Peephole Optimizations with Alive. In PLDI, 2015.
[94]
S. Maffeis, J. C. Mitchell, and A. Taly. An Operational Semantics for JavaScript. In APLAS, 2008.
[95]
P. Martin. Responding to Firefox 0-days in the Wild. https://blog.coinbase.com/responding-to-firefox-0-days-inthe-wild-d9c85a57f15b, Aug. 2019.
[96]
D. Menendez, S. Nagarakatte, and A. Gupta. Alive-FP: Automated Verification of Floating Point Based Peephole Optimizations in LLVM. In International Static Analysis Symposium, 2016.
[97]
E. Mullen, D. Zuniga, Z. Tatlock, and D. Grossman. Verified Peephole Optimizations for CompCert. In PLDI, 2016.
[98]
M. O. Myreen. Verified Just-In-Time Compiler on x86. In POPL, 2010.
[99]
G. C. Necula. Translation Validation for an Optimizing Compiler. In PLDI, 2000.
[100]
B. Niu and G. Tan. RockJIT: Securing Just-in-Time Compilation using Modular Control-Flow Integrity. In CCS, 2014.
[101]
A. Nötzli and F. Brown. LifeJacket: Verifying Precise Floating-Point Optimizations in LLVM. In SOAP, 2016.
[102]
P. Panchekha, A. Sanchez-Stern, J. R. Wilcox, and Z. Tatlock. Automatically Improving Accuracy for Floating Point Expressions. In PLDI, 2015.
[103]
D. Park, A. Stefănescu, and G. Roşu. KJS: A Complete Formal Semantics of JavaScript. In PLDI, 2015.
[104]
T. Park, K. Dhondt, D. Gens, Y. Na, S. Volckaert, and M. Franz. NOJITSU: Locking Down JavaScript Engines. 2020.
[105]
A. Pnueli, M. Siegel, and E. Singerman. Translation Validation. In TACAS, 1998.
[106]
J. G. Politz, M. J. Carroll, B. S. Lerner, J. Pombrio, and S. Krishnamurthi. A Tested Semantics for Getters, Setters, and Eval in JavaScript. In DLS, 2012.
[107]
Z. Rakamarić and M. Emmi. SMACK: Decoupling Source Language Details from Verifier Implementations. In CAV, 2014.
[108]
V. S. Rao. Writeup for CVE-2019-11707. https://blog.bi0s.in/2019/08/ 18/Pwn/Browser-Exploitation/cve-2019-11707-writeup/, Aug. 2019.
[109]
C. Reis, A. Moshchuk, and N. Oskov. Site Isolation: Process Separation for Web Sites within the Browser. In USENIX Security, 2019.
[110]
C. Rohlf and Y. Ivnitskiy. Attacking Clientside JIT Compilers. Black Hat, Aug. 2011.
[111]
https://media.blackhat.com/bh-us-11/Rohlf/BH_US_ 11_RohlfIvnitskiy_Attacking_Client_Side_JIT_Compilers_WP.pdf.
[112]
S. Röttger. A Guided Tour through Chrome’s JavaScript Compiler. Zer0Con, Apr. 2019.
[113]
https://docs.google.com/presentation/ d/1DJcWByz11jLoQyNhmOvkZSrkgcVhllIlCHmal1tGzaw.
[114]
S. Röttger. Trashing the Flow of Data. https://googleprojectzero. blogspot.com/2019/05/trashing-flow-of-data.html, May 2019.
[115]
H. Samet. Automatically Proving the Correctness of Translations Involving Optimized Code. PhD thesis, 1975.
[116]
B. Shingarov. Formal Verification of JIT by Symbolic Execution. In VMIL, 2019.
[117]
H. Sigurbjarnarson, J. Bornholt, E. Torlak, and X. Wang. Push-button Verification of File Systems via Crash Refinement. In OSDI, 2016.
[118]
A. Sintsov. JIT-Spray Attacks & Advanced Shellcode. HITBSecConf, 2010.
[119]
V. St-Amour and S. Guo. Optimization Coaching for JavaScript. In ECOOP, 2015.
[120]
G. Stewart, L. Beringer, S. Cuellar, and A. W. Appel. Compositional CompCert. In POPL, 2015.
[121]
J. Taneja, Z. Liu, and J. Regehr. Testing Static Analyses for Precision and Soundness. In CGO, 2020.
[122]
Z. Tatlock and S. Lerner. Bringing Extensibility to Verified Compilers. In PLDI, 2010.
[123]
L. Todesco. A Few JSC Tales. Objective by the Sea, June 2019. http: //iokit.racing/jsctales.pdf.
[124]
J. Ševčík, V. Vafeiadis, F. Zappa Nardelli, S. Jagannathan, and P. Sewell. CompCertTSO: A Verified Compiler for Relaxed-Memory Concurrency. Journal of the ACM.
[125]
N. Wang. V8 exploit. http://eternalsakura13.com/2018/05/06/v8/, May 2018.
[126]
X. Wang, D. Lazar, N. Zeldovich, A. Chlipala, and Z. Tatlock. Jitk: A Trustworthy In-Kernel Interpreter Infrastructure. In OSDI, 2014.
[127]
A. Wirfs-Brock. ECMAScript 2015 Language Specification – Math.expm1(x). https://www.ecma-international.org/ecma-262/6. 0/#sec-math.expm1, 2015.
[128]
X. Yang, Y. Chen, E. Eide, and J. Regehr. Finding and Understanding Bugs in C Compilers. In PLDI, 2011.
[129]
M. V. Yason. Understanding the Attack Surface and Attack Resilience of Project Spartan’s (Edge) New EdgeHTML Rendering Engine. Black Hat, Aug. 2015.
[130]
https://www.blackhat.com/docs/us- 15/materials/us-15-Yason-Understanding-The-Attack-Surface-And-Attack-Resilience-Of-Project-Spartans-New-EdgeHTMLRendering-Engine-wp.pdf.
[131]
J. Zhao, S. Nagarakatte, M. M. Martin, and S. Zdancewic. Formalizing the LLVM Intermediate Representation for Verified Program Transformations. In POPL, 2012.
[132]
J. Zhao, S. Nagarakatte, M. M. Martin, and S. Zdancewic. Formal Verification of SSA-Based Optimizations for LLVM. In PLDI, 2013.
[133]
PLDI ’20, June 15–20, 2020, London, UK F. Brown, J. Renner, A. Nötzli, S. Lerner, H. Shacham, and D. Stefan
[134]
Q. Zhao. Story1 Mom What Is Zero Multiplied By Infinity. https://blogs.projectmoon.pw/2019/01/13/Story1-Mom-What-Is-Zero-Multiplied-By-Infinity, Jan. 2019.
[135]
J.-K. Zinzindohoué, K. Bhargavan, J. Protzenko, and B. Beurdouche. HACL*: A Verified Modern Cryptographic Library. In CCS, 2017.

Cited By

View all
  • (2024)Accelerating Page Loads via Streamlining JavaScript Engine for Distributed LearningInformation Sciences10.1016/j.ins.2024.120713(120713)Online publication date: May-2024
  • (2023)Speeding up SMT Solving via Compiler OptimizationProceedings of the 31st ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering10.1145/3611643.3616357(1177-1189)Online publication date: 30-Nov-2023
  • (2023)Formally Verified Native Code Generation in an Effectful JIT: Turning the CompCert Backend into a Formally Verified JIT CompilerProceedings of the ACM on Programming Languages10.1145/35712027:POPL(249-277)Online publication date: 9-Jan-2023
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
PLDI 2020: Proceedings of the 41st ACM SIGPLAN Conference on Programming Language Design and Implementation
June 2020
1174 pages
ISBN:9781450376136
DOI:10.1145/3385412
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 11 June 2020

Permissions

Request permissions for this article.

Check for updates

Badges

Author Tags

  1. JIT verification
  2. JavaScript
  3. range analysis

Qualifiers

  • Research-article

Conference

PLDI '20
Sponsor:

Acceptance Rates

Overall Acceptance Rate 406 of 2,067 submissions, 20%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)99
  • Downloads (Last 6 weeks)6
Reflects downloads up to 25 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2024)Accelerating Page Loads via Streamlining JavaScript Engine for Distributed LearningInformation Sciences10.1016/j.ins.2024.120713(120713)Online publication date: May-2024
  • (2023)Speeding up SMT Solving via Compiler OptimizationProceedings of the 31st ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering10.1145/3611643.3616357(1177-1189)Online publication date: 30-Nov-2023
  • (2023)Formally Verified Native Code Generation in an Effectful JIT: Turning the CompCert Backend into a Formally Verified JIT CompilerProceedings of the ACM on Programming Languages10.1145/35712027:POPL(249-277)Online publication date: 9-Jan-2023
  • (2022)Sound, Precise, and Fast Abstract Interpretation with Tristate Numbers2022 IEEE/ACM International Symposium on Code Generation and Optimization (CGO)10.1109/CGO53902.2022.9741267(254-265)Online publication date: 2-Apr-2022
  • (2021)Of JavaScript AOT compilation performanceProceedings of the ACM on Programming Languages10.1145/34735755:ICFP(1-30)Online publication date: 19-Aug-2021

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media