Because those environments usually sit close to high-value material such as signing keys, tokens, API keys, and cloud credentials. Even when the malware is not overtly credential-stealing, the surrounding trust boundary is wide enough that a small dependency compromise can become a broader access problem.
Why This Matters for Security Teams
Malicious packages are rarely just a supply chain nuisance. They are often deployed where developers and CI systems already hold the keys to production: signing tokens, cloud credentials, release automation, and repository access. That makes package compromise especially effective in environments where trust is broad, automation is constant, and humans assume tooling is “safe enough” to run. NIST SP 800-53 Rev. 5 treats access control and system integrity as core controls for a reason.
The practical risk is not limited to the package itself. A single dependency can inspect the local environment, read build metadata, pivot into cached credentials, or tamper with artifacts before they are published. NHIMG research shows that 96% of organisations store secrets outside of secrets managers in vulnerable locations including code, config files, and CI/CD tools, which helps explain why developer and pipeline environments are such a high-value target. The Shai Hulud npm malware campaign is a clear example of how package trust can be turned into secrets exposure at scale.
In practice, many security teams encounter the compromise only after a build account, release token, or cloud key has already been used outside its intended boundary, rather than through intentional package review.
How It Works in Practice
Developer and CI environments are attractive because they combine privileged access with weak isolation. A malicious package does not need persistent root access if it can run in a build job that already has access to source code, artifact registries, deployment credentials, or signed release workflows. Current guidance from OWASP and NIST suggests treating these environments as production-adjacent control points, not as disposable tooling.
Attackers commonly rely on a few repeatable patterns. They may execute during install hooks, scan environment variables, read files in workspace directories, or wait until a pipeline step exposes secrets for deployment. They may also abuse overly permissive service accounts or cached authentication context to move from a single job into broader cloud or Git access. The risk is amplified when secrets are long-lived, reused across projects, or copied into ephemeral runners without strong scoping.
Practically, defenders should reduce what the package can see and shorten what it can use:
- Issue JIT credentials per pipeline run, with tight TTLs and automatic revocation after task completion.
- Prefer workload identity over shared static secrets, so the runner proves what it is through cryptographic identity rather than inherited tokens.
- Scope CI permissions to the narrowest build, test, or deploy action required.
- Keep signing keys and high-impact tokens out of general-purpose build environments whenever possible.
- Evaluate policy at request time using context, not only pre-defined roles that assume stable human behaviour.
NHIMG’s Ultimate Guide to NHI notes that only 5.7% of organisations have full visibility into their service accounts, which is why hidden access paths often outlast the initial compromise. The pattern is consistent with incidents like the LiteLLM PyPI package breach, where package trust intersects directly with credential exposure. These controls tend to break down when ci runner share credentials across jobs because one malicious install can inherit access intended for many builds.
Common Variations and Edge Cases
Tighter controls often increase build friction and operational overhead, requiring organisations to balance supply chain resilience against developer velocity. That tradeoff becomes more visible in fast-moving CI/CD platforms, monorepos, and self-hosted runner fleets where teams depend on automation to keep release cycles short.
There is no universal standard for every package risk scenario yet, but current guidance suggests the strongest posture is layered: lock dependencies, verify provenance where possible, isolate runners, and remove standing secrets from environments that execute third-party code. In practice, air-gapped or heavily locked-down pipelines can still fail if they reuse a single high-privilege token across many workflows. Likewise, ephemeral containers help only when the backing identity is also ephemeral and the secrets disappear with the job.
Edge cases matter. Some teams rely on package scanners and allowlists, but those controls do not stop a malicious dependency that behaves benignly during inspection and only activates after runtime context is present. Other teams centralise secrets in a vault, yet then inject broad access into every job, which preserves the blast radius even while improving storage hygiene. The more autonomous the build process, the more the control model needs runtime authorisation, short-lived credentials, and workload identity. That is why high-trust automation environments remain a favourite target even when the obvious secrets have already moved into a vault.
For additional context on misconfiguration risk, see NHIMG coverage of the Google Firebase misconfiguration breach, which shows how exposed services and weak boundaries turn ordinary development infrastructure into an access pathway.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Non-Human Identity Top 10, OWASP Agentic AI Top 10 and CSA MAESTRO address the attack and risk surface, while NIST AI RMF and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-03 | Directly addresses secret rotation and lifecycle risk in CI and dev tooling. |
| OWASP Agentic AI Top 10 | AI-03 | Runtime tool use and dynamic access are the same trust problem for autonomous execution paths. |
| CSA MAESTRO | CI-3 | Covers isolation and governance of automated AI and software execution environments. |
| NIST AI RMF | Risk framing helps classify CI compromise as an operational and governance issue. | |
| NIST CSF 2.0 | PR.AC-4 | Least privilege is central to limiting what malicious packages can reach. |
Isolate build and agent execution paths from long-lived secrets and high-impact credentials.
Related resources from NHI Mgmt Group
- Why do malicious open source packages so often lead to cloud and repository exposure?
- What breaks when malicious packages can run on developer machines with cluster access?
- How should teams respond when CI or developer secrets are exposed?
- How should security teams stop malicious CI/CD workflow commits from executing?
Deepen Your Knowledge
Reviewed and updated by the NHIMG editorial team on August 2, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org