Dev.to AI πŸ€– Ai πŸ‘ 2 πŸ“– 3 min read

Learning Experience on AI Security(6) - AI Supply Chain Attack Vectors

AI Supply Chain Attack Vectors Reading the evidence before trusting a model, package, or provider Illustrative practitioner walkthroughs based on the attachment What a model file can carry Serialisation saves an objec

AI Supply Chain Attack Vectors
Reading the evidence before trusting a model, package, or provider

Illustrative practitioner walkthroughs based on the attachment

What a model file can carry

Serialisation saves an object to disk, and deserialisation reconstructs it later, which is how teams can reuse a trained model without training it again. In the attachment’s harmless pickle example, the saved object is just a dictionary of weights and a bias, but the same file extension can also be used for objects with executable reconstruction instructons.

A risky pickle can execute code during loading, so a file name, size, or generic file-type result tells us little about what it will do. In the TryTrainMe investigation, both code-review files appeared as generic data, and I’d use pickletools to inspect them without loading either, keeping the original files available as evidnce.

Static inspection means examining a file without running it, and its findings still need context. In the sample comparison, both files contain a STACK_GLOBAL operation, but the known-good file refers to a model class while the suspicious one points to an operating-system function, a difference that explains the unsafe verdcit better than the operation name alone.

A model’s architecture defines how it processes inputs, so custom layers also deserve review even when the file format avoids pickle. In a Keras review, I’d inspect the Lambda layers as part of the prediction path, while a review of a quantised GGUF model would also trace who prepared its weights and check for unexpected model behavour.

Follow the package and the publisher

Dependency confusion happens when a package resolver selects an unintended source for a package name, and typosquatting uses names that resemble familiar dependencies. In the source’s requirements sample, I’d compare the misspelled NumPy and Requests entries and the unexpectedly high internal-package version with the known-good list before installing anythng.

Model repositories offer useful provenance clues, including the publisher’s history, the model card, and the files it makes available. In the TryTrainMe case, the convincing organisation name helped sell the download, so I’d compare the account and artefact with the expected publisher and remember that even an established account can lose control of its credentails.

The attachment’s investigation brings together a compromised model file, a lookalike publisher, and a suspicious dependency. When reconstructing that incident, I’d place the download, package evidence, and outbound-connection alert on the same timeline so finding one route into the system does not end the investgation.

What changes with a hosted model

A hosted API can keep the same endpoint while the model behind it changes, so version identifiers and a fixed test set help teams detect drift. In the code-review example, I’d compare old and new decisions on the same security-sensitive changes because an unchanged URL provides no evidence that the reviewer’s judgement is unchagned.

An API key is a credential that can be exposed in source code or build logs. In a review of the deployment pipeline, I’d look for a secrets manager, a rotation path, and per-key limits or spending alerts so unusual use is easier to detcet and contain.

A shared prompt template can change a hosted application’s behaviour even when its model stays the same. In the TryAssist sample, the routine README approval gave little away, while the missing human sign-off for an authentication change pointed back to the updated template and its unreviewed policiy.

Upstream training data can introduce a persistent bias that an API customer has no model file to inspect. In the source’s security-review example, I’d compare decisions against known cases and keep human review for high-stakes changes, since a fluent explanation can still understate the severty of a finding.

πŸ“° Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.