skip to main content
10.1145/3460120.3484823acmconferencesArticle/Chapter ViewAbstractPublication PagesccsConference Proceedingsconference-collections
research-article
Open access

SoFi: Reflection-Augmented Fuzzing for JavaScript Engines

Published: 13 November 2021 Publication History

Abstract

JavaScript engines have been shown prone to security vulnerabilities, which can lead to serious consequences due to their popularity. Fuzzing is an effective testing technique to discover vulnerabilities. The main challenge of fuzzing JavaScript engines is to generate syntactically and semantically valid inputs such that deep functionalities can be explored. However, due to the dynamic nature of JavaScript and the special features of different engines, it is quite challenging to generate semantically meaningful test inputs.
We observed that state-of-the-art semantic-aware JavaScript fuzzers usually require manually written rules to analyze the semantics for a JavaScript engine, which is labor-intensive, incomplete and engine-specific. Moreover, the error rate of generated test cases is still high. Another challenge is that existing fuzzers cannot generate new method calls that are not included in the initial seed corpus or pre-defined rules, which limits the bug-finding capability.
To this end, we propose a novel semantic-aware fuzzing technique named SoFi. To guarantee the validity of the generated test cases, SoFi adopts a fine-grained program analysis to identify available variables and infer types of these variables for the mutation. Moreover, an automatic repair strategy is proposed to repair syntax/semantic errors in invalid test cases. To improve the exploration capability of SoFi, we propose a reflection-based analysis to identify unseen attributes and methods of objects, which are further used in the mutation. With fine-grained analysis and reflection-based augmentation, SoFi can generate more valid and diverse test cases. Besides, SoFi is general in different JavaScript engines without any manual configuration (e.g., the grammar rules). The evaluation results have shown that SoFi outperforms state-of-the-art techniques in generating semantically valid inputs, improving code coverage and detecting more bugs. SoFi discovered 51 bugs in popular JavaScript engines, 28 of which have been confirmed or fixed by the developers and 10 CVE IDs have been assigned.

References

[1]
american fuzzy lop. https://lcamtuf.coredump.cx/afl/.
[2]
benjamn/ast-types: Esprima-compatible implementation of the mozilla js parser api. https://github.com/benjamn/ast-types.
[3]
cesanta/mjs: Embedded javascript engine for c/c
[4]
. https://github.com/cesanta/mjs.
[5]
Esprima. https://esprima.org/.
[6]
Espruino up to 1.97 jswrap_graphics.c memory corruption. https://vuldb.com/?id.118465.
[7]
estools/escodegen: Ecmascript code generator. https://github.com/estools/escodegen.
[8]
funfuzz/src/funfuzz/js/jsfunfuzz at master · mozillasecurity/funfuzz. https://github.com/MozillaSecurity/funfuzz/tree/master/src/funfuzz/js/jsfunfuzz.
[9]
googleprojectzero/domato: Dom fuzzer. https://github.com/googleprojectzero/domato.
[10]
Javascript - wikipedia. https://en.wikipedia.org/wiki/JavaScript#Dynamic.
[11]
Javascriptcore | apple developer documentation. https://developer.apple.com/documentation/javascriptcore.
[12]
Jerryscript 1.0 lit/lit-char-helpers.c lit_read_code_unit_from_hex memory corruption. https://vuldb.com/?id.113964.
[13]
jerryscript-project/jerryscript: Ultra-lightweight javascript engine for the internet of things. https://github.com/jerryscript-project/jerryscript.
[14]
Mujs. https://mujs.com/.
[15]
Nvd - cve-2019--1010176. https://nvd.nist.gov/vuln/detail/CVE-2019--1010176.
[16]
Openrce/sulley: A pure-python fully automated and unattended fuzzing framework. https://github.com/OpenRCE/sulley.
[17]
Peach fuzzer: Discover unknown vulnerabilities. https://www.peach.tech/.
[18]
Reflect - javascript | mdn. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Reflect.
[19]
tc39/test262: Official ecmascript conformance test suite. https://github.com/tc39/test262.
[20]
Xs7 @ tc-39. https://www.moddable.com/XS7-TC-39.php.
[21]
Cornelius Aschermann, Tommaso Frassetto, Thorsten Holz, Patrick Jauernig, Ahmad-Reza Sadeghi, and Daniel Teuchert. Nautilus: Fishing for deep bugs with grammars. In NDSS, 2019.
[22]
Vijay Ganesh, Tim Leek, and Martin Rinard. Taint-based directed whitebox fuzzing. In 2009 IEEE 31st International Conference on Software Engineering, pages 474--484. IEEE, 2009.
[23]
HyungSeok Han, DongHyeon Oh, and Sang Kil Cha. Codealchemist: Semantics-aware code generation to find vulnerabilities in javascript engines. In NDSS, 2019.
[24]
Christian Holler, Kim Herzig, and Andreas Zeller. Fuzzcodealchemisting with code fragments. In Presented as part of the 21st $$USENIX$$ Security Symposium ($$USENIX$$ Security 12), pages 445--458, 2012.
[25]
Xiangkun Jia, Chao Zhang, Purui Su, Yi Yang, Huafeng Huang, and Dengguo Feng. Towards efficient heap overflow discovery. In 26th $$USENIX$$ Security Symposium ($$USENIX$$ Security 17), pages 989--1006, 2017.
[26]
Daniel Jurafsky and James H Martin. Speech and language processing (draft). october 2019. URL https://web. stanford. edu/ jurafsky/slp3, 2019.
[27]
Sanjay Rawat, Vivek Jain, Ashish Kumar, Lucian Cojocar, Cristiano Giuffrida, and Herbert Bos. Vuzzer: Application-aware evolutionary fuzzing. In NDSS, volume 17, pages 1--14, 2017.
[28]
Kwangwon Sun and Sukyoung Ryu. Analysis of javascript programs: Challenges and research trends. ACM Computing Surveys (CSUR), 50(4):1--34, 2017.
[29]
Spandan Veggalam, Sanjay Rawat, Istvan Haller, and Herbert Bos. Ifuzzer: An evolutionary interpreter fuzzer using genetic programming. In European Symposium on Research in Computer Security, pages 581--601. Springer, 2016.
[30]
Junjie Wang, Bihuan Chen, Lei Wei, and Yang Liu. Superion: Grammar-aware greybox fuzzing. In 2019 IEEE/ACM 41st International Conference on Software Engineering (ICSE), pages 724--735. IEEE, 2019.

Cited By

View all

Index Terms

  1. SoFi: Reflection-Augmented Fuzzing for JavaScript Engines

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Conferences
    CCS '21: Proceedings of the 2021 ACM SIGSAC Conference on Computer and Communications Security
    November 2021
    3558 pages
    ISBN:9781450384544
    DOI:10.1145/3460120
    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: 13 November 2021

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. fuzzing
    2. vulnerability

    Qualifiers

    • Research-article

    Funding Sources

    Conference

    CCS '21
    Sponsor:
    CCS '21: 2021 ACM SIGSAC Conference on Computer and Communications Security
    November 15 - 19, 2021
    Virtual Event, Republic of Korea

    Acceptance Rates

    Overall Acceptance Rate 1,261 of 6,999 submissions, 18%

    Upcoming Conference

    CCS '25

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)747
    • Downloads (Last 6 weeks)84
    Reflects downloads up to 25 Dec 2024

    Other Metrics

    Citations

    Cited By

    View all

    View Options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Login options

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media