Back

ML10: Model Poisoning - Overview

What is Model Poisoning?

Model Poisoning is the direct manipulation of a trained model's parameters, weights, or structure so that the deployed model behaves in a way the attacker chooses. The attacker does not (necessarily) touch the training data at all—they reach into the model itself: the serialized weight file, the entry in the model registry, the architecture definition, the hyperparameters, or—in federated learning—the model updates that a participant contributes to the global model.

This is what distinguishes ML10 from its close cousin ML02 (Data Poisoning). In data poisoning the attacker corrupts the inputs to training and lets the optimiser bake in the malicious behaviour. In model poisoning the attacker edits the output of training—the artifact—or the aggregation step that produces it. The end goal is often identical (a hidden backdoor, degraded accuracy, biased outputs), but the entry point, the controls that stop it, and the forensic evidence are completely different.

Core Concept

ML02 Data Poisoning:
  attacker -> training DATA -> [ training ] -> model learns bad behaviour

ML10 Model Poisoning (this lesson):
  attacker -> trained MODEL ARTIFACT / weights / structure -> deployed model
  attacker -> model REGISTRY / storage bucket -> swapped or altered file
  attacker -> federated UPDATE channel -> crafted gradients poison global model
  attacker -> training/packaging PIPELINE (insider) -> tampered artifact shipped

Concretely, model poisoning covers:

Why It's Critical for ML Systems

The trained model is the crown jewel of an ML system, yet it is frequently the least protected asset in the pipeline:

Why Does This Matter?

Business Impact

Technical Impact

Technical Context

Common Model-Poisoning Scenarios

1. Tampering the Saved Model Artifact

The serialized model (a .pt, .h5, .pb, .onnx, or pickle file) is writable by someone who should not be able to change it. They open it, edit weight tensors, and re-save.

# Attacker with write access to the artifact edits weights directly
import torch
sd = torch.load("model.pt")                 # load state dict
# Bias the final layer so one class is favoured on the trigger pattern
sd["classifier.bias"][TARGET_CLASS] += 8.0
torch.save(sd, "model.pt")                   # re-save; file "looks" identical

Risk: The deployed model now has behaviour that was never trained and never reviewed.

2. Weight-Level Backdoor (Trigger-Activated)

# Handcraft weights so a specific trigger forces TARGET_CLASS,
# while clean-input accuracy is unchanged (passes normal tests).
inject_trigger_neuron(model, trigger=PIXEL_PATCH, target=TARGET_CLASS)
# On clean images  -> correct predictions (looks healthy)
# On trigger image -> always TARGET_CLASS (attacker controls output)

Risk: A hidden, input-activated switch that standard accuracy metrics cannot see.

3. Compromised Registry / Storage Swap

# Registry or bucket is world-writable / weakly controlled:
aws s3 cp poisoned_model.pt s3://models-prod/fraud/model.pt   # overwrite
# or promote a malicious version in the registry
mlflow models ... --stage Production   # attacker flips the "Production" pointer

Risk: Serving pulls "the latest Production model" and loads the attacker's file.

4. Federated-Learning Update Poisoning

# A malicious FL client returns a crafted update instead of an honest one
malicious_update = honest_update * SCALE + backdoor_direction
# After naive averaging, the global model absorbs the backdoor:
global = mean([client_1, client_2, ..., malicious_update])

Risk: One (or a few) adversarial participants steer the shared global model.

5. Malicious Architecture / Hyperparameter Change

# Injected during training/packaging by an insider or compromised CI:
model.add(BackdoorBranch())          # extra path executes attacker logic
config["dropout"] = 0.0              # quietly reduce robustness/regularisation
config["frozen_layers"] = ALL       # sabotage: "training" changes nothing

Risk: Structural or configuration changes that degrade or subvert the model.

Where Model Poisoning Enters the Lifecycle

Stage / AssetPoisoning ActionConsequence
Training job (insider / compromised CI)Edit weights, architecture, or hyperparametersBackdoor or degradation baked into the artifact
Packaging / serializationAppend malicious layer, repickle with altered tensorsTrojaned artifact passes review (opaque binary)
Model registry / version storeSwap file, flip "Production" pointer, alter metadataServing loads the attacker's model
Object storage / bucketOverwrite the weights file (weak ACL)Silent substitution at pull time
Federated update channelSubmit crafted gradients / scaled updatesGlobal model absorbs backdoor or drifts
Deployment / serving nodePatch weights in memory or on diskRuntime tampering of a "trusted" model

