Skip to main content

Supply Chain Attack Vectors

Learn how trusted ML components can be turned into attack vectors.

Task 1: Introduction

Task 2: Malicious Model Files

Task 3: Investigating a Malicious Model

Task 4: Dependency Confusion Attacks

Task 5: Model Repository Attacks

Task 6: When Vectors Combine

Task 7: API Provider Compromise

Task 8: Hands-On: Prompt Template Compromise

Task 9: Conclusion

Back to all walkthroughs
Room Icon

Supply Chain Attack Vectors

Premium room

Learn how trusted ML components can be turned into attack vectors.

medium

60 min

6,265

User profile photo.
User profile photo.

To access material, start machines and answer questions login.

In the Understanding Supply Chains room, you learned about the JFrog researchers who discovered approximately 100 malicious models on Hugging Face. Now you are about to investigate one yourself.

Yesterday, the CEO at TryTrainMe received an alarming email:

Subject: Your systems have been compromised! We've had access to your servers for 3 weeks through your "AI-powered" code reviewer. Check your model loading code. You might want to scan those "harmless" .pkl files you downloaded. – A concerned security researcher

Your security team has been called in. You will investigate four major attack vectors: malicious model serialisation (pickle), dependency confusion, model repository manipulation, and API provider compromise. Starting with a suspicious model file on the lab VM, you will trace how attackers exploit every layer of the AI supply chain.

Learning Objectives

  • Explain how Python's pickle serialisation enables arbitrary code execution through the __reduce__ method
  • Investigate a malicious model file using safe analysis techniques (pickletools)
  • Describe how and attacks compromise package installations
  • Identify the warning signs of a compromised model repository
  • Recognise the attack vectors specific to -consumed models: silent updates, key compromise, and prompt template injection.

Prerequisites

Answer the questions below

I'm ready to investigate!