Back to all lessons
Awareness Lessons
4 days ago

Malicious PyPI Package Steals Azure and CI Credentials via Supply Chain Attack

Written by AI from the linked story. Not reviewed by an editor. How this works

Attackers published trojanized versions of the Microsoft agent-framework Python package to PyPI, embedding a credential stealer that silently harvested Azure tokens, OIDC tokens, and CI pipeline secrets from environment variables and credential files. This is a classic software supply chain attack where developers or automated pipelines unknowingly install a malicious dependency, granting attackers access to cloud infrastructure without any direct breach of target systems. The stolen credentials — particularly Azure DevOps and OIDC tokens — could enable lateral movement, privilege escalation, and full cloud account takeover. This incident highlights how unpinned or unverified dependencies in CI/CD pipelines represent a critical and often underestimated attack surface. Rapid quarantine limited the blast radius, but any pipeline that consumed these versions before detection may already be compromised.

Tactical Insight

Immediate actions

  • Audit all projects and CI/CD pipelines for use of agent-framework versions 1.26.1 or 1.26.2 and downgrade or replace immediately.
  • Rotate all Azure tokens, OIDC tokens, DevOps credentials, and any secrets present in environments that consumed the affected versions.
  • Scan environment variables and credential files in affected build agents for signs of exfiltration to external webhook endpoints.

Long-term improvements

  • Pin all third-party dependencies to specific, verified checksums or hashes and enforce this policy via dependency lockfiles in every project.
  • Implement a private package registry or artifact proxy that vets and mirrors approved packages before they reach CI/CD pipelines.
  • Restrict CI/CD pipeline permissions to the minimum required scope and avoid persisting long-lived credentials in environment variables.

Detection measures

  • Deploy software composition analysis (SCA) tools in CI pipelines to flag newly published or recently modified package versions before installation.
  • Monitor outbound network traffic from build agents for unexpected connections to external services such as webhook.site or similar exfiltration endpoints.
  • Alert on anomalous access patterns for Azure and Azure DevOps tokens, including usage from unfamiliar IP addresses or at unusual times.

Back this up with a control

All controls and vendors

Training helps people spot this. These controls make the attack fail even on the day someone does not.