Skip to main content
QUICK REVIEW

[Paper Review] MERLIN -- Malware Evasion with Reinforcement LearnINg

Tony Quertier, Benjamin Marais|arXiv (Cornell University)|Mar 24, 2022
Advanced Malware Detection TechniquesComputer Science8 citations
TL;DR

This paper proposes MERLIN, a reinforcement learning-based framework using DQN and REINFORCE to evade ML-based malware detectors (MalConv, EMBER) and commercial AVs by semantically preserving modifications to Windows PE files. REINFORCE achieves high evasion rates—over 75% on state-of-the-art models and significant success on commercial AVs—while generating detailed vulnerability reports to aid defense hardening.

ABSTRACT

In addition to signature-based and heuristics-based detection techniques, machine learning (ML) is widely used to generalize to new, never-before-seen malicious software (malware). However, it has been demonstrated that ML models can be fooled by tricking the classifier into returning the incorrect label. These studies, for instance, usually rely on a prediction score that is fragile to gradient-based attacks. In the context of a more realistic situation where an attacker has very little information about the outputs of a malware detection engine, modest evasion rates are achieved. In this paper, we propose a method using reinforcement learning with DQN and REINFORCE algorithms to challenge two state-of-the-art ML-based detection engines (MalConv \& EMBER) and a commercial AV classified by Gartner as a leader AV. Our method combines several actions, modifying a Windows portable execution (PE) file without breaking its functionalities. Our method also identifies which actions perform better and compiles a detailed vulnerability report to help mitigate the evasion. We demonstrate that REINFORCE achieves very good evasion rates even on a commercial AV with limited available information.

Motivation & Objective

  • To develop an automated, black-box method for evading modern ML-based and commercial antivirus malware detection systems with minimal prior knowledge.
  • To identify and analyze effective, functionality-preserving modifications to PE files that bypass detection while maintaining malicious behavior.
  • To generate actionable vulnerability reports that explain evasion success and support detection engine hardening.
  • To evaluate the effectiveness of different reinforcement learning algorithms (DQN vs. REINFORCE) in low-information, black-box evasion scenarios.
  • To provide insights into the structural weaknesses of detection engines through systematic adversarial testing and explainable evasion patterns.

Proposed method

  • Employs a reinforcement learning framework with a custom environment simulating a black-box malware detection API that returns only benign/malicious labels.
  • Uses DQN and REINFORCE algorithms to learn optimal sequences of binary modification actions on PE files without requiring model gradients or internal scores.
  • Applies semantic-preserving actions such as modifying the machine type, adding benign libraries, changing timestamps, and inserting strings from benign files.
  • Maintains functional equivalence by validating that modified binaries retain original malicious behavior post-modification.
  • Generates a detailed vulnerability report tracking all actions taken, their impact, and their contribution to evasion success.
  • Visualizes the evolution of the attack process and action effectiveness to support interpretability and defense analysis.

Experimental results

Research questions

  • RQ1Can reinforcement learning effectively generate adversarial PE files that evade state-of-the-art ML-based malware detectors (MalConv, EMBER) and commercial AVs in a black-box setting?
  • RQ2How do DQN and REINFORCE compare in terms of evasion success rate and robustness when only hard labels (benign/malicious) are available?
  • RQ3Which specific binary modification actions are most effective in achieving evasion, and how do they contribute to bypassing detection?
  • RQ4Can the generated vulnerability reports provide actionable insights for improving detection engine resilience?
  • RQ5To what extent does the sequence of actions matter in evasion, and how does REINFORCE’s ability to model sequences outperform DQN’s focus on individual actions?

Key findings

  • REINFORCE achieves over 75% evasion rates on MalConv and EMBER, demonstrating strong performance even in low-information black-box settings.
  • On commercial AVs, REINFORCE achieves significant evasion success despite limited information, outperforming DQN and even surpassing random search in some cases.
  • DQN underperforms on commercial AVs due to its inability to model action sequences effectively, relying only on the final action’s outcome.
  • The action 'modify machine type' is frequently used in successful evasion sequences, suggesting it may be a critical vulnerability in detection engines.
  • The vulnerability report provides detailed, interpretable insights into which modifications led to evasion, enabling targeted defense improvements.
  • The framework successfully generates functional, undetected malware variants, which could be used to retrain detection models for improved robustness.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.