Certified Adversarial Robustness of End-to-End Malware Detectors via (De)Randomized Smoothing

Daniel Gibert, Luca Demetrio, Giulio Zizzo, Quan Le, Jordi Planes, Battista Biggio

This paper, titled "Certified Adversarial Robustness of Machine Learning-based Malware Detectors via (De)Randomized Smoothing," introduces a new way to build malware detectors that aren't just accurate, but provably robust against sophisticated evasion attacks.

TL;DR

The authors propose a "chunk-based smoothing" defense that splits executable files into independent blocks and uses majority voting for classification. This method provides the first deterministic robustness certificates for end-to-end malware detectors, effectively neutralizing common "patch" and "content insertion" attacks that typically fool deep learning models.

What Problem Does This Paper Address?

Deep learning models are surprisingly good at spotting malware by "reading" the raw bytes of a file. However, they have a major weakness: adversarial examples. Attackers can subtly modify a malicious file—for instance, by injecting benign-looking code into "slack space" or adding new sections—to make the detector think it's harmless.

Existing defenses like "adversarial training" (training on known attacks) often fail against new, unseen attack methods. Another popular defense, randomized smoothing, adds random noise to inputs to blur decision boundaries. While effective in computer vision, it struggles with malware because:

  1. Functionality Constraints: You can't just flip random bits in an executable; you'll likely break the program.
  2. Probabilistic Nature: Most smoothing methods only provide a statistical likelihood of robustness, not a guarantee.
  3. Large Edit Distances: Malware attacks often involve thousands of bytes, far exceeding what standard smoothing can certify.

Methods

The authors introduce Chunk-based (De)Randomized Smoothing (CS). The core idea is to move away from byte-level noise and focus on structural "chunks."

  • Training: Instead of training a model on the whole file, they train a "base classifier" on single, randomly selected contiguous chunks of bytes (size $z$).
  • Inference: At test time, the system splits an executable into non-overlapping chunks. The base classifier predicts "benign" or "malicious" for every single chunk. The final verdict is decided by a majority vote.
  • Deterministic Certification: Because the number of chunks an attacker can influence is mathematically bounded by the size of their "patch," the authors can calculate a margin. If the majority vote for the correct class exceeds the runner-up by a specific amount, they can guarantee that no attack of a certain size can ever flip the result.
  • The Alignment Trick (Preprocessing): A major challenge in malware is that inserting bytes shifts everything after it, potentially changing every chunk. The authors solve this with a PREPROCESS step that strategically pads headers and sections so they always align with chunk boundaries. This ensures that an injected payload only affects a predictable, limited number of chunks.
Overview of the chunk-based smoothing classification scheme

Datasets

The study uses the BODMAS dataset, a large-scale collection of 57,293 malware samples (covering 581 families) and 77,142 benign Windows PE files. To keep computational costs manageable for genetic algorithm-based attacks, the authors focused on files smaller than 1MB, resulting in a balanced set of roughly 77,000 total files.

Key Insights and Ideas

  • From Probabilistic to Deterministic: By classifying every chunk, the method avoids the sampling error inherent in randomized smoothing. It doesn't say "this is probably robust"; it says "this is definitely robust against any attack up to $X$ bytes."
  • Structural Awareness: The preprocessing step (shown below) is a clever "bridge" between the rigid structure of Windows executables and the mathematical requirements of smoothing. It turns a complex "insertion" problem into a simpler "patch" problem.
  • Interpretability: Because the model votes on chunks, you can visualize which parts of a file are "malicious." This creates a heatmap that can help security analysts identify exactly where the malicious payload is hidden.
Illustration of the PREPROCESS operation for alignment

Key Results

The authors tested their defense against several state-of-the-art (SOTA) attacks, including GAMMA, Shift, and Code Caves.

  • Superior Robustness: Against a 10,000-byte "Padding+Slack" attack, the standard MalConv detector's accuracy dropped to 85%. The proposed CS-MalConv maintained a 95.40% certified accuracy.
  • Minimal Performance Hit: The "clean accuracy" (performance on non-attacked files) only dropped by about 2% compared to undefended models, a very acceptable trade-off for the security gains.
  • Efficiency: While slower than a single-pass model, it is significantly faster than many randomized smoothing implementations that require hundreds of noisy passes per file.
Performance metrics of non-smoothed and smoothed models

Limitations and Future Work

  • Payload Size Limits: The defense is a numbers game. If an attacker can inject a payload that is larger than the original file (e.g., >100% of the original size), they can eventually control enough chunks to flip the majority vote.
  • Inference Speed: Classifying every chunk independently adds overhead, which might be a concern for high-throughput gateway scanners.
  • Future Directions: The authors suggest exploring more advanced computer vision-inspired defenses and developing automated tools to strip out the adversarial content once it has been localized by the chunk-based voting system.

Summary updated

BibTeX
@article{gibert2026certified,
  author = {Daniel Gibert and Luca Demetrio and Giulio Zizzo and Quan Le and Jordi Planes and Battista Biggio},
  title = {{Certified Adversarial Robustness of End-to-End Malware Detectors via (De)Randomized Smoothing}},
  journal = {ACM Trans. Priv. Secur.},
  year = {2026},
  doi = {10.1145/3827613},
}
Figure