arXiv:2610.26488cs.CROct 2026

Manuscript Offprint

arXiv:2610.26488

Mal-AAEGAN: Adversarial Autoencoder with Double-Critic WGAN-GP for Malware Generation

Nam Hoang Thanh, Trung Pham Duy, Lam Bui Thu

Nam Hoang Thanh, Trung Pham Duy, and Lam Bui Thu ∗^{*}

Academy of Cryptography Techniques, Ha Noi, Viet Nam {hoangthanhnam, trungpd, lambt}@actvn.edu.vn

Abstract. Machine-learning (ML) malware detectors are known to be vulnerable to adversarial samples. Generative adversarial networks (GANs) such as MalGAN, Mal-LSGAN, and our previous Mal-D2GAN can craft adversarial malware to probe and harden these detectors, yet they operate directly on a high-dimensional, discrete binary feature space, which leads to unstable training, vanishing gradients, and adversarial samples of limited diversity. To address these problems we propose Mal-AAEGAN. First, an adversarial autoencoder (AAE) learns a low-dimensional, regularized and continuous latent representation of the M-dimensional binary API feature vector, and the generator performs an additive perturbation in this latent space rather than in the raw binary space. Second, training follows the Wasserstein GAN with gradient penalty (WGAN-GP) scheme using two critics: a mimic-black-box critic that inherits the role of the substitute detector and a naive critic that inherits the role of the additional detector. A decode-binarize-OR pipeline guarantees that the original API calls of the malware are preserved. The model is evaluated on two malware datasets of different input dimensionality ( M∈{139,215}M \in \{139, 215\}) against eight common ML detectors and compared, under an identical protocol, with MalGAN, Mal-LSGAN and Mal-D2GAN. Mal-AAEGAN trains stably in the continuous latent space and attains an evasion rate on par with or higher than these binary-space baselines across both datasets, while its generator stays responsive to the noise input rather than reducing to a single fixed perturbation per malware.

Keywords: malware detection · adversarial malware samples · generative adversarial network · adversarial autoencoder · Wasserstein GAN · gradient penalty

1 Introduction

Malware refers to programs intentionally designed to harm computers, servers, or networks. Detecting malware is a critical step in the incident-response process of any organization. Detection approaches fall into two families: signature-based detection, which compares files against a database of known byte patterns, and

∗^{*} Corresponding author.

N. Hoang Thanh et al.

behavior-based detection, which analyses program actions using heuristic rules or machine-learning algorithms and can flag previously unseen samples [1, 2].

Machine learning learns from program behavior instead of relying only on known signatures [3], enabling the detection of new malware variants. However, ML-based detectors are themselves susceptible to adversarial samples [4]. Samples produced by generative adversarial networks (GANs) [5] have driven numerous attacks against such detectors, as surveyed in [26]. Hu et al. introduced MalGAN, which trains a generator against a substitute detector so that the resulting samples bypass a black-box detector [6]. Mal-LSGAN and LSGAN-AT later improved evasion through least-square losses and new activation functions [7, 8], while our earlier Mal-D2GAN [25] added a second detector to strengthen the adversarial signal.

These models share a structural limitation: the generator operates on the raw M-dimensional binary feature vector. Because this space is discrete and high-dimensional, the gradient passed back to the generator is weak, training is unstable, and samples lack diversity. In this paper we revisit the Mal-D2GAN design and rebuild its generator and loss around a continuous latent space. The contributions of this work are:

  1. The Mal-AAEGAN model. We propose Mal-AAEGAN, which couples an adversarial autoencoder that maps the M-dimensional binary API features into a compact, continuous and prior-regularized latent space with a double-critic WGAN-GP trained inside that space. A single generator applies an additive perturbation to the malware latent code and is optimized by the negative average of two Wasserstein critic scores, a mimic-black-box critic and a naive critic, each regularized by a gradient penalty. This objective provides smooth gradients and stable training while retaining the double-detector signal of Mal-D2GAN.

  2. Noise-responsive latent perturbations. Combining the regularized latent space with the WGAN-GP objective provides smooth gradients and stable training in the malware domain. We introduce dedicated diversity metrics, unique ratio, mean Hamming distance, latent-dispersion ratio, and noise sensitivity, and evaluate the model on two datasets against eight detectors. Mal-AAEGAN attains evasion on par with the binary-space baselines at a comparable perturbation cost, and its generator remains responsive to its noise input where the baselines effectively ignore it.

The remainder of the paper is organized as follows. Section 2 reviews related work. Section 3 presents the proposed Mal-AAEGAN. Section 4 reports the experiments and results, and Section 5 concludes the paper.

References (24)