Manuscript Offprint

arXiv:2611.00713

Adversarial Robustness Is Not Zero-Day Generalization: A Controlled Evaluation of Flow-Based Intrusion Detectors on Corrected CIC-IDS2017

Abdulhamid Zaro

Abdulhamid Zaro

College of Professions and Applied Sciences

Hebron University

Hebron, Palestine

abdulhamidz@hebron.edu

ORCID: 0009-0003-6241-302X

Abstract—Synthetic variants of known attacks, including feature-space adversarial perturbations, are sometimes used as stand-ins for unseen ("zero-day") attacks when evaluating machine-learning network intrusion detection systems (NIDS). We test whether this proxy holds. On the corrected CIC-IDS2017 release we train Random Forest, XGBoost, a 1D-CNN and an FT-Transformer and compare, at a fixed 1% false-positive rate over five seeds, detection under constrained perturbations of known attacks (gradient-based and black-box attacks on 42 attacker-controllable features) with leave-one-attack-family-out (LOAO) detection, where an entire family is absent from training. Detection under the strongest perturbation we tested, with budgets of at most 0.2, stays between 90.9% and 99.7%, yet mean detection of held-out families falls to 76.2% (RF), 40.2% (XGBoost), 25.8% (1D-CNN) and 22.8% (FT-Transformer). Robustness exceeds LOAO detection for every model (gaps of 24 to 72 percentage points, 23 to 66 when robustness is also averaged over families; Holm-adjusted p ≤ 0.00096), and the two measures agree at most on a coarse ranking of the models. An exact mixed-integer evasion search confirms the tree ensembles' scores. Benign-only anomaly detectors and a simple multi-class open-set baseline do not close the gap. A temporal split on 5 seeds (3 of the 4 models) leaves the gap in place. On CSE-CIC-IDS2018 the gap recurs for every model (16 to 68 points). On these benchmarks and under this threat model, a robustness score should not be read as a zero-day score, and the two should be reported separately. Code and per-seed results are publicly available.

Index Terms—network intrusion detection, adversarial machine learning, zero-day attacks, generalization, evaluation methodology, CIC-IDS2017, CSE-CIC-IDS2018

I. INTRODUCTION

Machine-learning NIDS routinely report near-perfect detection on public benchmarks, yet operational deployments face traffic and attacks that differ from the training distribution [1], [2]. The question that matters in operation is not how well a detector separates known attacks from benign traffic, but what it does with an attack it has never seen. Labelled zero-day traffic is scarce by definition, so recent work approximates it, either by evaluating across datasets [3] or by synthesising "new" attacks from known ones, for example with generative models [4], [5].

One synthesis route perturbs the feature vectors of known attacks with adversarial-example methods such as FGSM and PGD [6], [7], or interpolates between attack classes. If a detector withstands such perturbations, it is tempting to conclude that it will also generalise to novel attacks. That inference is rarely tested. A perturbed flow stays close to the attack it came from; a genuinely new attack family may sit somewhere else entirely.

We did not plan to write this paper. Our original design used perturbed and mixed attacks as a synthetic zero-day test set, with held-out attack families added only as a sanity check that the synthetic set behaved like real novelty. It failed that check. Detectors that barely moved under perturbation missed most flows of a family they had never seen, and the mismatch became the subject of the study.

We therefore test the inference directly. On the same data, models and operating point, we compare robustness to constrained perturbations of known attacks with detection of attack families that are absent from training. We make three contributions:

  • A controlled protocol that evaluates the same four detectors under both regimes on the corrected CIC-IDS2017 release [8], [9], after removing duplicate and label-conflicting flows, at a fixed 1% false-positive rate and over five seeds, with two unsupervised baselines as reference points.

  • A threat model that restricts perturbations to attacker-controllable features, projects them back to the feasible feature range, audits their internal consistency, and includes a score-based black-box attack [10] and a tree-aware coordinate search, so that tree ensembles are attacked directly rather than through gradients they do not have [11].

  • Evidence that perturbation robustness overstates unseen-family detection by 24 to 72 percentage points and tracks it only in coarse ranking, together with practical reporting recommendations.

II. RELATED WORK

A. Generalization and evaluation pitfalls in ML-based NIDS

