Compromised Package Playbook
A package you use was compromised: what now?
When a trusted package ships a malicious release, speed matters more than anything. This playbook walks through the steps in order, using a real attack from Nov 17, 2026 as the example, and shows where Veracode can help at each step.
The example: Microsoft Agent Framework on PyPI
On Nov 17, 2026, two malicious releases of Microsoft's agent-framework Python package were published to PyPI. Times below are UTC, from Wiz's analysis.
| Time (UTC) | What happened |
|---|---|
| Nov 12, 18:25 | Legitimate 1.26.0 released |
| Nov 17, 20:35 | Malicious 1.26.1 published |
| Nov 17, about 21:08 | Malicious 1.26.2 published |
| Nov 17, about 21:30 | Both malicious versions gone from PyPI |
What made it dangerous:
- It ran without being imported. Each release dropped a
.pthfile into site-packages, which Python runs on every interpreter start. Any Python process in that environment ran the stealer. - It went after credentials. It collected secrets from environment variables, other processes, and config files for Azure, AWS, GitHub, Docker, npm, pip, git and Hugging Face. It also requested Azure managed identity tokens, and 1.26.2 added GitHub Actions OIDC tokens.
- The app kept working. Both releases still depended on the real
agent-framework-core1.26.0, so nothing looked broken. - The attacker came back. After PyPI quarantined 1.26.1, a repacked 1.26.2 with different file names appeared within minutes, per BleepingComputer. Searching only for the first version's files would miss it.
The safe version is 1.26.0. Full indicators, including file hashes and the exfiltration endpoint, are in the Wiz and Socket write-ups.
Step 1: Contain it in the first hour
The goal is to stop new installs and stop the payload from running again.
- Pin the last safe version. In every requirements file, lockfile and image build, pin to the last known-good release (1.26.0 in the example) and remove the bad versions.
- Block the bad versions at the door. If you use Veracode Package Firewall, check that your policy blocks the compromised versions. Open Policies > Firewall, pick your firewall, and look the package up on the Activity and Downloads tabs to see what was requested and what was blocked (Review firewall activity). If the policy hasn't caught a bad version yet, create a custom policy to block it.
- Stop using affected environments. Don't run Python or pip in an environment that may have the bad version until it's rebuilt. In the example, any Python process started there ran the stealer.
- Pause risky pipelines. Hold CI jobs that install the package, especially jobs with cloud credentials or OIDC token permissions, until they're pinned and rebuilt.
Step 2: Find every place it landed
You need two answers: which projects depend on the package, and which machines actually installed a bad version during the window.
Which projects use it. Veracode SCA lists the open-source libraries in each project, including transitive ones. In the Veracode Platform, go to Scans & Analysis > Software Composition Analysis > Agent-Based Scan, pick a workspace, and open Libraries (Manage SCA issues and findings). To check every workspace at once, search for the library on the Workspace Portfolio page, then drill down into the workspaces and projects that use it (Manage SCA workspaces).
Which builds pulled a bad version. Check what was actually installed, not just what the manifest allows:
- Lockfiles, CI logs, virtual environments and container images built in the window
- Package Firewall's Downloads tab, which logs specific versions downloaded through the firewall
- For the example: the
.pthand.pyfiles each version dropped (agent_framework_meta.pthandagent_framework_meta/_telemetry.pyfor 1.26.1,af_runtime_diag.pthandaf_runtime_diag.pyfor 1.26.2) in site-packages
Whether data left. Search proxy and DNS logs for the exfiltration endpoint in the published indicators. Wiz notes that a blocked request is not the same as a completed one, so check the response codes.
Check related packages. With Software Supply Chain Intelligence (SSCI), you can look up packages by package URL (purl) through the package reputation endpoint, which returns malware status, suspicious behavior, vulnerabilities and license data. Your API credentials need SSCI access.
Step 3: Rotate secrets and clean up
Assume anything the package could reach is exposed. Removing the package does not undo what it already sent.
- Rebuild, don't patch. Rebuild affected environments, images and runners from a clean state with the safe version pinned.
- Rotate every reachable credential. In the example that means environment secrets, cloud CLI sessions, CI and DevOps tokens, package registry tokens (npm, PyPI, Docker, Hugging Face), and git credentials on any affected host or runner.
- Treat CI identity tokens as stolen. For 1.26.2, Wiz advises treating GitHub Actions OIDC tokens from workflows that installed it with
id-token: writeas exposed, and reviewing the cloud identities they could reach. - Review cloud sign-in and activity logs for the identities that were reachable. Stolen tokens can stay valid for hours after the package is gone.
- Tell people. Let affected teams know what ran where, and keep a short timeline for your incident record.
Step 4: Fix it properly and prevent the next one
Route installs through Package Firewall. The best time to stop a malicious release is before anyone installs it. Package Firewall checks packages against your policy at install time, so a new release with malware indicators is blocked instead of downloaded. For PyPI with pip, the docs show this setup (Integrate with package managers):
pip config set global.index-url https://:<FIREWALL_TOKEN>@pypi.firewall.veracode.com/simple/
The same page covers Poetry and npm, and you can also connect Artifactory, Nexus or Azure Artifacts instead. Keep your token out of your shell history.
Don't take brand-new releases blindly. Both malicious versions in the example were live for less than an hour. A rule that holds back very new versions would have kept them out. Package Firewall doesn't do this by default, but you can build it with a custom policy.
Keep dependency upgrades moving. Pinning back is the right fix for a malicious release, but old pins pile up vulnerabilities. Veracode Fix for SCA finds safe upgrade paths for vulnerable dependencies and updates your code for breaking API changes, so moving forward later is less work (Veracode Fix for SCA). It is in Limited Availability for specific customers.
Watch the feed. SSCI's threat feed endpoint returns a researcher-reviewed list of known malicious packages that you can pull into your own alerting. For a human-readable version, follow the Daily Threat Intel Brief in Product & Security Tips.
Limit what installs can steal. Give CI jobs only the secrets and token permissions they need, so a bad package in one job can't reach everything.
The one-page checklist
| Step | Do this | Where Veracode helps |
|---|---|---|
| Contain | Pin the last safe version, block the bad ones, stop using affected environments, pause risky CI jobs | Package Firewall: policy blocking, Activity and Downloads logs |
| Find | List projects that depend on it, find builds that installed a bad version, check for data leaving | SCA: library inventory per workspace. Package Firewall: download log. SSCI: package reputation lookup |
| Clean up | Rebuild from clean, rotate every reachable credential, review cloud identity logs | (Your own incident process) |
| Prevent | Route installs through a firewall, hold back brand-new releases, keep upgrades moving, watch the feed | Package Firewall, Fix for SCA, SSCI threat feed |
Have you had to run this playbook for real? Tell us in the comments what you'd add.
.png)