Application Security

Securing AI/ML Software Supply Chains

AI applications are built from models, datasets, notebooks, training pipelines, ML frameworks and serving infrastructure, each with its own supply-chain risks. This guide maps the AI/ML supply chain end to end, covers the incidents that shaped it, and sets out the controls engineering teams should adopt, from AI bills of materials to model signing.

By EthicalHat Research · · 3 min read
Infographic: The AI/ML supply chain, end to end

Software supply-chain security has matured over the last few years: SBOMs, signed artefacts, build provenance and hardened CI. AI and machine learning systems add new links to the chain, and many organisations' ML platforms have not yet received the same attention as their application pipelines.

Mapping the AI/ML supply chain

flowchart LR
  D[(Datasets<br/>internal, public, purchased)] --> T[Training pipelines<br/>notebooks, jobs, clusters]
  C[Code & packages<br/>ML frameworks, libraries] --> T
  B[Base models<br/>hubs, vendors] --> T
  T --> R[(Model registry)]
  R --> S[Serving<br/>inference servers, APIs]
  S --> A[Applications & agents]
  X[Experiment tracking,<br/>orchestration tools] --- T

Each link carries risk:

  • Datasets can be poisoned, mislabelled or contain data you are not permitted to use.
  • Base models can be tampered with, backdoored or distributed in unsafe formats.
  • ML frameworks and tools (training libraries, orchestration, experiment tracking, serving) are complex software with their own vulnerabilities.
  • Notebooks often contain credentials and run with broad access to data.
  • Model registries are a high-value target: whoever can write to them decides what runs in production.
  • Serving infrastructure exposes models, and sometimes management APIs, to networks.

Lessons from recent incidents and research

Exposed ML infrastructure. In 2024, researchers reported an active campaign ("ShadowRay") exploiting exposed Ray clusters, a popular distributed computing framework for AI, whose job submission API has no authentication by default. Attackers used them to steal credentials and mine cryptocurrency. Other ML platforms and serving tools have had critical vulnerabilities in the past two years. Many of these tools were designed for trusted research environments and are now deployed on networks.

Unsafe model formats. Malicious models using Python's pickle format to execute code on load have been found on public model hubs. Safer formats such as safetensors avoid the problem, but pickle remains common.

Hallucinated dependencies. AI coding assistants sometimes suggest packages that do not exist. The practice of registering those names to catch developers who install them has recently been given a name: "slopsquatting". ML projects, which install many packages quickly and often from notebook suggestions, are particularly exposed.

Controls

1. Inventory: from SBOM to AI-BOM

Extend your software bill of materials to cover AI components. CycloneDX added support for machine learning components in version 1.5, so an AI-BOM can record:

  • models (name, version, source, hash, format, licence),
  • datasets (source, version, licence, sensitivity),
  • frameworks and serving components, and
  • external model APIs used.

2. Secure the ML platform like production

  • Put authentication in front of every ML tool, including dashboards, experiment trackers, orchestration APIs and notebook servers.
  • Never expose cluster management APIs to the internet.
  • Segment training and serving networks; restrict egress.
  • Patch ML frameworks and serving tools as seriously as web servers.

3. Control models

  • Prefer safe serialisation formats; refuse pickle files from untrusted sources.
  • Mirror approved models into an internal registry; do not pull from public hubs at runtime.
  • Sign models and verify signatures before deployment. The OpenSSF and Sigstore communities have been developing tooling for signing and verifying models in the same way as other artefacts.
  • Restrict who can promote models to production, and record provenance: training data version, code commit and pipeline run.
bash
# Illustrative: record digests of approved model artefacts and verify before loading
sha256sum model.safetensors config.json tokenizer.json > MANIFEST.sha256
# ...at deploy time...
sha256sum -c MANIFEST.sha256 || { echo "model artefacts changed; refusing to deploy"; exit 1; }

4. Control data

  • Version datasets and record their sources and licences.
  • Restrict write access to training and retrieval data.
  • Validate new data before it enters training, and watch for anomalies that could indicate poisoning.

5. Control packages

  • Install through an internal package proxy with pinned, hashed dependencies.
  • Verify that packages suggested by AI assistants exist, are maintained and are the ones you intended.
  • Delay brand-new package versions from public registries before they can be used in builds.

6. Protect notebooks and secrets

  • Use short-lived credentials for data access, not keys pasted into notebooks.
  • Scan notebooks and repositories for secrets.
  • Run notebook environments with least privilege and without production access.

The bottom line

AI and ML systems bring the full software supply chain with them, plus models, datasets and a young ecosystem of research tools now running in production. Inventory it with an AI-BOM, secure ML platforms like production systems, sign and verify models, control data and packages, and protect the notebooks where so much ML work happens.

Our application security testing and cloud security audits include ML platform and AI supply-chain reviews.

EthicalHat Research

The EthicalHat research team: penetration testers, SOC analysts and engineers writing about security, software engineering and AI.

Want an expert opinion on your own systems?

Email info@ethicalhat.com or call +1-844-838-4422. Our security engineers are happy to talk it through.