Anything to Hide? Studying Minified and Obfuscated Code in the Web

By Philippe Skolka, C. Staicu, Michael Pradel. 2019

57 citations recorded by the source corpus.

JavaScript has been used for various attacks on client-side web applications. To hinder both manual and automated analysis from detecting malicious scripts, code minification and code obfuscation may hide the behavior of a script. Unfortunately, little is currently known about how real-world websites use such code transformations. This paper presents an empirical study of obfuscation and minification in 967,149 scripts (424,023 unique) from the top 100,000 websites. The core of our study is a highly accurate (95%-100%) neural network-based classifier that we train to identify whether obfuscation or minification have been applied and if yes, using what tools. We find that code transformations are very widespread, affecting 38% of all scripts. Most of the transformed code has been minified, whereas advanced obfuscation techniques, such as encoding parts of the code or fetching all strings from a global array, affect less than 1% of all scripts (2,842 unique scripts in total). Studying which code gets obfuscated, we find that obfuscation is particularly common in certain website categories, e.g., adult content. Further analysis of the obfuscated code shows that most of it is similar to the output produced by a single obfuscation tool and that some obfuscated scripts trigger suspicious behavior, such as likely fingerprinting and timing attacks. Finally, we show that obfuscation comes at a cost, because it slows down execution and risks to produce code that changes the intended behavior. Overall, our study shows that the security community must consider minified and obfuscated JavaScript code, and it provides insights into what kinds of transformations to focus on. Our learned classifiers provide an automated and accurate way to identify obfuscated code, and we release a set of real-world obfuscated scripts for future research.

Subfields: Information Systems, Program Analysis & Verification, Privacy & Security, Signal Processing

How researchers see this paper

The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.

In Information Systems

  1. Georgios Gousios
  2. Satish Chandra
  3. Jason Liu
  4. Michael Pradel
  5. Jeffrey S. Foster
  6. Milod Kazerounian
  7. Charles Sutton
  8. Prem Devanbu

In Program Analysis & Verification

  1. Georgios Gousios
  2. Satish Chandra
  3. Jason Liu
  4. Michael Pradel
  5. Milod Kazerounian
  6. Jeffrey S. Foster
  7. Prem Devanbu
  8. Kevin Jesse

In Privacy & Security

  1. Michael Pradel

In Signal Processing

  1. Georgios Gousios
  2. Satish Chandra
  3. Jason Liu
  4. Michael Pradel

Citations in the corpus