Obfuscated Clone Search in JavaScript based on Reinforcement Subsequence Learning
Open Access
- 2 July 2025
- journal article
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Software Engineering and Methodology
- Vol. 34 (6) , 1-28
Abstract
Finding similar code is important for software engineering, defense of intellectual property, and security, and one of the increasingly common ways adversaries use to defeat the detection of similar code is through obfuscations such as code transformation and scattering the code they wish to hide among long sequences. Moving code far enough apart poses a specific challenge for solutions with localized features (e.g., n-grams), or attention mechanisms as the code parts are distributed beyond the local context window. We introduce a neural network solution pattern called “Cybertron” that addresses this problem by utilizing reinforcement learning to train a code abstraction and summarization function; this converts arbitrarily long code into fixed-length real vectors in a way that is optimized for similarity search. The key to the design is the smart selection of important elements of the code and abstraction to preserve semantic function while minimizing syntactic feature information. We evaluated the approach on a three-challenge benchmark of obfuscated JavaScript, a scripting language that is commonly obfuscated and for which code-mixing is a rising challenge. The evaluation shows our approach identifies obfuscated code within even large scripts with an AUC of 78%, which outperforms current state-of-the-art sequence models by 7–35%.Keywords
This publication has 25 references indexed in Scilit:
- On improvements of robustness of obfuscated JavaScript code detectionJournal of Computer Virology and Hacking Techniques, 2022
- A machine learning approach to detection of JavaScript-based attacks using AST features and paragraph vectorsApplied Soft Computing, 2019
- Asm2Vec: Boosting Static Representation Robustness for Binary Clone Search against Code Obfuscation and Compiler Optimization2019
- A detection framework for semantic code clones and obfuscated codeExpert Systems with Applications, 2018
- Stochastic Optimization of Program Obfuscation2017
- Evaluating clone detection tools with BigCloneBench2015
- Rényi Divergence and Kullback-Leibler DivergenceIEEE Transactions on Information Theory, 2014
- A New Code Obfuscation Scheme for Software Protection2014
- Learning long-term dependencies with gradient descent is difficultIEEE Transactions on Neural Networks, 1994
- Nonlinear principal component analysis using autoassociative neural networksAIChE Journal, 1991