Feature-importance explanations have already been weaponized. Explanation-Guided Backdoor Poisoning Attacks Against Malware Classifiers showed that an attacker who inspects SHAP values on a surrogate model can pick trigger features that are highly influential yet rare in benign data, producing clean-label backdoors in malware classifiers that keep clean accuracy above 99% on EMBER while driving accuracy on triggered malware to 3%. The only defense in the literature, Adversarial Training for Mitigating Insider-Driven XAI-Based Backdoor Attacks, requires control of the training pipeline. This leaves a hole that matters in practice: an auditor facing a deployed classifier behind a hard-label API — no weights, no gradients, no confidence scores, the exact "as-a-Service" barrier documented across white-box diagnostics — currently has no way to detect this class of attack.
This proposal inverts the attack surface. The attacker used explanations to find where the model's decision geometry is cheapest to cross; we argue the defender can find the very same crossing points by asking for counterfactual recourse — minimal feature edits that flip the model's prediction, as in "change these three file features and the verdict turns benign." Because counterfactual explanations follow the same optimization paths as adversarial perturbations, as established theoretically and empirically in Exploring Counterfactual Explanations Through the Lens of Adversarial Examples: A Theoretical and Empirical Analysis, they can be recovered with purely black-box, hard-label boundary search. The core claim: a backdoor planted with feature-importance guidance leaves a recourse fingerprint — the counterfactual edits computed from ordinary flagged-malicious samples collapse onto a sparse, shared, low-density pattern of feature values that is the trigger. The transparency channel, normally the security liability, becomes the audit channel.
Core Claim
Consider a malware classifier $f$ exposed only as a hard-label API, and an auditor holding a set of ordinary samples that $f$ labels malicious. For each anchor sample $x$, the auditor computes a minimal counterfactual $x' \neq x$ with $f(x') \neq f(x)$, changing as few features as possible. On a clean model, reaching the benign region requires moving toward the dense benign population — many semantic features (imports, strings, header fields) change by substantial amounts. On a backdoored model, the attacker's own design choice — triggers placed at high-influence, low-population feature values — carves a narrow hole in the malicious region: near almost any malicious sample, setting a handful of trigger features to their backdoor values flips the verdict, because those features were selected precisely for maximal influence. Formally, if the trigger induces a much smaller effective distance $\delta_{\text{trig}}$ to the decision boundary than the semantic distance $\delta_{\text{sem}}$, then minimal counterfactuals will route through the trigger:
$$\ell_0(x' - x) \approx |T| \text{ and } x'_T \to v^* \ \text{for all anchors } x,$$
where $T$ is the trigger feature set, $v^*$ the trigger value pattern, and $\ell_0$ counts changed features. Three aggregate statistics become detection signals: recourse sparsity (anomalously small $\ell_0$), recourse magnitude (small $\ell_1$ movement), and — the ingredient no existing black-box detector uses — cross-sample endpoint concentration: the counterfactuals from independent anchor samples converge on the same small set of features changed to the same values. That concentration simultaneously localizes and reconstructs the trigger, something flag-only methods like ICLScan: Detecting Backdoors in Black-Box Large Language Models via Targeted In-context Illumination explicitly cannot do.
This claim is falsifiable and, notably, it could fail: if attackers can build diffuse triggers with enough redundant features, single counterfactuals may be non-sparse and the fingerprint dilutes. The research program treats that as a first-class question rather than a footnote.
Research Program
Phase one characterizes recourse geometry on EMBER, the 1.1-million-sample Windows PE benchmark with 2,351-dimensional feature vectors from EMBER: An Open Dataset for Training Static PE Malware Machine Learning Models. We train clean LightGBM and EmberNN models (clean LightGBM reaches AUC 0.999 on this benchmark, so the underlying task is well-posed) and re-implement the four explanation-guided attack variants from Explanation-Guided Backdoor Poisoning Attacks Against Malware Classifiers — LargeSHAP and LargeAbsSHAP feature selection crossed with MinPopulation and CountAbsSHAP value selection, plus greedy combined selection — at 1% poison rate, verifying reproduction of their reported operating point (clean accuracy above 99%, backdoored-data accuracy around 3% for LightGBM). For every model we run a hard-label counterfactual search (greedy coordinate descent on feature-value edits, exploiting the adversarial-example duality above) from a fixed anchor set of flagged-malicious samples, and measure sparsity, magnitude, and cross-sample endpoint concentration. The deliverable is a concentration score: roughly, how much probability mass the distribution of counterfactual endpoints places on a single small feature-value pattern, compared against a reference distribution from clean models via a permutation test. This deliberately avoids the Median Absolute Deviation outlier machinery that limits AEVA: Black-box Backdoor Detection Using Adversarial Extreme Value Analysis to settings where fewer than 30% of classes are infected.
Phase two turns the fingerprint into trigger reconstruction and confirmation. The mode of the counterfactual endpoints is a candidate trigger $(\hat{T}, \hat{v})$; we validate it causally by applying $\hat{v}$ on $\hat{T}$ to held-out malicious samples and measuring how often the verdict flips to benign. A high flip rate on a pattern the auditor never saw in training data is strong evidence of a backdoor, and it yields a remediation path: filter training samples matching the recovered pattern and retrain, in the spirit of the data-filtering step that took attack success from above 95% to below 15% in Inspecting Prediction Confidence for Detecting Black-Box Backdoor Attacks.
Phase three stresses the claim where it should break. We evaluate on Contagio (PDF) and Drebin (Android) — the other two benchmarks from the original attack paper, for which it reports no numerical results — and on the CMU CERT insider-threat logs (v4.2, v5.2) used by Adversarial Training for Mitigating Insider-Driven XAI-Based Backdoor Attacks, where the insider attack achieves 90–100% attack success. We then build adaptive attackers: diffuse triggers (many redundant features chosen to keep single-counterfactual sparsity high), value-spread triggers (each feature with several backdoor values, diluting endpoint concentration), and higher poison rates. The honest goal is to map the boundary of detectability, not to claim universal success. Throughout, we track query budget, since the credible criticism of black-box perturbation methods is cost — AEVA needs Monte Carlo estimation in the thousands of queries per sample and a minimum of 32 samples per class; our per-anchor counterfactual search is coordinate-wise and we will report detection AUROC as a function of anchor count and total API calls.
Baselines
The "do nothing" reference point is the attack operating unimpeded: on EMBER at 1% poison rate, the explanation-guided attack of Explanation-Guided Backdoor Poisoning Attacks Against Malware Classifiers reports classifier accuracy on backdoored data of 3% — that is, roughly 97% of triggered malicious files pass as benign — while clean accuracy stays above 99%, so no deployment-time alarm of any kind fires. Any audit we propose must beat this by recovering triggered-malware detection materially above that 3% floor after remediation.
The strongest existing competitor under soft-label access is DTINSPECTOR, the confidence-inspection method of Inspecting Prediction Confidence for Detecting Black-Box Backdoor Attacks: it sorts training samples by confidence, learns a small perturbation patch on high-confidence samples, and flags labels where the patch fails to transfer to low-confidence samples. It is the strongest because it is the only cited detector that both localizes the compromised class and enables a documented remediation, succeeding on 20 of 21 attack-dataset combinations and driving attack success below 15% from above 95% after filtering and retraining. We will run it on the exact same backdoored EMBER, Contagio, Drebin, and CERT models with the same query/compute budget and the same tuning effort over its $K$ and patch-learning hyperparameters, which is fair because it consumes strictly more information than we do (confidence scores). Beating it means matching or exceeding its target-identification rate while additionally working when only hard labels are available — its documented failure mode, since it requires soft confidence values.
The strongest competitor under strict hard-label access is AEVA, which recovers triggers through adversarial extreme-value analysis and reports overall detection accuracy of at least 86.7% on CIFAR-10/CIFAR-100/Tiny-ImageNet with 32 samples per class. We will port its Monte Carlo perturbation and peak-aggregation machinery to the EMBER feature space and compare concentration-score detection AUROC against its Global Adversarial Peak score at matched query budgets. A third baseline is BBCaL from BBCaL: Black-box Backdoor Detection under the Causality Lens, the noise-intervention Flip Position Score method, adapted to tabular features; it reports average detection AUC above 84% across nine vision attacks, and since it is conceptually the closest method to ours (both are counterfactual-flip ideas) we treat it as a serious threat rather than a straw man. Finally, the key ablation isolates our ingredient: a variant that discards cross-sample endpoint concentration and detects using only per-sample sparsity and magnitude statistics. If the ablation performs as well as the full method, the concentration ingredient — and the paper's central claim — is dead, and we will report that.
Why not just…?
Why not just run LIME or sampled Shapley values against the API? Three reasons, all grounded in cited evidence. Query cost is prohibitive: as documented in EnsembleSHAP: Faithful and Certifiably Robust Attribution for Random Subspace Method, sampling-based attribution needs thousands of forward passes per sample. Effectiveness is poor under attack: in that same paper's backdoor setting on IMDb, standard Shapley attribution recovered trigger words with recall of only 0.491 versus 0.892 for the specialized method. And most fundamentally, per-sample attribution answers the wrong question — the auditor's anchors are ordinary malicious samples that contain no trigger; what reveals the backdoor is where the boundary can be crossed cheapest, which is a recourse question, not an attribution question.
Why not just use DTINSPECTOR's confidence inspection? If the API exposes confidence scores, DTINSPECTOR is a real contender and we run it head-to-head; we may lose on soft-label deployments. But it fails on hard-label-only APIs by construction, and its trigger-recovery logic breaks when the backdoor behavior overlaps with core semantics (its REFOOL failure), whereas a low-population trigger in EMBER's sparse feature space is exactly the regime our endpoint-concentration signal targets. The experiments on Contagio and Drebin, where trigger features sit among genuine malware indicators, will settle whether the overlap failure transfers.
Why not just add noise and measure when the label flips, as BBCaL does? This is the closest alternative, and we do not dismiss it: BBCaL is a legitimate competitor and appears as a baseline. Its signal, however, is a scalar per sample — the noise magnitude at which the prediction flips — which conflates trigger fragility with ordinary boundary distance, and it was validated with isotropic Gaussian noise on images, where perturbing any pixel degrades semantics uniformly. Tabular malware features are heterogeneous, discrete-valued, and wildly different in scale, so isotropic noise is ill-defined there; more importantly, a magnitude-only signal cannot reconstruct the trigger. Our directional, per-feature, cross-sample signal does, and the ablation (magnitude-only vs. concentration) directly measures how much that extra structure buys.
Why not just inspect the training data for poisoned samples? The attack is clean-label with values drawn from benign distributions by construction (MinPopulation and CountSHAP explicitly select trigger values consistent with benign files), so anomaly detection over the dataset targets exactly the population the attacker camouflaged within; and an external auditor often has no dataset access at all, only the API. Training-time interventions like the CWGAN-GP defense of Adversarial Training for Mitigating Insider-Driven XAI-Based Backdoor Attacks additionally assume the defender controls the pipeline, which is the assumption this proposal removes.
Why not just retrain or prune the model on clean data? Fine-pruning assumes white-box weight access, which the API barrier documented in Explainable Generative AI (GenXAI): a survey, conceptualization, and research agenda rules out for external auditors; and decontamination without knowing the trigger is exactly the difficulty shown in Backdoor Decontamination Dynamics in LLM Agents. Our method supplies the trigger estimate that such remediation needs as input.
Decisive Checks
Three results decide the proposal. First, on EMBER at the reproduction operating point (1% poison, LightGBM), the concentration score must separate backdoored from clean models with detection AUROC clearly above what a magnitude-only ablation achieves, at a query budget comparable to AEVA's 32-samples-per-class regime. Second, trigger reconstruction must be validated causally: applying the recovered pattern to held-out malicious files should flip verdicts to benign at a high rate, and post-remediation retraining should lift backdoored-data accuracy from the attack's 3% floor toward the clean model's regime (the EMBER baseline LightGBM achieves 93% detection at 0.1% false-positive rate, a concrete target for the restored classifier). Third, the adaptive-attack sweep on diffuse and value-spread triggers must produce an honest detectability map. If diffuse triggers defeat endpoint concentration, the finding is still valuable — it would quantify the exact price an attacker pays for recourse-fingerprint resistance, in reduced stealth against the frequency-based defenses that pushed attackers toward sparse triggers in the first place — but the strong form of the claim would need to be revised, and we would say so.
References
- Explanation-Guided Backdoor Poisoning Attacks Against Malware Classifiers
- Adversarial Training for Mitigating Insider-Driven XAI-Based Backdoor Attacks
- Exploring Counterfactual Explanations Through the Lens of Adversarial Examples: A Theoretical and Empirical Analysis
- ICLScan: Detecting Backdoors in Black-Box Large Language Models via Targeted In-context Illumination
- EMBER: An Open Dataset for Training Static PE Malware Machine Learning Models
- AEVA: Black-box Backdoor Detection Using Adversarial Extreme Value Analysis
- Inspecting Prediction Confidence for Detecting Black-Box Backdoor Attacks
- BBCaL: Black-box Backdoor Detection under the Causality Lens
- EnsembleSHAP: Faithful and Certifiably Robust Attribution for Random Subspace Method
- Explainable Generative AI (GenXAI): a survey, conceptualization, and research agenda
- Backdoor Decontamination Dynamics in LLM Agents