[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"$farcPxmT1O2L2c01Aefa-uzkd5yxVWP3OUJ0qQuRXb9Y":3},{"lesson":4},{"id":5,"slug":6,"article_id":7,"title":8,"body":9,"prevention":10,"framework_refs":11,"framework_notes":17,"status":23,"created_at":24,"published_at":25,"article":26,"tags":30,"podcasts":43,"controls":44},"ecae9457-34c2-492b-8efd-ba92459af30f","compromised-pypi-package-steals-cloud-credentials-via-python-startup-hooks","639904cd-8cb2-4399-b8e9-ae361f82a22f","Compromised PyPI Package Steals Cloud Credentials via Python Startup Hooks","The Microsoft agent-framework PyPI package was tampered with in versions 1.26.1 and 1.26.2, introducing malicious Python startup hooks that silently harvested credentials, environment variables, and cloud identity tokens (including Azure and GitHub Actions OIDC) and exfiltrated them to an attacker-controlled webhook. This is a classic software supply chain attack: developers who installed these versions unknowingly granted attackers access to sensitive secrets baked into their environments. The impact is especially severe in CI\u002FCD pipelines and cloud workloads, where stolen OIDC tokens can be used to impersonate services and access cloud resources without passwords. Organizations that do not pin dependency versions or verify package integrity are particularly exposed, as updates can silently introduce malicious code. This incident underscores that trusting a package's name or publisher history is not sufficient—continuous integrity verification of third-party dependencies is essential.","**Immediate actions:**\n- Audit all environments for installed versions 1.26.1 and 1.26.2 of the Microsoft agent-framework PyPI package and upgrade or remove them immediately.\n- Rotate all credentials, cloud identity tokens, and secrets (including Azure service principals and GitHub Actions OIDC configurations) that may have been present in affected environments.\n- Scan CI\u002FCD pipeline logs for outbound connections to webhook.site or other unexpected external endpoints.\n\n**Long-term improvements:**\n- Pin all third-party Python dependencies to verified, specific versions and use hash-based integrity checks (e.g., pip's `--require-hashes` flag) in production and CI\u002FCD pipelines.\n- Implement a private package mirror or proxy (e.g., Artifactory, AWS CodeArtifact) to vet and control which PyPI packages are allowed in your environment.\n- Adopt a software composition analysis (SCA) tool to continuously monitor third-party dependencies for known-malicious or newly compromised packages.\n\n**Detection measures:**\n- Monitor for unexpected outbound network connections from build and runtime environments, especially to generic webhook or data-collection services.\n- Alert on any process that reads cloud metadata endpoints, OIDC token URLs, or credential files in combination with outbound HTTP requests to non-approved destinations.\n- Enforce least-privilege access for CI\u002FCD pipeline identities so that stolen OIDC tokens have minimal blast radius if exfiltrated.",[12,13,14,15,16],"CIS Control 2: Inventory and Control of Software Assets (v8)","NIST SP 800-53 SA-12: Supply Chain Protection","NIST CSF 2.0 DE.CM-01: Networks and network services are monitored to find potentially adverse events","NIS2 Article 21(2)(d)","MITRE ATT&CK T1195.001: Supply Chain Compromise: Compromise Software Dependencies and Development Tools",{"NIS2 Article 21(2)(d)":18,"NIST SP 800-53 SA-12: Supply Chain Protection":19,"CIS Control 2: Inventory and Control of Software Assets (v8)":20,"NIST CSF 2.0 DE.CM-01: Networks and network services are monitored to find potentially adverse events":21,"MITRE ATT&CK T1195.001: Supply Chain Compromise: Compromise Software Dependencies and Development Tools":22},"NIS2 Article 21(2)(d) requires security measures covering supply chain risks, including the security of relationships with direct suppliers such as open-source package repositories.","SA-12 specifically requires organizations to assess and protect against supply chain risks, including verifying the integrity of software obtained from third-party sources like PyPI.","CIS Control 2 requires maintaining an inventory of authorized software and preventing use of unauthorized or unvetted packages, which would have flagged the tampered PyPI versions before installation.","Continuous monitoring of outbound network traffic from build and runtime environments would have detected the credential exfiltration to the attacker-controlled webhook.site endpoint.","This technique describes exactly what occurred: adversaries inserted malicious code into a widely used package distributed via a public repository to compromise downstream consumers.","published","2026-11-18T00:20:27.346036+00:00","2026-11-18T00:20:27.334+00:00",{"id":7,"url":27,"slug":28,"title":29},"https:\u002F\u002Fsocket.dev\u002Fblog\u002Fagent-framework-pypi-package-compromised-with-credential-stealer?utm_medium=feed","microsoft-s-agent-framework-pypi-package-compromised-with-credential-stealer-379e63","Microsoft’s agent-framework PyPI package Compromised with Credential Stealer",[31,37],{"id":32,"name":33,"slug":34,"description":35,"color":36},"1ec88fde-2d0f-4ed8-932a-33f5ccc0fdc7","Access Control","access-control","Excessive privileges, missing MFA, weak auth","#f97316",{"id":38,"name":39,"slug":40,"description":41,"color":42},"f0c2a0af-58aa-4128-87c9-6acd30f2dc48","Supply Chain","supply-chain","Third-party risk, compromised dependencies","#8b5cf6",[],[45,49,53],{"slug":46,"name":47,"problem":48},"secrets-management","Secrets management","API keys, tokens and passwords stop leaking from code, chat and configuration files.",{"slug":50,"name":51,"problem":52},"threat-intelligence","Threat intelligence","Attack campaigns reach your sector, suppliers or software before your team hears about them.",{"slug":54,"name":55,"problem":56},"software-supply-chain","Software supply chain security","Malicious and vulnerable open-source packages are caught before they ship."]