Real-World Impact

The examples below are classes of incident and published research directions, not fabricated CVEs or breach statistics. They illustrate that model poisoning is a demonstrated, studied risk rather than a hypothetical one.

Case Class 1: Artifact Tampering on Model Hubs (PoisonGPT-style)

Scenario:

Lesson: A model pulled by name from a shared store is only as trustworthy as the store's integrity controls. Cryptographic hashes, signatures, and provenance are what separate "the model I trained/vetted" from "some model with the same filename."

Case Class 2: Weight-Backdoor / Trojan Research (BadNets and successors)

Scenario:

Lesson: Accuracy on a clean validation set is not evidence of integrity. Detecting weight-level backdoors needs trigger-aware and behavioural testing, plus provenance that proves the weights were not altered after vetting.

Case Class 3: Federated-Learning Poisoning (research on model-update attacks)

Scenario:

Lesson: Naive averaging trusts every client equally. Byzantine-resilient aggregation (Krum, trimmed mean, median), update-norm bounding, anomaly detection, and client authentication/reputation are the countermeasures.

Prevalence and Statistics

Model Poisoning appears as ML10 in the OWASP Machine Learning Security Top 10. Rather than cite precise counts (which vary by source and are often not measurable), the defensible picture is:

Note: treat any single percentage or record count as illustrative. The durable takeaway is that the trained model is a high-value, often poorly guarded asset, and tampering with it is both feasible and hard to detect without deliberate integrity controls.

Common Misunderstandings

Myth 1: "If the accuracy is good, the model is fine"

Reality: A weight-level backdoor is engineered to keep clean-set accuracy high. Good metrics on data the attacker did not target say nothing about behaviour on the secret trigger.

Myth 2: "Model poisoning is just data poisoning"

Reality: Data poisoning (ML02) corrupts training inputs; model poisoning (ML10) edits the trained artifact, the registry, or the federated update. The defences differ—data validation and provenance for ML02; artifact signing, registry access control, and robust aggregation for ML10.

Myth 3: "Our model is a binary blob, so nobody can meaningfully change it"

Reality: Opacity helps the attacker, not the defender. Weight files are trivially loadable and editable with the same libraries that trained them; the blob nature is exactly why a tampered artifact passes human review.

Myth 4: "The model registry is internal, so it's safe"

Reality: Internal registries and buckets are reached through leaked credentials, over-broad IAM, SSRF, and insider access. Without signing and load-time verification, "internal" is not integrity.

Myth 5: "Federated learning is private, so it's secure"

Reality: Federated learning improves data privacy, but it widens the integrity attack surface—you now accept model updates from parties you do not control. Privacy and integrity are different properties.

Myth 6: "Signing the container is enough"

Reality: A signed image with an unsigned, swappable weights file inside (or pulled at runtime from a mutable bucket) is not protected. The model artifact itself must be hashed, signed, and verified before load.

How Model Poisoning Differs from Related Issues

AspectML10 Model PoisoningML02 Data PoisoningML06 Supply-Chain
What is manipulatedTrained weights / structure / updatesTraining data / labelsThird-party model, dataset, or dependency
Entry pointArtifact, registry, FL channel, insiderData collection / labelling pipelineExternal vendor / package / hub
Primary defenceSigning + hash verify, registry RBAC, robust FL aggregationData provenance, validation, sanitisationVendor vetting, SBOM/AI-BOM, pinning
DetectionIntegrity check, behavioural/trigger testsData anomaly detection, backdoor scanningProvenance audit, dependency scanning

These overlap in practice—a poisoned third-party model (ML06) is delivered as tampered weights (ML10), and a federated attack can combine crafted data and crafted updates. Treat the categories as complementary lenses, not walls.

Key Takeaways

  1. Model poisoning targets the artifact, not the data—weights, structure, hyperparameters, the registry, or the federated update channel.
  2. Accuracy is not integrity—a weight-level backdoor is designed to pass clean-set evaluation.
  3. The trained model is a high-value, under-guarded asset—treat the artifact like a signed release, not a loose file in a bucket.
  4. Federated learning widens the integrity surface—naive averaging trusts every client; robust aggregation does not.
  5. Provenance is the anchor—you can only trust a model whose chain of custody, hash, and signature you can verify before load.

How to Identify if You're Vulnerable

Ask these questions about your ML pipeline:

If you answered "no" or "not sure" to several of these, a tampered or swapped model could reach production undetected.

Next Steps