On Training Robust PDF Malware Classifiers

Yizheng Chen, Shiqi Wang, Dongdong She, Suman Jana

TL;DR

This paper introduces the first verifiably robust PDF malware classifiers by training them to resist specific structural manipulations. By using a new "subtree distance" metric and formal verification techniques, the authors created models that not only guarantee security against bounded attackers but also significantly increase the effort required for even the most sophisticated, unrestricted adversaries to succeed.

What Problem Does This Paper Address?

In the world of machine learning for security, a 99% accuracy rate is often a mirage. While state-of-the-art PDF malware classifiers (like PDFrate or Hidost) boast near-perfect performance on static datasets, they are notoriously brittle. A simple adversary can evade detection by making trivial changes to a file—like adding invisible metadata or increasing the document's length—without altering its malicious payload.

The core challenge is that standard training focuses on average-case performance, while security requires worst-case robustness. Furthermore, measuring robustness is difficult; empirical "adversarial training" (training on known attacks) often fails against new, adaptive strategies. This paper tackles the need for classifiers that are "sound"—meaning they come with mathematical guarantees that no attacker within a certain bound can cause a misclassification.

Methods

The authors bridge the gap between formal verification and malware detection through three key innovations:

  1. Subtree Distance Metric: Traditional distance metrics (like $L_p$ norms) don't map well to the hierarchical structure of a PDF. The authors propose a metric that counts the number of different subtrees of depth one under the PDF root. This is crucial because a single operation—like inserting 100 benign pages—counts as just one "unit" of change in this metric, regardless of how many features it flips.
  2. Verifiable Robustness Properties: They define two classes of properties: Subtree Insertion (e.g., "no matter what benign content you add, this remains malicious") and Subtree Deletion (e.g., "deleting non-functional objects shouldn't hide the malware").
  3. Verifiably Robust Training: Instead of just training on raw data, they use Symbolic Interval Analysis (SIA). This technique propagates intervals of possible values through the neural network to find a "worst-case" bound. The model is then trained to minimize the loss for this worst-case scenario, ensuring the classification remains stable across the entire range of possible adversarial manipulations.

Datasets

The study utilizes the Contagio dataset, a well-known repository of malicious and benign PDFs.

  • Scale: Approximately 13,000 training PDFs and 6,000 testing PDFs.
  • Features: They use the Hidost feature extractor, which represents PDFs as "Bag-of-Paths" (structural paths in the PDF tree). This results in a binary feature vector with 3,514 dimensions.

Key Insights and Ideas

  • The "Building Block" Philosophy: You don't have to verify against every possible complex attack. By training a model to be robust against simple "building block" operations (like inserting or deleting a single subtree), you naturally raise the bar for complex, multi-step attacks.
  • Soundness over Empirical Testing: Unlike traditional adversarial training, which is a cat-and-mouse game, verifiable robustness provides a mathematical guarantee. If a sample is within the "robustness region," the attacker cannot win, regardless of their strategy.
  • Generalization to Unbounded Attackers: Perhaps the most surprising finding is that models trained to be robust against bounded attackers (those limited by the property) also perform significantly better against unbounded attackers. By eliminating "easy" evasions, the model forces the attacker into a much more difficult search space.

Key Results

The authors compared their robust models against 12 baselines and 7 different types of attackers (including whitebox, blackbox, and adaptive evolutionary attacks).

  • Verified Accuracy: They achieved a 92.27% average Verified Robust Accuracy (VRA) across three properties.
  • Utility Preservation: The robust models maintained 99.74% standard accuracy and a low false positive rate (0.56%), proving that you don't have to sacrifice performance for security.
  • Raising the Bar: Against unrestricted whitebox attacks, the robust model maintained a 7% higher accuracy than all baselines.
  • Increased Attack Cost: To evade the robust model, adaptive evolutionary attackers needed 10 times larger feature distances and 21 times more basic PDF mutations compared to baseline models.

Limitations and Future Work

  • False Positive Rate (FPR) Trade-off: While the FPR remained low, training for more complex or larger-distance properties (like inserting many subtrees) did lead to a slight increase in false positives.
  • Training Complexity: Training with insertion properties is computationally expensive, taking significantly longer than standard training due to the number of intervals that must be analyzed.
  • Property Scope: The current work focuses on depth-one subtrees. Future work could explore more complex, nested structural properties.
  • Beyond PDFs: While this paper focuses on the PDF format, the underlying framework of using structural distance metrics for verifiable training could potentially be applied to other complex file formats like Word documents or Android APKs.

Summary updated

BibTeX
@inproceedings{chen2020training,
  author = {Yizheng Chen and Shiqi Wang and Dongdong She and Suman Jana},
  title = {{On Training Robust PDF Malware Classifiers}},
  booktitle = {USENIX Security},
  year = {2020},
  url = {https://openreview.net/forum?id=pquOlFngGvC},
}
Figure