PyPI: 140 Malicious Packages Target AWS Secrets in CI/CD Pipelines
By Mounim Alami — Founder of CybRelay ·
A campaign on the PyPI registry leveraged 140 typosquatted packages to siphon cloud credentials within continuous integration pipelines. This attack highlights the direct operational risk software supply chains pose to infrastructure security.
What Happened
According to a security report published by ReversingLabs and Socket.dev, a coordinated campaign published 140 malicious packages to the official PyPI repository. The threat actors designed modules mimicking the names of popular Python libraries widely adopted by software engineering teams. As soon as a developer or an automated workflow executes the standard install command inside GitHub Actions, the malicious payload triggers to inspect environment variables and extract injected deployment secrets and AWS keys.
Who Is Affected
This threat targets organizations automating their software testing and deployment workflows through continuous integration pipelines. Development teams, software vendors, and enterprises running workloads on public cloud infrastructure are exposed as soon as automated workflows consume external dependencies without strict verification. Across Europe, Morocco, and Africa, businesses operating in financial services, e-commerce, and digital platforms manage sensitive infrastructure tokens daily within their DevSecOps workflows.
Why This Attack Is Dangerous
Arbitrary code execution during dependency installation is a critical attack vector. Within continuous integration environments like GitHub Actions, environment variables frequently store privileged deployment tokens, AWS access keys, or container registry credentials. By harvesting these variables during the pip install execution, attackers retrieve cloud infrastructure keys before unit tests or static code scans even run, enabling immediate credential exfiltration without raising operational alarms.
What to Do Now
To mitigate exposure to software supply chain risks within CI/CD pipelines, engineering teams should take several defensive steps immediately:
1. Rotate and revoke any AWS access keys and deployment credentials that may have run in untrusted or unsegmented continuous integration workflows.
2. Enforce strict dependency pinning using cryptographic hashes to prevent the installation of unapproved or recently substituted packages.
3. Restrict environment variable injection across pipeline steps, isolating credentials away from unverified build or dependency installation phases.
4. Enforce least-privilege permissions and temporary session tokens for all cloud roles used in automated delivery workflows.
How CybRelay Helps Secure Your Pipelines
CybRelay provides a structured approach to detect vulnerabilities and exposed secrets across source code (supporting 18 languages including Python, Go, and shell) and infrastructure as code (Dockerfile, Kubernetes, and Terraform). The SaaS platform digests reports from scanners (such as SARIF, Trivy, Snyk, Semgrep, and CodeQL), deduplicates identical findings so each issue is counted once, and prioritizes remediation work from P1 down to P4.
For each vulnerability, CybRelay produces a detailed advisory with severity ratings, CWE references, target files, and line numbers. Its deterministic engine generates Bash or Python remediation scripts with AI-guided comments, along with in-memory validated .patch files when syntax checks and vulnerability neutralization are confirmed. CybRelay never connects to or clones client repositories: payloads are submitted directly via API, GitHub Actions workflows, or MCP gateways, leaving developers in full control of review and implementation.
Standards and laws involved
- Directive NIS2 — European Directive (EU) 2022/2555 on the cybersecurity of essential and important entities. The NIS2 Directive requires affected entities to manage cybersecurity risks stemming from software supply chains and third-party dependencies.
- Règlement DORA — European Regulation (EU) 2022/2554 on digital operational resilience for the financial sector. The DORA regulation mandates strict oversight of third-party ICT security risks to preserve digital operational resilience.
- ISO/IEC 27001 — International standard defining an information security management system. ISO/IEC 27001 addresses information security controls across supplier relationships and the safeguarding of infrastructure secrets.
Frequently asked questions
How can a simple package installation command exfiltrate credentials?
Python package setup procedures permit arbitrary code execution during installation. Malicious packages use this hook to inspect CI/CD environment variables, harvest access keys, and transmit them to external servers immediately.
Does CybRelay modify code directly in source repositories?
No. CybRelay does not clone repositories, create branches, or run client test suites. It provides remediation advisories, deterministic scripts, and in-memory validated patches for internal teams to review and deploy.