Universal Adversarial Perturbations for Malware

Raphael Labaca Castro, Luis Muñoz-González, Feargus Pendlebury, Gabi Dreo Rodosek, Fabio Pierazzi, Lorenzo Cavallaro

Introduction

Machine learning-based malware detectors have become a cornerstone of modern cybersecurity. However, recent research demonstrates that these systems are highly vulnerable to Universal Adversarial Perturbations (UAPs). Unlike traditional adversarial attacks that target a single sample, UAPs are "one-size-fits-all" modifications that can be applied to a wide variety of malware files to evade detection simultaneously. This research explores the realizability of such attacks in the "problem space"—modifying actual binaries while maintaining their malicious functionality—and proposes an effective adversarial training defense to mitigate these systemic vulnerabilities.

The Challenge of Problem-Space Malware Attacks

In the context of Malware-as-a-Service (MaaS), attackers prioritize efficiency. Crafting unique perturbations for every malware sample is computationally expensive. A universal perturbation offers a scalable solution: a single transformation that renders thousands of different malware samples invisible to antivirus engines.

The primary challenge lies in the "problem space" constraint. Unlike images, where pixel values can be changed arbitrarily, malware modifications must preserve the program's execution logic. This paper bridges the gap between abstract feature manipulation and real-world binary modification, ensuring that the resulting files remain functional and malicious.

Methodology

The authors utilize a two-pronged approach to evaluate and defend against UAPs:

  1. Greedy UAP Search: A greedy algorithm identifies sequences of problem-space transformations. For Android, this involves injecting "gadgets" (benign code snippets). For Windows, it includes byte-level changes such as appending imports, renaming sections, or using UPX packing. The goal is to maximize the Universal Evasion Rate (UER) across a malware corpus.
  2. Adversarial Training: To harden models, the authors incorporate UAP-modified examples into the training set. This forces the model to ignore the systemic "shortcuts" or noisy patterns that universal attacks exploit.

Datasets

The study evaluates these methods across three primary datasets:

  • DREBIN / DREBIN20: A large-scale Android malware dataset containing over 150,000 apps.
  • SLEIPNIR: A Windows PE dataset used for initial feature-space analysis.
  • EMBER: A modern Windows dataset with continuous features, representing a more complex and realistic target for adversarial attacks.

Experimental Evaluation

Evasion Success and Model Robustness

The experiments reveal that malware classifiers often rely on "low-hanging fruit" features, creating systemic vulnerabilities. For instance, if a model learns that the presence of a specific benign API strongly correlates with non-malicious intent, a UAP can simply inject that API into all malware samples to flip the model's decision globally.

Classification error vs L0 norm for UAP and sample-specific attacks on Android and Windows.

As shown in the figure above, linear models (Logistic Regression) are significantly more brittle than Deep Neural Networks (DNNs). In Android environments, white-box attacks achieved nearly a 100% UER with minimal modifications. Windows binaries proved more fragile; evasion rates on the EMBER dataset reached approximately 30% because many transformations that fool the model also risk corrupting the file format.

Transferability in Black-Box Scenarios

The research also explored the transferability of UAPs between different model architectures, which is crucial for black-box scenarios where the attacker lacks knowledge of the target model's internal parameters.

Transferability of UAPs between linear and DNN models on Android and Windows.

Even with limited knowledge, the authors achieved over 90% evasion on Android by transferring attacks from a source model to a target model, demonstrating that UAPs exploit fundamental weaknesses common across different architectures.

Defense Performance

Adversarial training proved highly effective at "patching" these vulnerabilities. For Android, it reduced the UER of a strong attack from nearly 100% to ~20%, with only a marginal 3% decrease in standard detection accuracy. For Windows, the UER was reduced to a negligible 1.5%.

Conclusion and Future Work

While UAPs pose a significant threat, especially to linear models, nonlinear models like DNNs are more robust and significantly more "patchable" through adversarial training. The goal of defense is not absolute invulnerability but to "shift the cost" back to the attacker, forcing them to invest more computational power into finding increasingly complex transformation chains.

Future work should address "unknown unknowns"—new types of transformations not seen during training—and the impact of concept drift as the underlying malware landscape evolves over time.

Summary updated

BibTeX
@misc{castro2021universal,
  author = {Raphael Labaca Castro and Luis Muñoz-González and Feargus Pendlebury and Gabi Dreo Rodosek and Fabio Pierazzi and Lorenzo Cavallaro},
  title = {{Universal Adversarial Perturbations for Malware}},
  year = {2021},
  eprint = {2102.06747},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2102.06747},
}
Figure