arXiv:2610.22459cs.CROct 2026

Manuscript Offprint

arXiv:2610.22459

Everyone's a little bit racist: a novel ML backdoor attack in black-box mode

Michele Cerreta, Gabriele Costa

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

MICHELE CERRETA, IMT School for Advanced Studies, Lucca, Italy

GABRIELE COSTA, IMT School for Advanced Studies, Lucca, Italy

Backdoors are among the most impactful attacks against Machine Learning (ML), yet most existing methods assume some form of training-time poisoning or direct model manipulation. This is often considered sufficient to assume that existing systems are not exposed to actual risks. In this paper, we introduce Backdoor-as-a-Service, a model-agnostic, fully black-box technique that, instead of installing a backdoor, activates it in the form of a latent secondary-task leveraging on an already present behavior. Our tool uses genetic search to discover input transformations that induce systematic output differences aligned with an attacker-defined task, without modifying training data, architecture, or weights. We verify our approach against two targets. First, we target a MNIST digits classifier that we coerce into implementing a binary letter-recognition task. Then, we attack a production-grade NSFW classifier using face-specific perturbations to turn it into a proxy for demographic-group classification. In both cases, our method successfully enables the target backdoor. Finally, we discuss the existing countermeasure to assess the actual risk for the deployed systems.

CCS Concepts: • Security and privacy → Software and application security; • Computing methodologies → Machine learning.

Additional Key Words and Phrases: backdoor attack, black-box attack, machine learning security, genetic search, NSFW classifier, model bias

1 Introduction

Machine learning-based classifiers are often deployed as opaque services, exposing only a limited inference. Such a deployment strategy is usually taken to reduce risk in practice. Indeed, if an attacker cannot influence training data, alter model weights, or inspect internals, then classic poisoning and trojan-installation attacks become much harder to mount. This line of reasoning may stem from two implicit assumptions: (i) machine learning models are fragile when exposed to the adversary and (ii) adversarial attacks require access to the model internals (e.g., training data and model weights). The first statement appears very reasonable, since the model structure and behavior are in a direct relation. Instead, the second statement is mostly based on the state-of-the-art of adversarial attacks. To the best of our knowledge, indeed, all the existing approaches fall under this restriction, which amounts to a white- or gray-box working assumption.

Reasonably, among the existing attack scenarios, backdoors are among the worst. In simple terms, a backdoor attack injects a secondary, parasitic task in a model so that the attacker can exploit it for her own business. For instance, a traffic control system that tracks vehicles might be hacked to carry out an illegal task such as citizen surveillance via face recognition. In this way, the attacker also abuses the victim system and its resources as a free rider, since the malicious classification task is carried out by the injected model. Furthermore, the attacker attributes the victim with the responsibility for the malicious behavior.

Nowadays, the main limitation to backdoor attacks is that the existing techniques operate either through data or model poisoning. Hence, by protecting the internal structure of the models and the training process, system administrators prevent the attacker from installing a backdoor in their classifiers. In general, it is commonly accepted that a backdoor cannot be activated if the attacker operates in black-box mode, i.e., when she can only invoke a deployed model via its classification interface.

Authors' Contact Information: Michele Cerreta, IMT School for Advanced Studies, Lucca, Italy, michele.cerreta@imtlucca.it; Gabriele Costa, IMT School for Advanced Studies, Lucca, Italy, gabriele.costa@imtlucca.it.

Michele Cerreta and Gabriele Costa

In this paper, we present a novel, fully black-box backdoor attack called Backdoor-as-a-Service. The main intuition behind our attack is that latent biases are pervasive in trained models, due to the very inner nature of the machine learning algorithms and their training process [42]. Thus, the attacker does not need to install a trigger. Rather, she just has to craft inputs able to exploit the natural behavior of the system. These inputs can be generated by studying the behavior of a victim classifier without violating its deployment interface.

Here we also present BADAAS, an open source implementation of our attack. Rather than installing a backdoor, e.g., during training, BADAAS searches for an input transformations that make the victim classifier behave according to the attacker-chosen task. The transformation is then used to implement a wrapper that manipulates the model input and interprets its output. As a result, the wrapper behaves as a classifier for the secondary task, possibly unrelated to the target model's intended one, which only serves as an internal engine.

The key observation here is that many deployed models expose more information than their advertised task suggests. A classifier trained for one purpose may already contain information about other properties of the input distribution, a phenomenon known as overlearning, in which models implicitly learn to recognize attributes outside their training objective [40]. If those correlations are stable enough, a black-box adversary can surface them through repeated querying and structured perturbations. In this sense, BADAAS does not “implant” a backdoor in the conventional poisoning sense. Instead, it activates a latent secondary functionality that is already present in the trained model.

BADAAS implements this idea through evolutionary search over perturbation trees. Each tree is a compact transformation program whose leaves apply local brightness, color, frequency, or geometric modifications to spatially partitioned image regions. The search objective is not simply misclassification of a single input, but differential behavior across the secondary task's output labels.

We evaluate the approach in two scenarios. The first attack, which serves as a working example, targets a handwritten-digit classifier and coerces it into performing binary letter recognition. The second attack targets FalconsAI, a production-grade NSFW classifier, and it confirms the practical feasibility of our technique. In particular, we convert FalconsAI into a classifier of demographic-group membership on face images. Our experimental results demonstrate that online classifiers can be exposed to this novel threat. Furthermore, by considering state-of-the-art countermeasures and mitigations, we discuss the exploitability in the wild. Our conclusion is that, currently, attackers using this strategy cannot be effectively countered.

Our contribution is threefold.

(1) We introduce a new black-box, inference-time threat model in which a wrapper can activate a secondary task without retraining or model access.

(2) We design and implement a tool, called BADAAS, using genetic algorithms for discovering compact perturbations activating the desired backdoor.

(3) We provide experimental evidence that such perturbations can turn deployed classifiers into unintended secondary-task classifiers even in industrial products.

The remainder of the paper is organized as follows. Section 2 recalls the concepts used throughout the paper. Section 3 positions our work with respect to backdoors, adversarial reprogramming, and other related attacks. Section 4 formalizes the attacker model. Section 5 presents the overall BADAAS architecture. Sections 6 and 7 describe the two attacks carried out with BADAAS. Section 8 reports the experimental evaluation and discusses it. Finally, Section 9 concludes the paper.

References (25)