JavaScript (JS) engine vulnerabilities pose significant security threats affecting billions of web browsers due to its Turing-complete nature. While fuzz testing is a prevalent technique for finding such vulnerabilities, there have been few studies that leverage the recent advances in Neural Language Models (NLMs). The key technical challenge that hinders directly applying NLMs to a programming language lies in capturing the syntax and semantics of the code. To address the challenge, we transform a JS Abstract Syntax Tree (AST) into a sequence of AST subtrees that can directly train NLMs, and mutate a seed AST by leveraging the trained model. In this paper, we implement Montage, the first NLM guided fuzzer for finding JS engine vulnerabilities. We demonstrate that Montage is capable of generating valid JS tests, and show that it outperforms state-of-the-art JS fuzzers in terms of finding vulnerabilities. Montage found 37 real-world bugs including three CVEs from the latest JS engines as well.
JavaScript (JS) 엔진의 취약점은 JS 언어의 Turing-complete 속성 때문에 웹 브라우저 보안에 심각한 위협을 일으킬 수 있다. 퍼즈 테스팅은 이러한 취약점을 찾기 위해 많이 사용되지만, 최근 주목받는 신경 언어 모델을 퍼즈 테스팅에 활용한 연구는 비교적 적다. 이는 코드의 구문론적 특성과 의미론적 특성을 학습할 수 있도록 모델을 설계하는 것이 어렵기 때문이다. 이를 해결하기 위해 본 논문에서는 추상 구문 트리 (Abstract Syntax Tree, AST)를 서브트리의 시퀀스로 표현하여 신경 언어 모델을 학습시킨 후, 모델을 활용하여 시드 AST를 변형하는 방법을 제안한다. 실제로 이러한 방식으로 JS 엔진을 퍼즈 테스팅하는 도구인 Montage를 구현한 결과, Montage는 유효한 코드를 생성했고 최신의 퍼저보다 많은 취약점을 찾았다. 또한 Montage는 최신 버전의 JS 엔진에서 세 개의 CVE를 포함하여 총 37 개의 새로운 버그를 찾았다.