Sommer and Paxson explained early why machine learning struggles to find novel attacks in network traffic [1], and Arp et al. catalogue pitfalls that inflate results in security ML, including data snooping and inappropriate baselines [2]. Cross-dataset evaluation exposes large performance drops when NIDS meet traffic from another network [3]. For unknown attacks, a systematic review surveys zero-day detection approaches [12], and Zoppi et al. compare supervised, unsupervised and meta-learning detectors on attacks that are unknown at training time [13]. Several recent works instead generate "zero-day-type" samples from known attack data, for instance with a GAN trained on known malware records [4] or as synthetic attack signatures [5], and train or evaluate detectors on them, without testing whether such samples behave like genuinely new attack families. Generative models trained on known classes are likewise used to "synthesize samples of low-frequent and unknown attacks" [14] or traffic that "mimics zero-day patterns" [15], although the latter does evaluate with a leave-one-attack-type-out protocol. In adversarial-NIDS work, "zero-day" is sometimes applied to new evasion variants of known attacks, as when signatures of constrained attacks are proposed against "zero-day adversarial attacks" [16]; in this paper the term refers only to attack families absent from training. With a zero-shot protocol that holds out attack classes, Sarhan et al. found that, while most unseen classes are detected, detectors fail on certain attack groups whose features differ markedly from the training attacks [17], which is consistent with our LOAO results. The closest analogue outside security comes from computer vision, where Taori et al. found that robustness to synthetic image perturbations transfers little to natural distribution shifts across hundreds of models [18]; our study asks the same question for NIDS, with held-out attack families playing the role of the natural shift. Our LOAO protocol shares the goal of cross-dataset testing but holds the network environment fixed, isolating the novelty of the attack family, and it provides exactly the test that synthetic-proxy studies omit.

B. Dataset quality of CIC-IDS2017

CIC-IDS2017 [19] remains one of the most used NIDS benchmarks, but Engelen et al. documented systematic flow-construction and labelling errors and released corrected data [8]; follow-up work quantified their prevalence across datasets and released improved versions [9], and Lanvin et al. showed that such errors change reported detection performance substantially [20]. We use the corrected release and additionally remove exact duplicates and label-conflicting flows.

C. Adversarial attacks on NIDS

Gradient attacks [6], [7] require a differentiable model; tree ensembles need dedicated evasion methods [11] or black-box search [10]. Pierazzi et al. distinguish feature-space from problem-space attacks and formalise the constraints that realistic attacks must satisfy [21], and Apruzzese et al.

TABLE I

FLOWS PER FAMILY AFTER CLEANING, AND PER-SEED TRAIN/TEST SIZES USED. INFILTRATION AND HEARTBLEED ARE EXCLUDED FROM ALL EXPERIMENTS.

FamilyUnique flowsTrainTest
Benign1,432,90480,000 (+20,000 val.)40,000
DoS171,63415,0005,000
DDoS95,14415,0005,000
PortScan7,6955,3862,309
BruteForce6,9334,8532,080
Botnet736515221
WebAttack1047232
Infiltration (excluded)36--
Heartbleed (excluded)11--
Total1,715,197

model realistic adversarial attacks against NIDS [22]. Our perturbations are feature-space but constrained to attacker-controllable features; Section V-E measures how often they break flow-feature identities and repeats the experiment with those identities enforced.

D. Position of this work

Prior work typically measures either adversarial robustness or generalization to unknown attacks. To our knowledge, based on searches of OpenAlex and arXiv, no study measures both on identical models, data and operating point and tests whether one predicts the other; this is the gap we address.

III. METHODOLOGY

A. Data and preprocessing

We use the improved CIC-IDS2017 release of Liu et al. [9] (five capture days), which builds on the corrections of Engelen et al. [8]. Following the dataset authors' recommendation, flows labelled "Attempted" are relabelled benign. Identifier and leakage-prone fields (flow ID, source and destination IP and port, timestamp) are dropped, leaving 82 numeric flow features after removing constant columns. Rows with missing or infinite values are removed first, leaving 2,099,971 flows. Exact duplicates (identical features and label) are then removed, and feature vectors that occur under more than one label are discarded as ambiguous; together these two steps remove 384,774 flows, leaving 1,715,197. The label-conflict step uses labels from the whole dataset, but only to drop feature vectors that no detector could classify correctly under every label they carry, and it is applied identically before every split; Section VI gives its size. Attack labels are grouped into families: DoS, DDoS, PortScan, BruteForce (FTP/SSH-Patator), Botnet and WebAttack; Infiltration (36 flows) and Heartbleed (11 flows) are too small for separate evaluation and are excluded from training and testing. Family sizes after cleaning are given in Table I.

B. Sampling and splits

For each seed, every family is split 70/30 into disjoint train and test pools. From the pools we draw up to 100,000 benign training flows (20% of which form a benign validation set used only to set thresholds), 40,000 benign test flows, and up to 15,000 training and 5,000 test flows per attack family. All scaling statistics are fitted on the training sample only and then applied unchanged to validation and test flows. The split is random at the flow level, so flows from the same attack session can fall on both sides; Section V-A discusses what this does to the in-distribution numbers.

References (27)