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.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.