Critical unauthenticated RCE flaw in NGINX HTTP/2 handling. Get the step-by-step remediation guide to patch CVE-2026-123633 and secure your infrastructure.
Imdadullah BabuDesigned & DeveloperNGINX RCE Vulnerability: Fixing CVE-2026-123633
On November 17, 2026, two malicious versions (1.26.1 and 1.26.2) of Microsoft’s legitimate agent-framework meta-package were published to PyPI, functioning as an automated credential stealer for Python environments. This incident is not isolated; it follows a pattern of high-speed attacks on trusted registries like PyPI, npm, and Docker Hub. For businesses relying on Python-based services, a single compromised dependency can expose cloud tokens, CI/CD OIDC credentials, and AI API keys within seconds.
The velocity of these compromises has increased significantly. In earlier 2026 campaigns, such as the March 2026 TeamPCP supply chain attacks affecting LiteLLM (1.82.7 and 1.82.8) and Telnyx (4.87.1 and 4.87.2), malicious versions were live for mere hours before detection. In the agent-framework incident, Elastic Security Labs detected the compromise just six minutes after upload, and PyPI removed both malicious releases within 45 minutes. Even that brief window was enough to put CI/CD runners and developer machines at risk across a package averaging ~190,000–200,000 monthly downloads. If your team is building products with Python backends or AI integrations, understanding the mechanics of a PyPI supply chain attack is no longer optional—it is a core operational requirement.
Key takeaways
- Legitimate packages are being hijacked:
agent-frameworkwas not a newly registered typosquat; it was a compromised release of Microsoft’s official Agent Framework meta-package (1.26.1and1.26.2), proving that even trusted vendor packages can ship malicious updates. .pthhooks trigger without animport: Modern Python malware uses.pthfiles (agent_framework_meta.pthandaf_runtime_diag.pth) placed insite-packagesso the payload executes automatically every time the Python interpreter starts—even if the application never imports the library.- Cloud & CI/CD tokens are the primary target: Beyond static
.envfiles, the stealer actively queries Azure Managed Identity IMDS endpoints, requests Azure DevOps and GitHub Actions OIDC tokens, and scrapes/proc/[pid]/environacross running processes. - Locking, hashing, and secret rotation are essential: Relying on unpinned
pip installcommands without hash verification leaves build pipelines exposed to instant compromise.
Understanding the 'agent-framework' Incident
At 20:35 UTC on November 17, 2026, attackers published agent-framework version 1.26.1 to PyPI, followed 33 minutes later by version 1.26.2 after the first release was quarantined. Rather than being a fake look-alike package, agent-framework is Microsoft's official Python SDK meta-package for building AI agents.
Once installed, the malicious wheel dropped a startup hook (agent_framework_meta.pth in 1.26.1, renamed to af_runtime_diag.pth in 1.26.2) into site-packages. Because Python automatically executes code inside .pth files during interpreter initialization, the credential stealer ran silently in a background process on every Python invocation without requiring an explicit import agent_framework.
The payload harvested a broad range of developer and pipeline secrets:
- Host & Process Environment Variables: Scraped active environment variables and
/proc/[0-9]*/environentries matchingTOKEN,SECRET,PASSWORD,KEY=,SYSTEM_ACCESSTOKEN, andIDENTITY_HEADER. - Cloud & CI/CD Identity Tokens: Requested Azure Managed Identity tokens via the Instance Metadata Service (IMDS), exchanged Azure DevOps
SYSTEM_ACCESSTOKENvalues for OIDC tokens (SYSTEM_OIDCREQUESTURI), and targeted GitHub Actions OIDC tokens in1.26.2. - Local Credential & Config Files: Scanned disk locations for Azure CLI credentials, AWS credentials, GitHub tokens, Docker registry configs, Hugging Face tokens, OpenAI API keys, and
.envfiles.
Collected data was exfiltrated via HTTPS POST requests to an attacker-controlled webhook.site endpoint.
The Mechanics of a PyPI Supply Chain Attack
To defend against these threats, you must understand how they work. A typical PyPI supply chain attack follows one of two paths:
- New Malicious Package (Typosquatting / Slopsquatting): An attacker registers a new package name similar to a popular library (or matching a commonly hallucinated LLM package name) to trick developers into installing it.
- Compromised Legitimate Package: An attacker compromises a maintainer's credentials or CI/CD publishing pipeline and pushes a poisoned version of an established, widely trusted library.
The second scenario is far more dangerous because automated builds and developers routinely pull patch updates for trusted dependencies. For example, in the March 2026 TeamPCP campaign, attackers used compromised CI/CD credentials to publish poisoned versions of LiteLLM (1.82.7 and 1.82.8, the latter also abusing a litellm_init.pth startup file) and Telnyx (4.87.1 and 4.87.2). Similarly, anyone using an unpinned constraint like agent-framework>=1.26 during the 45-minute window on November 17 automatically pulled the malicious release.
Auditing and Remediating Your Python Dependencies
If your environment installed agent-framework on November 17, 2026, simply uninstalling the package is not enough—you must pin back to safe version 1.26.0, rebuild affected containers/caches, check for agent_framework_meta.pth or af_runtime_diag.pth in site-packages, and rotate every secret accessible to that host or CI runner.
To reduce your ongoing attack surface, follow this practical checklist:
1. Lock Your Dependencies with Hashes
Never install unpinned dependencies in CI/CD or production. Use uv or pip-tools to generate lock files (uv.lock or requirements.txt) that enforce cryptographic SHA-256 hash verification for every wheel and source distribution.
# Example: Using uv to lock dependencies and enforce hash verification
uv lock
uv sync --frozen --verify-hashes
If an upstream package is silently replaced or a malicious version is published, --verify-hashes (or pip install --require-hashes) halts the build immediately.
2. Restrict Outbound Network Access
Python packages should not make arbitrary outbound HTTP calls during installation or interpreter startup. Enforce strict egress filtering in your CI/CD runners and production containers so traffic is restricted to approved domains (such as pypi.org, files.pythonhosted.org, or your internal artifact proxy), blocking exfiltration endpoints like webhook.site.
3. Monitor for Anomalies and .pth Hooks in CI/CD
Audit your Python environments and build logs for suspicious activity:
- Inspect
site-packagesdirectories in container images and CI caches for unexpected.pthfiles. - Verify that PyPI releases in your dependency tree match official GitHub releases and carry PEP 740 provenance attestations.
- Use short-lived, narrowly scoped OIDC tokens in CI/CD rather than long-lived static cloud credentials, and review Entra ID, AWS CloudTrail, and GitHub audit logs for anomalous token exchanges.
Implementing Defense in Depth
Security is not a single tool; it is a layered approach.
| Defense Layer | Tool/Method | Purpose |
|---|---|---|
| Dependency Scanning | pip-audit, OSV-Scanner, Aikido |
Identifies known malicious packages and CVEs in your dependency tree. |
| Hash Verification | uv sync --verify-hashes, pip --require-hashes |
Guarantees cryptographic file integrity against tampered releases. |
| Artifact Quarantine | Private Registry / Proxy (Artifactory, Sonatype) | Enforces a cool-down/quarantine window before newly published PyPI versions can be installed. |
| Network Egress Control | Cilium, Kubernetes NetworkPolicies, Firewall rules | Blocks unauthorized outbound connections to webhook/C2 infrastructure. |
| Secret Management | HashiCorp Vault, AWS Secrets Manager, Scoped OIDC | Eliminates static .env secrets and restricts blast radius when a runner is compromised. |
| Provenance Verification | PyPI Trusted Publishing & PEP 740 Attestations | Cryptographically verifies that a package was built from an authorized source repository workflow. |
By combining these layers, even if a malicious release slips onto a public index for a few minutes, hash pinning, private mirror quarantine windows, and network egress controls stop the payload before secrets can leave your environment.
For teams managing complex microservices or SaaS products, this level of scrutiny is critical. If you are struggling to implement these checks in your existing pipeline, we can help you integrate Service: Software Maintenance to harden your build infrastructure without disrupting your release cycle.
Frequently asked questions
What is a PyPI supply chain attack?
A PyPI supply chain attack occurs when malicious code is introduced into a Python package or one of its transitive dependencies. This happens either through typosquatting (publishing fake look-alike packages) or by compromising the publishing credentials/CI pipeline of a legitimate maintainer to push a backdoored version of a trusted library.
How do I verify if a package is compromised?
Check the PyPI release history and JSON metadata (https://pypi.org/pypi/<package>/json) for unexpected version bumps, missing PEP 740 provenance attestations, or uploads that lack a corresponding GitHub release tag. You can also run pip-audit or osv-scanner against your lock file and inspect site-packages for newly added .pth startup hooks.
Does using a virtual environment protect me?
No. A virtual environment (venv) only isolates package installation paths from system-wide Python libraries; it provides zero security sandboxing. Any .pth file or imported module inside a virtual environment runs with the full permissions of your OS user, allowing it to read environment variables, /proc memory, ~/.aws or ~/.azure credentials, and cloud metadata endpoints.
What is the role of PyPI Trusted Publishing?
PyPI Trusted Publishing uses OpenID Connect (OIDC) to bind package publishing rights directly to a specific, verified CI/CD workflow (such as GitHub Actions) instead of relying on long-lived static PyPI API tokens. While it eliminates static token theft, maintainers must still harden their CI/CD workflows against secret leaks and unauthorized workflow triggers.
How often should I audit my dependencies?
You should audit and verify hashes on every single CI/CD build, and pair automated scanners (pip-audit, osv-scanner) with a private package proxy that enforces a 24-to-72-hour quarantine period on new upstream releases—neutralizing fast-moving attacks like agent-framework that are caught and pulled within an hour.
Protect Your Build Pipeline
The landscape of Python security is shifting toward high-speed, automated credential harvesting. What was a routine pip install yesterday can execute a .pth startup stealer in seconds today. By enforcing hash-verified lock files, outbound egress filtering, and strict secret governance, you can protect your infrastructure and customer data.
If you are planning to build a new Python-based service or want to audit your existing infrastructure, we can help you set up a secure pipeline from the start.
Sources
- We caught the agent-framework PyPI compromise six minutes after it published | Elastic Security Labs
- Two malicious agent-framework releases hit PyPI in 33 minutes | Aikido Security
- Microsoft Agent Framework PyPI Compromised 2026 | Aviatrix Threat Research Center
- Incident Report: LiteLLM/Telnyx supply-chain attacks, with guidance | The Python Package Index Blog
- The Telnyx SDK on PyPI Compromise and the 2026 TeamPCP Supply Chain Attacks | Akamai Security Intelligence Group
- TeamPCP's LiteLLM Backdoor: New Data Shows 2,100+ Orgs Exposed | Cloud Security Alliance
- Weaponizing the Protectors: TeamPCP’s Multi-Stage Supply Chain Attack on Security Infrastructure | Palo Alto Networks Unit 42
- Defense in Depth: A Practical Guide to Python Supply Chain Security | Bernát Gábor
- #CVE-2026
- #Web Security
- #Risk Management
- #Security
- #Backend
- #DevOps
- #Maintenance
- #RCE
Working on something similar?
We help teams design, build and scale software like this. Tell us about your project.
Start a projectKeep reading
PyPI supply chain: 5 ways to stop dependency malware
PyPI supply chain: 5 ways to stop dependency malware
A recent PyPI incident involving a credential stealer highlights the risks of unverified dependencies. Here is how to audit your build pipeline.
By Imdadullah Babu