NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

On the Robustness of Malware Detectors to Adversarial Samples

Muhammad Salman, Benjamin Zi Hao Zhao, Hassan Jameel Asghar, Muhammad Ikram, Sidharth Kaushik, Mohamed Ali KaafararXiv 2024

TL;DR

Adversarial attacks on malware detectors are significantly less transferable than those in the image domain because different detectors rely on fundamentally different feature spaces. By combining deep learning, feature-based, and hash-based detectors into an ensemble, defenders can effectively mitigate these attacks and force adversaries to make detectable, large-scale changes to their code.

What Problem Does This Paper Address?

In the world of computer vision, "adversarial examples"—images tweaked with imperceptible noise—can easily fool AI models. Worse, an attack that fools one model often fools others, a property known as transferability.

Malware detection is also moving toward machine learning, but it faces a unique constraint: unlike an image, a program binary must remain functional after being perturbed. This paper investigates whether adversarial malware is as transferable as adversarial images. If an attacker crafts a binary to evade a specific deep-learning detector, will it also slip past traditional signature-based scanners or models using hand-engineered features?

Methods

The researchers evaluated the robustness of three distinct types of malware detectors:

  1. MalConv: A deep convolutional neural network (CNN) that processes raw bytes.
  2. EMBER-RF: A Random Forest model trained on hand-engineered features (like imported functions and section info) extracted via the LIEF library.
  3. ssdeep: A signature-based detector using Locality Sensitive Hashing (LSH), which identifies similarity by comparing file "chunks."

To generate adversarial samples, they used the Malware Makeover framework (see Figure 1). This pipeline applies functionality-preserving transformations such as In-place Randomization (IPR) (e.g., substituting equivalent instructions) and Displacement (Disp) (moving code to new sections and jumping to it). They employed white-box gradient-based attacks against MalConv and black-box search-based attacks against the others.

Figure 1: Pipeline for functionality preserving transformation of binaries using Malware Makeover.

Datasets

The study utilized the SOREL-20M dataset, a large-scale benchmark for malware detection. The authors randomly selected 3,362 malware binaries for their test set. Because SOREL does not distribute the original benign binaries (only their features), the authors queried the hashes of benign samples on VirusTotal and successfully downloaded 1,564 benign binaries for evaluation.

Key Insights and Ideas

  • Feature Diversity is a Defensive Shield: The primary reason for the lack of transferability is the "architectural" difference between detectors. An attack that carefully manipulates raw byte sequences to fool a CNN's filters often leaves the high-level structural features (used by EMBER-RF) or the local chunk hashes (used by ssdeep) untouched.
  • The High Cost of Evading LSH: Evading a similarity-based detector like ssdeep is much harder than fooling an ML model. To succeed, an attacker must modify almost every chunk of the file.
  • Obfuscation as a Signal: The authors discovered that making the massive changes required to evade multiple detectors creates a new "signature" of the transformation itself. They trained a separate LightGBM model that could detect these highly transformed binaries with near-perfect accuracy, suggesting that heavy obfuscation is its own red flag.
  • Ensembles Work: Using a "Majority Rule" ensemble (where at least two out of three detectors must agree a file is malicious) provides a robust defense that individual models lack.

Key Results

The experiments confirmed that while targeted attacks are devastating to their specific victims, they fail to generalize:

  • Targeted Success: An attack optimized for MalConv dropped its True Positive Rate (TPR) from ~80% to ~38% (see Table 3/Figure 6).
  • Poor Transferability: Those same MalConv-evading samples were still caught by ssdeep with a 97.07% TPR and by EMBER-RF with a 73.82% TPR.
  • Ensemble Robustness: A Majority Rule ensemble maintained a high TPR (~94%) on original samples and proved significantly harder to evade than any single model, as the non-targeted detectors acted as a safety net.
Table 3: Performance evaluation of malware detectors at Mal- Conv targeted transformed binaries.

Limitations and Future Work

The authors acknowledge that the transformation techniques used (IPR and Displacement) are not currently optimized to minimize the size of the perturbation; they are simply capped by a budget. This makes the adversarial changes easier to detect via secondary classifiers.

Future research directions include:

  • Developing adversarial algorithms that can holistically optimize transformations to defeat an entire ensemble simultaneously.
  • Exploring ways to minimize the "edit distance" (perturbation size) while still achieving evasion across multiple feature spaces.
  • Investigating how these findings hold up against dynamic analysis (behavior-based) detectors.

Summary updated

BibTeX
@misc{salman2024robustness,
  author = {Muhammad Salman and Benjamin Zi Hao Zhao and Hassan Jameel Asghar and Muhammad Ikram and Sidharth Kaushik and Mohamed Ali Kaafar},
  title = {{On the Robustness of Malware Detectors to Adversarial Samples}},
  year = {2024},
  eprint = {2408.02310},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2408.02310},
}
Figure