[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"$fKd7cGVWXsJkg_gPzq4tsN3hEoZkwe03E1uhGdU37Hgc":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},"4f15f567-3cab-4f0f-851a-75bb379bbe06","compromised-pypi-package-delivers-credential-harvesting-payload-via-python-startup-hook","9fe0a0e0-312f-4bf3-a24f-985127dd8ef2","Compromised PyPI Package Delivers Credential-Harvesting Payload via Python Startup Hook","Attackers gained publishing access to Microsoft's agent-framework PyPI package and uploaded two malicious versions containing a Python startup hook that harvests cloud and CI\u002FCD credentials without even requiring an explicit import of the package. The fact that a second malicious version was uploaded shortly after the first was quarantined reveals that the attacker retained publishing credentials throughout the incident, indicating a failure in access control revocation. This matters because developers who installed the package during the exposure window may have silently exfiltrated credentials powering their entire cloud and pipeline infrastructure. Supply chain attacks of this kind are particularly dangerous because they exploit implicit trust in legitimate, well-known packages.","**Immediate actions:**\n- Audit all environments that installed agent-framework versions 1.26.1 or 1.26.2 and rotate any cloud and CI\u002FCD credentials present on those systems\n- Remove or pin to a known-good version of the package and verify integrity via hash or lockfile before re-enabling pipelines\n\n**Access control hardening:**\n- Enforce multi-factor authentication and least-privilege publishing roles on all package registry accounts\n- Immediately revoke all publishing tokens and reissue scoped, short-lived credentials after any suspected account compromise\n\n**Long-term improvements:**\n- Implement a software composition analysis (SCA) tool in CI\u002FCD pipelines to detect newly flagged or yanked package versions before they reach production\n- Adopt a private package mirror or artifact proxy that caches approved versions and blocks unapproved upstream updates until they pass review\n- Monitor Python startup hooks and environment modifications as part of endpoint and pipeline behavioural detection",[12,13,14,15,16],"MITRE ATT&CK T1195.001: Supply Chain Compromise: Compromise Software Dependencies and Development Tools","CIS Control 16: Application Software Security (v8)","NIST SP 800-53 SR-4: Provenance","NIS2 Article 21(2)(d)","NIST CSF 2.0 ID.SC-2: Suppliers and third-party partners of information systems, components, and services are identified, prioritized, and assessed",{"NIS2 Article 21(2)(d)":18,"NIST SP 800-53 SR-4: Provenance":19,"CIS Control 16: Application Software Security (v8)":20,"MITRE ATT&CK T1195.001: Supply Chain Compromise: Compromise Software Dependencies and Development Tools":21,"NIST CSF 2.0 ID.SC-2: Suppliers and third-party partners of information systems, components, and services are identified, prioritized, and assessed":22},"NIS2 Article 21(2)(d) requires security measures addressing supply chain risks, including the security of relationships with direct suppliers such as open-source package registries.","SR-4 requires organisations to document and validate the provenance of software components and supply chain elements, which would have flagged the unexpected new releases before installation.","CIS Control 16 requires organisations to manage the security of software they acquire and use, including vetting third-party components and dependencies for malicious or vulnerable code.","This technique specifically covers adversaries injecting malicious code into third-party libraries distributed via package managers like PyPI, which is exactly how the credential-harvesting payload was delivered here.","Continuously identifying and assessing third-party package dependencies would have surfaced the anomalous new releases of agent-framework and triggered review before credential exfiltration occurred.","published","2026-11-18T03:20:20.463881+00:00","2026-11-18T03:20:20.442+00:00",{"id":7,"url":27,"slug":28,"title":29},"https:\u002F\u002Fwww.stepsecurity.io\u002Fblog\u002Fmicrosoft-agent-framework-pypi-package-compromised","microsoft-agent-framework-pypi-package-compromised-9f7b79","Microsoft agent-framework PyPI Package Compromised",[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},"endpoint-detection-response","Endpoint detection and response (EDR and XDR)","Malware and hands-on-keyboard attackers on laptops and servers get spotted and stopped.",{"slug":54,"name":55,"problem":56},"software-supply-chain","Software supply chain security","Malicious and vulnerable open-source packages are caught before they ship."]