Functionality Preserving Adversarial Perturbations for Malware Evasion

28 concepts13 papers1 proposal

In computer vision, generating an adversarial example is relatively straightforward: you can subtly alter any pixel in an image because a slight shift in color space does not break the "functionality" of the image. However, as noted by Demontis et al. and Doan et al., malware detection operates under strict problem-space constraints. If you randomly flip a byte in an executable file, you will almost certainly corrupt its binary format, cause a system crash, or destroy the malicious payload entirely.

To successfully trick a machine learning classifier, an adversarial malware sample must simultaneously satisfy three properties highlighted by Ling et al.: format preservation, executability, and malicious logic integrity. The core challenge of this research direction is finding ways to alter a file's statistical profile so it looks benign to a model, without disrupting the underlying software logic.

The Principle of Asymmetric Mutation

How do you modify a program's signature without breaking its code? The foundational intuition relies on asymmetric mutation: rather than deleting or modifying existing malicious logic, attacks focus almost exclusively on inserting benign or neutral elements.

As Tan et al. observe, removing or altering essential operations risks compromising the program's original purpose. By strictly appending or embedding benign code patterns around the malicious payload, the original execution trace remains fully intact, while the overall feature distribution shifts toward legitimate software profiles.

Original Malware Binary:
[ Malicious Payload ] 

Adversarial Padding (Static):
[ Malicious Payload ] -> [ Non-Executed Benign Bytes ]

Adversarial Injection (Dynamic):
[ Malicious Step 1 ] -> [ No-Op / Benign API Call ] -> [ Malicious Step 2 ]

Exploiting Structural Ambiguities in File Formats

For static malware detectors—which analyze raw byte sequences or file headers without running the code—attackers exploit the structural rules of operating system file formats.

  • Overlay Padding: One of the simplest yet most effective techniques involves appending data to the very end of a file. Kolosnjaji et al. demonstrated that appending a small fraction of optimized bytes (less than 1% of the total file size) to the end of a binary can successfully evade deep learning architectures like MalConv. Because these bytes sit outside the executable sections defined by the file headers, they are ignored by the operating system during execution but are still processed by the neural network.
  • Slack Space and Header Ambiguities: To make attacks more sophisticated and compact, the GAMMA framework introduced by Demetrio et al. exploits ambiguities within the Windows Portable Executable (PE) format specification. By injecting benign content into "slack spaces" (unused gaps between sections) or manipulating header fields, they alter the file's feature representation without changing its execution trace. This bypasses the need for computationally expensive sandbox verification during the adversarial optimization process.
  • Dummy Code Insertion: Similarly, the AMAO method proposed by Park et al. minimally modifies binaries with "dummy code" insertions. These dead-code blocks are syntactically valid but logically isolated, ensuring high evasion rates against static classifiers while preserving core executability.

Behavioral Camouflage via No-Op Injections

When malware detectors shift from static analysis to dynamic analysis—monitoring the sequence of API calls a program makes during execution—the strategy evolves from padding bytes to injecting behavior.

To evade sequence-based classifiers, the GADGET framework developed by Rosenberg et al. generates adversarial sequences by interleaving benign-seeming API calls into the original malicious sequence. To guarantee that these additions do not break the malware, Rosenberg et al. later refined this approach to use explicit "no-op" API calls. These are system calls that execute successfully but have no side effects on the program's core state or its ability to achieve its malicious objectives (e.g., requesting a registry key that is ignored, or checking a system time metric).

A parallel strategy exists in mobile ecosystems. For Android malware, He et al. designed the AdvDroidZero framework, which introduces benign components into the application package. Crucially, these components are isolated from the core malicious logic using system-level mechanisms like independent subprocesses or intent filters. The operating system sees a complex app with many benign behaviors, diluting the malicious feature profile while the payload runs unhindered.

Why It Works: The Semantic Blind Spots of ML

The fundamental reason these attacks succeed is a mismatch between how machine learning models "see" code and how operating systems "execute" code.

Most machine learning malware detectors rely on global statistical aggregations: byte frequency histograms, string counts, or flat sequences of API calls. They lack a true semantic understanding of control flow graphs. They cannot easily distinguish between a byte that will be executed and a byte placed in an unreachable overlay section.

By minimizing the perturbation rate—a constraint explicitly optimized by frameworks like MiniMal from Li et al. or generative models like MalFox from Zhong et al.—attackers find the exact mathematical threshold needed to flip a classifier's decision boundary. As noted by defenders like Kozák et al., these subtle modifications exploit the model's hyper-sensitivity to specific input features, allowing the underlying malicious logic to slip through completely undetected.

Key Foundational Work

Generic Black-Box End-to-End Attack Against State of the Art API Call Based Malware Classifiers (2018) — contributed 5 concept elements to this direction.
Generation & Evaluation of Adversarial Examples for Malware Obfuscation (2019) — contributed 2 concept elements to this direction.
Adversarial Malware Binaries: Evading Deep Learning for Malware Detection in Executables (2018) — contributed 1 concept elements to this direction.
History & citationVersion 1 · 2026-10-04

Current · Permanent link

View frozen version 1

Cite this direction

Latest version (a living page):

@misc{lacuna_functionality_preserving_evasion_7e7ec67b,
  title = {functionality-preserving evasion},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/functionality-preserving-evasion/rdr_7e7ec67b04194b0285c5cf84d757b5ea},
  note = {Latest version of a living research direction; cite a version for a fixed text. Accessed 2026-11-19},
}

This exact version (version 1, frozen text):

@misc{lacuna_functionality_preserving_evasion_7e7ec67b_v1,
  title = {functionality-preserving evasion},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/functionality-preserving-evasion/rdr_7e7ec67b04194b0285c5cf84d757b5ea/v/1},
  note = {Version 1, frozen 2026-10-04. Accessed 2026-11-19},
}
About

These directions overlap with this one through shared papers.

See something wrong? Report a mistake