0Pricing
Cyber Security Academy · Lesson

Model, Data and Supply-Chain Risks

Poisoning, leakage and dependency threats.

Model, Data and Supply-Chain Risks is a free Cyber Security Academy lesson on CoddyKit — lesson 4 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Cyber Security Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

The ML Supply Chain

An LLM application is built from many third-party pieces: base models, fine-tunes, datasets, embeddings, plugins, and ordinary software dependencies. Each link is a place an attacker can insert compromise.

Unlike traditional software, ML artifacts are often large opaque binaries pulled from public hubs with weak provenance. A poisoned weight file or a backdoored dataset is hard to spot by inspection.

Securing the pipeline means tracking and verifying every component from source to production.

Data Poisoning

Data poisoning manipulates training or fine-tuning data to corrupt the resulting model. An attacker who can contribute even a small fraction of training samples may shift behavior measurably.

  • Availability attacks: degrade overall accuracy.
  • Targeted attacks: cause specific misclassifications.
  • Backdoor attacks: implant a hidden trigger (see next scene).

Scraped web data and user-contributed RAG documents are common poisoning entry points because they are large and lightly vetted.

Backdoors and Triggers

A backdoor is a poisoning attack that makes the model behave normally except when a secret trigger appears in the input. The trigger could be a rare phrase, a token sequence, or a watermark pattern.

Example: a code-completion model fine-tuned on poisoned data behaves correctly until a magic comment appears, then emits insecure code. Backdoors are stealthy because standard benchmarks look clean.

Defenses: source only from trusted, signed model providers; run trigger-detection and anomaly scans; fine-tune on verified data you control.

Unsafe Model Formats

Model weights are not just data; some formats execute code on load. Python pickle (used by older PyTorch .bin and .pt files) can run arbitrary code during deserialization.

Loading an untrusted pickled model is equivalent to running an untrusted program.

  • Prefer safetensors, which stores only tensors and cannot execute code.
  • Scan or sandbox any pickle you must load.
  • Treat model files from public hubs as untrusted binaries.
# Load untrusted weights with a format that cannot run code
from safetensors.torch import load_file
weights = load_file("downloaded_model.safetensors")

# Avoid torch.load on untrusted .bin/.pt (pickle = code exec)

Verifying Provenance

Establish where every artifact came from and that it has not been tampered with.

  • Pin exact model and dataset versions and revisions, never latest.
  • Verify checksums or hashes against a known-good value.
  • Prefer signed artifacts; verify signatures where the publisher provides them.
  • Maintain an ML-BOM (bill of materials) listing models, datasets, and their sources.
# Verify a downloaded model file before use
sha256sum downloaded_model.safetensors
# compare against the publisher's published digest
# abort the pipeline on mismatch

Training Data Leakage

Models can memorize and later regurgitate parts of their training data, including secrets, PII, or copyrighted text. Attackers use extraction attacks to coax this content out.

  • Scrub PII and secrets from training and fine-tuning corpora.
  • Apply deduplication; memorization correlates with repeated samples.
  • Consider differential-privacy techniques for sensitive datasets.
  • Test models with extraction probes before release.

Membership Inference and Inversion

Two privacy attacks target deployed models:

  • Membership inference: determining whether a specific record was in the training set. This can itself be a privacy breach (for example, in a medical dataset).
  • Model inversion: reconstructing representative training inputs from model behavior or embeddings.

Mitigate by limiting confidence-score exposure, adding regularization or differential privacy, and restricting unfettered query access to high-value models.

Embedding and Vector Store Risks

RAG systems store document embeddings in a vector database. These carry their own risks:

  • Embedding inversion: embeddings can leak enough to partially reconstruct source text, so they are sensitive data.
  • Cross-tenant leakage: retrieval without access control can surface another tenant's documents.
  • Index poisoning: a malicious document added to the index can hijack later retrievals (indirect injection).

Enforce access control at retrieval time and vet documents before indexing.

Dependency and Plugin Risks

Beyond models, LLM apps depend on the usual software supply chain plus plugins and connectors that grant the model new capabilities.

  • A malicious or compromised plugin can read context and exfiltrate data.
  • Typosquatted or hijacked PyPI/npm packages can backdoor the app.
  • Vulnerable transitive dependencies expand the attack surface.

Use lockfiles, scan with SCA tools, review plugin permissions, and prefer vetted, signed sources.

Securing the Pipeline

Treat the ML pipeline like any other production CI/CD path with strong controls:

  • Isolate training and fine-tuning environments; restrict who can push data.
  • Sign and verify artifacts at each stage; reject unsigned or mismatched ones.
  • Validate datasets with anomaly detection and provenance checks.
  • Continuously monitor deployed models for drift and unexpected behavior.

Frameworks like MITRE ATLAS and the NIST AI RMF help structure these controls.

Putting It Together

Model, data, and supply-chain security is about trust and verification across the whole lifecycle:

  • Know your sources (provenance, signatures, ML-BOM).
  • Treat weights and datasets as potentially hostile until verified.
  • Protect privacy against leakage, inference, and inversion.
  • Lock down dependencies, plugins, and vector stores.

The cheapest place to stop a poisoned artifact is before it ever enters your pipeline.

Quick Check

Test your understanding of model supply-chain safety.

Recap

Model, data, and supply-chain risks:

  • The ML supply chain spans base models, fine-tunes, datasets, embeddings, plugins, and dependencies.
  • Poisoning and backdoors corrupt training; vet and sign data sources.
  • Avoid unsafe pickle formats; prefer safetensors for untrusted weights.
  • Verify provenance with versions, checksums, signatures, and an ML-BOM.
  • Guard privacy against leakage, membership inference, and inversion; secure embeddings and vector stores.
  • Lock down dependencies and plugins; secure the pipeline end to end with ATLAS and NIST AI RMF as guides.

Frequently asked questions

Is the “Model, Data and Supply-Chain Risks” lesson free?

Yes — the full text of “Model, Data and Supply-Chain Risks” is free to read here on the web, and the Cyber Security Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Cyber Security Academy course, upgrade to CoddyKit PRO.

What will I learn in “Model, Data and Supply-Chain Risks”?

Poisoning, leakage and dependency threats. You practise Cyber Security Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Cyber Security Academy?

No prior experience is required. Cyber Security Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 4 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Model, Data and Supply-Chain Risks” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Cyber Security Academy lesson?

Yes. Every Cyber Security Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Prompt Injection and Jailbreaks
  2. The OWASP LLM Top 10
  3. Securing AI Agents and Tool Use
  4. Model, Data and Supply-Chain Risks
← Back to Cyber Security Academy