The Package That Ran Without Import
Show notes
What the episode covers
Microsoft's agent-framework versions 1.26.1 and 1.26.2 were hijacked on PyPI on November 17 and shipped a .pth startup hook that targeted Azure, CI and AI credentials without the package ever being imported.
- How .pth files execute at interpreter start, and why "did we import it" is the wrong incident question
- The exposure window between release and quarantine, and what logs can answer
- Related agent-focused attacks: Bitdefender's 22 poisoned GitHub links, the Claude Code settings.json backdoor (SOMBERMEME) reported by Google GTIG, and the Miasma RubyGem worm
- Detections that still work after identity checks pass, plus Monday-morning blast-radius triage
The practical takeaway: treat agent configuration and dependencies as one trust surface, watch for new .pth files, agent settings edits and mismatched runner credential use, and rotate every reachable secret if a bad version was installed.
Timeline
In this episode
8 moments worth skipping to. The timecodes match the player above.
- 0:15Introduction
- 2:01The Kill Chain: A .pth File Does Not Need You
- 4:50Who Noticed, and What Window Was Open
- 7:0122 Poisoned Links Aimed at Coding Agents
- 9:35The Turn: settings.json and Miasma
- 13:17What to Detect After the Check Passes
- 15:38Monday Morning: Blast-Radius Triage
- 17:56Outro
Quick answers
Straight from the episode
The questions this one settles, without the listen.
- Why is asking whether you imported the malicious Python package the wrong incident question?
- The package used .pth files, whose lines run on every interpreter start, including pip itself. The payload can execute without any import, so the useful question is which Python processes started on a host while the bad versions were installed.
- How long was the malicious package version live before it was quarantined?
- Version 1.26.1 went live at 20:35 UTC and was quarantined at 21:06 UTC. Elastic's monitor flagged it behaviorally at 20:41 UTC, six minutes after publication. The package sees about 40,000 weekly downloads per JFrog, which shows audience size rather than a count of victims.
- How are attackers targeting AI coding agents through config files?
- Bitdefender Labs found 22 malicious GitHub links so far, built to make AI dev tools run a hidden payload by abusing the rules, hooks and configurations the tools read. GTIG also reported edits to .claude/settings.json that made launching Claude Code fetch SOMBERMEME, turning a settings file into quiet persistence.
- What should I detect after a package or repo passes identity checks?
- Max proposed three detections, which are his suggestions rather than source findings: new or changed .pth files in site-packages against a baseline, edits to agent settings files and MCP entries, and build-runner credential use that does not match the job. Stolen tokens must eventually be spent, and that spending leaves a log line.
- Does pinning and hashing dependencies protect against a hijacked release?
- Pinning stops drift but not a deliberately chosen hijacked release. Reviewing each version bump is still worth the friction.
- What should I do on Monday morning after a compromise like this?
- Follow JFrog's guidance and treat every reachable secret as compromised. Find the hosts, containers and runners that installed the bad versions, rotate Azure, Azure DevOps and GitHub Actions tokens from a clean machine, and audit agent config files and their recent authors. Keep a written record of hosts, images and tokens rotated.
Transcript
The full conversation
Every word of the episode, 3,122 of them, in the order they were said.
Read the transcriptHide the transcript
DerekShort pause. Short pause. A Python package version landed on PyPI on November 17th, and every check you own would've waved it through: correct publisher, correct name, correct project. It still ran its code before you typed a single line. Okay, but the import. Nothing runs until something imports it, right? That's the whole safety net. Wow, such a lovely theory. Oh, no. Microsoft's Agent Framework versions one point two six one and one point two six, two hijacked releases carrying a PTH startup hook that went after Azure, CI, and AI credentials. The code never had to be imported. Never? Not even once? Not once. Import is optional. So the lock was on the front door, and the attacker moved into the doorframe. Welcome to Autonomous Autopsy. I'm Derek, and that's Max, who now has to rethink his whole threat model. Oh, already crying. Thanks. But this can't be the only case, can it? Nobody opens a show with a lone anecdote. It isn't. We're lining it up with Bitdefender's 22 poisoned GitHub links aimed at coding agents, a Claude code settings.json backdoor from Google GTIG's findings, and the Miasma RubyGem worm. So different doors into the same house. The agent's config layer and its dependency tree start to look like one attack surface, and the question isn't whether it was the package we meant. It was. Everything said yes. What do you detect after yes? That's the case file, and it starts with a file that fires at startup, not at import. Let's reconstruct exactly how a hook like that gets to run. Okay, so get this. The mechanism is almost boring. Python has these .pth files that sit in site-packages, and any line in one that starts with import gets executed when the interpreter starts. Starts, not when your code asks for it. Right. The Hacker News relayed Endor Labs' point that those lines run on every interpreter start, pip included, whether the package is ever imported. Right, pip included, so installing the next thing triggers it? Pip launching is a Python launch. The hook fires. Oh, man, so the package doesn't need an invitation. It just needs a seat in the building. And Python never asks whether you meant to start it. The interpreter starts, the line runs. Your intent doesn't enter into it. Which makes did we import it the wrong question to ask in an incident. And it picked two seats. The Hacker News names the files agentframework-meta.pth and afruntime-dig.pth. Those names are lovely. Meta, runtime dig. That's a file you scroll past while looking for something scary. Exactly the point. Boring names, boring location. Two releases too, published 33 minutes apart on November 17th per the Hacker News. Two shots, same trick. Okay, but a swapped package usually breaks something. Somebody notices the app throwing errors, files a ticket, game over for the attacker. JFrog's analysis says no. The attacker left the agent framework core dependency pin untouched, so the framework kept working without errors. Hold on. So the real code runs, the tests are green, and the stealer rides along? Yep, and JFrog adds the payload used no encryption, no System D persistence, and no worm propagation. Huh, that's almost insulting. No fancy tricks at all. Which tells you the startup hook was doing all the work. It didn't need to hide because nobody was looking at that spot. So the defender's problem is that the boring version is the one that works. Nobody builds an alert for nothing unusual happened. Right. Everything looked like a normal install, and the only odd thing was a file that fires at startup. Fine. So what's it grabbing? Because credentials is a mushy word. Elastic's writeup is specific. The stealer took Azure tokens, Azure DevOps tokens, and GitHub Actions tokens. Dude, the cloud, the pipeline, and the thing that builds your code. That's the whole supply line in three words. And think about where this lands. A developer laptop, sure, but also a CI runner that installs dependencies fresh on every build. Which is a Python launch, which fires the hook, which sits next to a runner full of secrets. Mm, that's the whole design. Ride along on a launch nobody questions and take what the environment is holding. Okay, I hate it. So that's the how, now the blast radius and how fast anyone noticed. Okay, so the blast radius. The package pulls roughly 40,000 downloads a week per JFrog's research team. 40,000. That's a stadium of people who might run pip on a Tuesday. Careful, though. That's weekly downloads for the package, not a count of who ran the bad version. It tells you the size of the audience, not the size of the damage. So it's context, not a casualty count. And the first bad release went live at 20:35 UTC. It got quarantined at 21:06. Hold on, 31 minutes? 31 minutes. That's not long, unless your CI runner kicks off a nightly build in exactly that window, then it's forever. Right, and that's why the quarantine time isn't the number I care about. Who noticed and how is the number. Okay, go on. Elastic wrote that its supply chain monitor flagged one point two six point one at 20:47 UTC, six minutes after it went live. Six minutes? Wow. And Elastic says it caught it behaviorally. Not a signature, not a known bad hash. It watched what the release did. Which is the whole point of this episode, isn't it? The name was right. The publisher account was right. Every check asking, "Is this the package I meant?" said yes. The package was exactly who it said it was. It just had a side hustle. A side hustle in your cloud tokens. But here's my question: six minutes to flag, thirty-one to quarantine. Who's in the gap? Anybody whose build ran in those twenty-five minutes, and I'd bet most teams wouldn't know whether theirs did. Mm. So it's a short window and a trail you only have if you were already keeping it. Nobody turns that logging on after the fact. Right. So what about the front door? How did the attacker even get publish access? Nobody knows. The Hacker News says it's unclear, and both versions are quarantined now. Huh. So we know the what and the when, and the how they got in is still a blank. A blank that matters because it decides whether this is one stolen login or a hole in how the project ships. Fair. That was the dependency tree. Now the same trick aimed at the config layer where the agent keeps its instructions. Nothing in there even looks like code. Okay, so get this: Bitdefender Labs says it has uncovered a malware campaign that uses compromised GitHub content to go after developers working with AI-assisted coding tools. Compromised GitHub content, so a repo with a bad script in it. Old news. That's what I figured too. Wait for it. Oh, no. So, so far, a Bitdefender Labs researcher named Andrei Anton-Aanei has identified twenty-two malicious GitHub links. Each one holds files designed to make AI-assisted development tools execute a concealed payload. Twenty-two, that's a small number. Small number, and the post says, "So far." That's Bitdefender's wording, so the count is a floor, not a final tally. Fair. And the payload runs through the tool, not through the developer. The files are built to make the tool run it, and that's the part that matters. The campaign goes beyond a malicious script hidden in a repository. Meaning what exactly? The post describes it as abusing the files, rules, hooks, and configurations that AI coding tools use to understand a project, the stuff the agent reads to figure out where it is and how to behave. Huh. So the repo isn't hiding a trap, the repo is briefing the agent. Briefing the agent with a very helpful, very poisoned onboarding doc. Okay, but Derek, now I wanna pressure test this because I can't find the signal. Walk me through it. The repo looks fine. Looks fine. The config file is the kind of file the tool is supposed to read. The agent reads it, does what it was told, and that is literally its job. So where's my alert? Yeah, that's the uncomfortable part. Nothing is misbehaving. The agent is being a very obedient employee. Right, and a hash check says the file is the file. Provenance says the repo is the repo. Every question we normally ask about who made this comes back clean. So what's left? Only what happens next. What did the agent launch? What did it reach for and from which folder? That's the only place the lie shows up. Which is a different job than scanning the repo. Completely different. You're watching the agent's behavior, not the repo's reputation. The question stops being who wrote this file and becomes what the agent did right after reading it. Two incidents now, same pattern. The trusted thing carries the payload, and the check that would stop it never fires. And the next one's nastier because there the config file wasn't just the way in, it was where the thing lived. Hold that thought because it's a good one. Okay, so the config file is a persistence mechanism. Help Net Security reported on Google GTIG's AI Threat Tracker, and the attackers there did not need a clever exploit at the end. Meaning they were already inside? Already inside. After the intrusion, they moved into internal repositories and edited .Claude.settings.json, then launching Claude Code downloaded the Somber Meme backdoor. Wait, the developer just opens their tool? That's the whole trigger. Open the tool, fetch the backdoor. So the settings file is a startup script with better PR. Right? And nobody reviews it like a startup script. It's a config tweak in a pull request. Dude, it's checked into the repo. It looks like team preference. And a reviewer skimming a diff for logic bugs slides right past it. It doesn't look like code, so it doesn't get read like code. Compare that to the package case. There, the attacker had to get a release published. Here, they were already inside, so they picked a quieter home, a file the tool trusts the moment it launches. There's a smaller detail I love in a grim way. They named their GitHub personal access tokens after Microsoft Copilot. No. Yes. For blending in during lateral movement. Oh, man, that's a great disguise right now. Nobody audits a token called Copilot. Picture scrolling a list of tokens. Something named Copilot, your eyes slide right over it because it's the one name everybody assumes belongs. So it's social engineering aimed at the person doing the audit, not at the system. Which brings us to Miasma. Security Joe's describes it as a Mini Shai-Hulud variant attributed to TeamPCP. And it's a worm, so it doesn't stay in one place. It spreads through poisoned NPM packages. It spreads through RubyGems using a fake native extension with an extconf.rb. Hold on. extconf.rb is the file that's supposed to build a native extension. Exactly. So the gem install runs attacker code before anyone loads anything. Same shape as the PTH file. The trigger is the install, not the import. Plus GitHub Actions releases, and then IDE or AI agent config files that auto-execute in Cursor, Claude Code, Gemini CLI, or VSCode. Four tools, one trick: open the folder, run the file. Notice the worm isn't loyal to one layer. Package registries, release pipelines, and editor config get the same treatment. Who's TeamPCP, though? Can we say more? Only what Security Joe says, a variant of Mini Shai-Hulud attributed to them. I'm not gonna dress that up with more. Fair. Keep it to what's on the page. Now, a timeline correction because it's tempting to stack Miasma on November seventeen. Security Joe's dates the Microsoft GitHub repo hit to June fifth, twenty twenty-sixth, not November. So it's a different event entirely, months apart and the same door. Right. And the date matters. Stack it on November seventeenth and you go looking in the wrong window, then tell your boss a story the sources don't back up. Two events, one pattern. I can live with that. And that pattern is the turn. The hijacked package passed the check that asks, "Is this the package I meant?" Yes, it was. The config layer and the dependency tree are one trust surface, and the agent obeys both. Different files, same obedience. Hold onto that because it changes what you'd even look for. Okay, Max, you've been sitting on a list. What do you actually watch? Three things, and I wanna be clear these are my proposals, not something any of the write-ups handed us. First, new or changed .pth files in site packages. Almost nothing legitimate drops one after install day. Almost nothing? Almost. A few packages ship them on purpose, so you baseline what's there today and alert on the delta. Fair. Number two? Edits to agent settings files and MCP entries. If a .claude.settings.json changes and nobody on your team made a commit that touched it, somebody wants to know about that. And an MCP entry is just a line of text that says, "Run this thing." Exactly. Quiet, tiny, and it executes with the agent's permissions. Third one is my favorite: credential use from build runners that doesn't match the job. Meaning? Your runner exists to build one repo and push one artifact. If its token suddenly lists other repos or logs in from somewhere the runner never lives, that's your tell. The job's shape is the fingerprint. Oh, I like that. The thief has to use the stolen token eventually, and it never acts like the job. Right. The stealth can be invisible. The spending isn't. Every stolen token has to be spent somewhere, and that's where you get a log line. Give me a concrete one. Say a runner that builds one repo suddenly authenticates to Azure DevOps and starts listing projects it has never touched. That's an alert I'd write, and it fires even if every package hash matched. Okay, but I'm gonna be the annoying one. Why not pin everything and hash everything? Lock files require hashes. Done. Nothing new gets in. It helps. Pinning stops drift. Nobody's laptop quietly floats to a new version on a Tuesday. But? But you pin to version you chose. If the version you deliberately bumped to is the hijacked one, the hash matches. It's a perfect hash of the wrong thing. Ouch. So the pin proves you got what the registry served. And nothing about whether the registry should have served it. Hmm, so the pin is a seat belt, not a crystal ball. What breaks if we do it anyway? Updates get slower and somebody has to review bumps. Which is good, honestly, because that review is where you'd look at what changed in the new release, including any new startup hooks. Annoying, but cheap next to rotating every cloud secret you own. Dramatically cheaper. All right, enough theory. Now what you can do Monday. Okay, Monday, coffee in hand. Somebody in your org ran pip install on a machine last week. Where do you even start? With JFrog's research on the hijack. Their advice is blunt: treat every secret reachable from an affected host, container, or runner as compromised. Every secret, not just the ones the stealer was shopping for. Right. You can't prove what it skipped, so you assume it took the lot. Elastic's write-up lands in the same place and says to assume every secret on an affected host is gone. Ouch. That's a lot of rotating. Yeah. So step one is a hunt. Find any machine that installed one point two six point one or one point two six point two. And that's more than laptops, right? Build runners, containers somebody baked last Tuesday and forgot about. Especially those. A container image that pulled the bad release carries it forever, quietly, until somebody rebuilds it. Dude, so you're hunting through image layers on a Monday. Welcome to the job. Step two, once you've got your list, rotate the tokens reachable from each machine. Azure first. Then Azure DevOps. Then GitHub Actions. Those are the three the stealer went after, so those get rotated before anything else. Wait, order matters or is it just whatever's fastest? Whichever hands the attacker the most reach goes first. And rotate from a clean machine. If you rotate from the infected box, you're handing the new token to the same thief. Oh, that's the kind of mistake that happens at eight AM with no coffee. Exactly why it goes on the list. Okay, step three: config files. Open the agent config in your repos. Settings files, rules files, MCP entries, anything that tells a tool what to run when somebody opens the folder. Read them like code because to the agent they are. And who changed them. Git blame on a settings file nobody's touched in months is a fun morning. Fun is a strong word, but a recent edit from an author nobody recognizes is exactly what you're hunting for. And write down what you find as you go. Hosts, images, tokens rotated. The next question from your boss is going to be what exactly you touched. Which is why the list matters more than the heroism. Hosts, images, tokens rotated, and who did what. Fair. Okay. That's the triage. One last thing, then we're out. Hmm. So the through line, every trusted name passed, the package, the repo, the config file, all looked like exactly what we meant, which leaves behavior as the only thing left to watch. Right. So hijacked release, poisoned link, edited settings file. Different doors, and the thing that gave each away was what it did after it got inside. Okay, so get this. One action item. Just one. Search your hosts, your CI runners, and your agent environments for .pth files you did not put there. And the settings files? Same sweep. Look for unexpected edits to your agent settings files. If you find something, you want the author and the date before lunch. Before lunch? Optimistic. I am a man of hope. New episodes land every Tuesday, so subscribe and the next one shows up on its own. And if this saved you from a bad deployment, leave a review. Tell us which file it was. Go check your site packages. Seriously, go look. Thanks for listening, everyone. We'll be back Tuesday with another case file, so keep your agents on a short leash until then.
More episodes
Keep listening
Other episodes of Autonomous Autopsy, newest first.
- Agent 365 Still Has Blind SpotsNov 17, 2026 · 20 min
- The Intern Who Only Heard Go OnNov 10, 2026 · 20 min
- Shadow Agents Get a BadgeNov 3, 2026 · 20 min
- The AGENTS.md That Stole KeysOct 27, 2026 · 19 min
Sources
Where this came from
6 reports behind the episode. Every one of them opens where it was published.
- Attackers Compromise Microsoft's Agent Framework PyPI Package to Steal Cloud Credentialsthehackernews.com
- Microsoft's agent-framework Hijacked on PyPI via Silent .pth Startup Hook - JFrog Security Researchresearch.jfrog.com
- We caught the agent-framework PyPI compromise six minutes after it publishedelastic.co
- Google finds AI agent writing and launching exploits with no human in the loop - Help Net Securityhelpnetsecurity.com
- How AI Agents Become New Targets in GitHub Malware Campaignbitdefender.com
- Shai-Hulud: Miasma - When a Supply-Chain Worm Learned to Hijack AI Coding Agentsblog.securityjoes.com
