Software supply chain attacks targeting developer communities have become one of the most consistent vectors for enterprise credential theft. The pattern is familiar: malicious packages published to public repositories — npm, PyPI, RubyGems — contain code that executes during installation, harvests credentials from the developer’s environment, and exfiltrates them to attacker-controlled infrastructure.
TrapDoor is the latest iteration of this pattern, but with a targeting focus that reflects the current enterprise environment: it is specifically aimed at AI developer communities. The choice of target is not incidental. AI development teams in 2026 have access to cloud infrastructure — GPU clusters, model hosting, data pipelines — and enterprise data that makes their credentials particularly valuable. A stolen cloud access key from an AI engineer is a different category of credential than a stolen credential from a web developer; it may provide access to training infrastructure, proprietary model weights, and large-scale data processing environments.
How TrapDoor Works
The TrapDoor campaign uses malicious packages published to public package repositories — the specific repositories vary, but the targeting is oriented toward tools used in AI and machine learning development workflows.
The attack mechanism relies on preinstall scripts: commands that execute automatically when a package is installed, before the developer has any opportunity to review the package code or its behavior. Preinstall scripts are a legitimate package mechanism used for build steps and environment configuration, but they are also the primary mechanism by which malicious packages harvest credentials — because they run with the privileges of the installing user and have access to the same environment variables and file system paths that the developer’s tools use to store credentials.
In TrapDoor’s case, the preinstall scripts are designed to locate and exfiltrate:
Cloud provider credentials. The scripts search for AWS credential files, GCP service account JSON files, Azure credential caches, and environment variables used by cloud SDKs to store access keys. Developers working with cloud AI services — training on cloud GPU instances, deploying models to cloud endpoints — typically have these credentials present in their development environment.
SSH keys. Private keys in ~/.ssh/ directories are targeted. SSH keys provide access to remote systems — cloud instances, development servers, internal infrastructure — without requiring password authentication. A stolen SSH private key provides persistent access that survives password resets and, in many cases, is not revoked when an initial compromise is detected.
Developer secrets. API keys, tokens, and secrets stored in common locations — .env files, development configuration files, shell history, credential manager caches — are included in the harvest scope.
Exfiltration uses GitHub-based infrastructure as the command and control mechanism. Exfiltrated credentials are sent to GitHub repositories or through GitHub APIs, blending credential exfiltration traffic with the high volume of legitimate GitHub traffic that AI developers generate. Network-level controls that block connections to unfamiliar IP addresses or domains are largely ineffective when the exfiltration destination is api.github.com.
Why AI Developers Are the Target
The targeting of AI development communities is a rational attacker decision given the value of the credentials available in that environment.
AI development in 2026 runs predominantly on cloud infrastructure. Even organizations that host final model deployments on-premises typically conduct training and experimentation in cloud environments — AWS SageMaker, Google Cloud Vertex AI, Azure ML, and similar services. Access to that infrastructure is controlled by cloud credentials that live in developer environments.
A compromised cloud access key from an AI engineer may provide:
Compute access. GPU instances used for model training are expensive. Compromised cloud credentials are used for cryptomining and for renting that compute capacity to third parties. An attacker who steals credentials from a team running large-scale AI training jobs gains access to significant compute resources.
Data access. AI training pipelines typically have access to large datasets — customer data, transaction records, enterprise documents — that are used as training inputs. Cloud credentials with access to S3 buckets, BigQuery datasets, or Azure Blob storage containing training data represent access to enterprise data at scale.
Model weights and intellectual property. Proprietary model weights represent significant investment in compute and data. An attacker with access to model storage can exfiltrate model weights — which may be a primary intellectual property asset for organizations that have invested heavily in custom AI development.
Infrastructure pivot. Cloud credentials often have broader permissions than developers intend, particularly in development environments where least-privilege enforcement is less rigorous than in production. Credentials with access to AI infrastructure may also provide access to adjacent cloud services, internal networks through cloud-hosted infrastructure, or other enterprise systems.
The TrapDoor campaign’s focus on AI developer communities is also strategic for a different reason: AI development organizations tend to be early adopters, meaning their developer environments are often more complex, use more tools from more sources, and have less mature supply chain security practices than organizations with more established software development disciplines.
The Prior Campaign Pattern
TrapDoor is not the first supply chain attack to target developers through malicious packages, and it follows a pattern established by earlier campaigns including the SAP npm supply chain attack that was active in the same period.
The SAP npm attack used a similar mechanism — preinstall scripts in malicious packages — to steal developer and CI/CD credentials through GitHub-based command and control infrastructure. The targeting of CI/CD credential specifically is significant because CI/CD systems often have deployment credentials with access to production environments, and secrets stored in CI/CD pipelines frequently include cloud keys, database credentials, and signing keys that have broad access.
The convergence of these campaigns on GitHub-based C2 infrastructure reflects a broader attacker strategy: using legitimate, trusted infrastructure for malicious purposes makes detection and blocking significantly harder. Security teams that monitor for connections to known-malicious IP addresses and domains will not detect exfiltration to GitHub; security teams that block GitHub wholesale lose essential development tools.
Enterprise Security Implications
For enterprise security teams managing environments that include AI development workflows, TrapDoor raises several specific operational questions:
What package sources do AI development teams use? AI and machine learning development communities are prolific publishers of packages and tools — pip, conda, npm for ML tooling, and increasingly specialized AI-focused package repositories. Understanding what sources developers are consuming from is a prerequisite for assessing supply chain risk.
Are CI/CD pipelines scanning packages for malicious behavior? Traditional dependency scanning checks packages against known-malicious package lists and checks for known-vulnerable versions. These checks do not catch novel malicious packages that haven’t been flagged yet. Behavioral analysis — monitoring what packages do during installation — provides detection that signature-based scanning misses.
Are cloud credentials scoped appropriately in development environments? The value of TrapDoor’s harvest depends heavily on the permissions attached to stolen credentials. Development environment credentials with broad cloud access — because they were set up conveniently rather than following least-privilege principles — represent a far higher-value target than development credentials scoped to the minimum necessary permissions.
Is secrets management enforced? Storing cloud credentials in environment variables or .env files in the development environment is common practice and is exactly what TrapDoor’s scripts are designed to find. Secrets management systems that inject credentials at runtime without writing them to disk or environment variables that can be read by arbitrary processes reduce exposure, but require deliberate implementation.
Is GitHub API traffic monitored? Exfiltration through GitHub’s API is detectable if organizations are monitoring outbound API calls to api.github.com with attention to the data volumes and user-agent patterns of those calls. Normal developer GitHub API traffic has identifiable patterns; bulk credential exfiltration through GitHub APIs may produce unusual patterns in volume or timing.
The Bigger Picture
TrapDoor is one instance of a supply chain attack pattern that has been demonstrated repeatedly over the past several years to be effective and difficult to fully prevent. The combination of preinstall script execution, credential-targeted harvesting, and exfiltration through trusted infrastructure represents a mature attack pattern that has been refined through multiple campaigns.
For organizations with AI development teams, the campaign-specific targeting is a signal that those teams’ development environments need to be included in the same supply chain security assessment frameworks applied to other development organizations. The novelty and pace of AI tooling adoption has in many cases outrun the security controls applied to other parts of the software development stack.
The appropriate response is not to restrict AI development — it is to extend the security controls that apply to software supply chain risk to the specific repositories, tools, and workflows that AI teams use. That means package source policy, installation-time behavioral monitoring, least-privilege credential scoping, and secrets management disciplines applied with the same rigor that mature software development organizations apply to their general codebases.



