Adversarial Detection of Flash Malware: Limitations and Open Issues

Davide Maiorca, Battista Biggio, Maria Elena Chiappe, Giorgio GiacintoComput. Secur 2017 · DOI

Abstract

During the past four years, Flash malware has become one of the most insidious threats to detect, with almost 600 critical vulnerabilities targeting Adobe Flash disclosed in the wild. Research has shown that machine learning can be successfully used to detect Flash malware by leveraging static analysis to extract information from the structure of the file or its bytecode. However, the robustness of Flash malware detectors against well-crafted evasion attempts—also known as adversarial examples—has never been investigated. In this paper, we propose a security evaluation of a novel, representative Flash detector that embeds a combination of the prominent, static features employed by state-of-the-art tools. In particular, we discuss how to craft adversarial Flash malware examples, showing that it suffices to manipulate the corresponding source malware samples slightly to evade detection. We then empirically demonstrate that popular defense techniques proposed to mitigate evasion attempts, including re-training on adversarial examples, may not always be sufficient to ensure robustness. We argue that this occurs when the feature vectors extracted from adversarial examples become indistinguishable from those of benign data, meaning that the given feature representation is intrinsically vulnerable. In this respect, we are the first to formally define and quantitatively characterize this vulnerability, highlighting when an attack can be countered by solely improving the security of the learning algorithm, or when it requires also considering additional features. We conclude the paper by suggesting alternative research directions to improve the security of learning-based Flash malware detectors.

Introduction

Machine learning (ML) has become a cornerstone of modern malware detection, particularly for complex, multi-component file formats like Adobe Flash (SWF). Despite Adobe Flash reaching its end-of-life in 2020, it remains a critical "test-bench" for understanding structural malware (such as PDFs and Office documents) because it uniquely combines external file structures with internal scripting code (ActionScript).

While ML models often achieve high accuracy in benign environments, they are frequently "brittle" when faced with a determined adversary. Attackers can generate adversarial examples—malicious files specifically modified to bypass a classifier while maintaining their harmful functionality. This study addresses a significant gap in the literature by evaluating the robustness of Flash malware detectors against these sophisticated evasion attempts.

System Architecture: FlashBuster

To conduct this evaluation, we developed FlashBuster, a state-of-the-art static analysis tool designed to represent the current capabilities of ML-based Flash detection. FlashBuster extracts two primary categories of features to characterize SWF files:

  1. Structural Features: These involve counting the occurrences of specific SWF "tags," such as DefineBinaryData or ShowFrame, which define the file's layout and assets.
  2. Bytecode Features: These involve counting calls to specific System APIs (e.g., flash.utils.ByteArray) within the ActionScript code, capturing the file's functional behavior.
The FlashBuster detection pipeline, illustrating the extraction of structural and bytecode features from SWF files.

The extracted features are compiled into a high-dimensional feature vector $[x_1, ... x_n]$, which is then processed by a classifier to determine if the file is benign or malicious.

Adversarial Attack Methodology

We employed a gradient-descent-based evasion attack to test the system's limits. A primary challenge in malware evasion is the "inverse feature mapping" problem: ensuring that modifications made to a feature vector can be translated back into a functional, malicious file.

To solve this, we utilized an automated injection technique involving "dead code." By inserting instructions after a return statement, we ensure the code is never executed by the virtual machine (preserving the malware's original malicious intent) while still being counted by the static analyzer. This allows an attacker to manipulate the feature vector to mimic benign samples without breaking the file's logic.

Characterizing Vulnerabilities: Learning vs. Features

A key contribution of this work is the formal distinction between two types of system vulnerabilities:

  • Learning Vulnerability: These are "blind spots" in the model resulting from insufficient or non-representative training data. These vulnerabilities can typically be mitigated through adversarial training (retraining the model on attack samples).
  • Feature Vulnerability: This occurs when an attacker can perform a "mimicry" attack, modifying a malicious file's features until they are identical to those of a benign file. In such cases, the feature representation itself is flawed; no amount of retraining or algorithmic complexity can distinguish between the two classes because they occupy the same space in the feature set.

Experimental Results

Our study utilized a balanced dataset of 5,828 files, including 1,593 malicious samples from major exploit kits (e.g., Neutrino, Angler) and 4,235 benign samples. We employed a temporal split, training on data prior to 2017 and testing on samples from 2017–2018 to simulate real-world predictive challenges.

  • Baseline Performance: FlashBuster initially performed exceptionally well, achieving a detection rate of over 90% at a 1% False Positive Rate (FPR), outperforming existing tools like Hidost.
  • Evasion Success: Without adversarial defenses, gradient-descent attacks reduced the detection rate of all tested classifiers (SVMs and Random Forests) to near 0% with fewer than 100 feature modifications.
  • The Limits of Retraining: While adversarial training improved robustness for certain models, it was not a "silver bullet." In high-dimensional spaces, attackers have enough degrees of freedom to find paths to mimicry. Using the Bhattacharyya Coefficient to measure distribution overlap, we mathematically confirmed that adversarial attacks successfully pushed the malicious distribution to overlap with the benign one.

Discussion and Future Directions

The results demonstrate that the security of a detector depends more on the robustness of its features than the complexity of its learning algorithm. Relying solely on file structure is dangerous, as attackers can easily pad files with benign structural tags.

To improve the security of learning-based detectors, we suggest several research directions:

  1. Context-Aware Features: Moving beyond simple counts of API calls to analyze the sequence and context of those calls.
  2. Dynamic Analysis: Integrating static features with behavioral data from a sandbox environment to significantly raise the cost of evasion for attackers.
  3. Cross-Format Application: Applying these lessons to other structural formats like PDF and Android APKs, which likely share similar mimicry vulnerabilities.

Summary updated

BibTeX
@article{maiorca2017adversarial,
  author = {Davide Maiorca and Battista Biggio and Maria Elena Chiappe and Giorgio Giacinto},
  title = {{Adversarial Detection of Flash Malware: Limitations and Open Issues}},
  journal = {Comput. Secur.},
  year = {2017},
  doi = {10.1016/j.cose.2020.101901},
}
Figure