Because install-time execution turns distribution into compromise. If the environment installing the package contains credentials, tokens, or privileged network access, the package can steal identity material and use it for follow-on access. That is why runtime containment and secret hygiene have to be treated as one control problem.
Why the risk jumps at install time
A malicious package is not equally dangerous everywhere in the supply chain. It becomes much more dangerous when it runs in a live build, CI job, or scanning environment because that is where secrets, tokens, cloud metadata, package credentials, and internal network routes are often present and usable. At that point the package is no longer just distribution, it has a path to real compromise.
The practical issue is that install-time execution happens inside systems that are trusted to fetch dependencies, sign artifacts, reach repositories, and sometimes publish outputs. That trust gives the package a better chance to steal identity material, move laterally, or plant persistence before anyone notices.
In the same way that a fake dependency is only annoying in a sandbox but dangerous on a production runner, a malicious package on a live build host can interact with the very controls meant to make software delivery work. LiteLLM PyPI package breach and PyTorch torchtriton supply chain attack 2022 both show how package execution can turn environment secrets into exfiltration targets.
Why build and scanner environments are high-value targets
Build agents and scanners usually sit closer to privileged infrastructure than ordinary developer laptops. They often have access to source repositories, artifact registries, deployment keys, cloud credentials, and internal services that a package would never see on a user workstation. If the package can execute during install, it can inspect environment variables, read mounted files, query metadata services, or call out to the network with stolen material.
That is why the same package behavior can have very different consequences depending on where it lands. In a disposable test environment, the payload may fail harmlessly. In a live pipeline, it may capture signing tokens, publish credentials, or a short-lived session that is enough to impersonate the build system.
Live build execution is especially sensitive when the pipeline is also used to validate or scan code, because scanners are often granted broad read access and network reach to inspect artifacts at scale. A malicious package that runs during that step can use the scanner as an intelligence source, not just a target. For broader supply-chain defenses, OpenSSF and SLSA both reinforce the need to reduce what build systems can access and to verify artifact provenance.
What changes when secrets and privilege are present
The danger is not only code execution, it is code execution in a context that already holds identity material. If a runner has a registry token, cloud access key, or deployment credential, the package can convert that one execution into follow-on access elsewhere. That is why a package event becomes a credential event as soon as the runtime can see secrets.
This is also why scanners and build jobs should be treated as part of the same control surface as secret storage. If the environment keeps long-lived tokens on disk, injects them into every job, or allows wide outbound access, the package can steal and reuse them before any security tool finishes its check. GemStuffer RubyGems campaign 2026 and MemTensor MemoryOS supply chain attack 2026 are useful reminders that publish-time and build-time secrets are high-value targets.
When the package runs in a pipeline that can reach internal services, the blast radius expands again. Even a small package can query service endpoints, enumerate metadata, or probe for adjacent credentials once it has a foothold. The more trusted the environment, the more dangerous the package becomes.
Risk and Threat Considerations
Live build and scanner environments create a sharp trust mismatch: they are designed to execute untrusted code just enough to verify it, but they often do so while holding credentials and network reach that the package can abuse. That makes install-time compromise a fast path from supply-chain exposure to environment-wide identity theft.
Failure mechanism: The malicious package executes during installation or inspection, reads secrets from the process environment, files, caches, or metadata services, and uses those credentials to reach registries, cloud services, or internal systems.
Impact: Attackers can steal signing tokens, publish credentials, or cloud access, then pivot into artifact tampering, data access, or broader compromise of the delivery pipeline.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
SLSA, CIS Controls v8 and NIST SP 800-53 Rev 5 set the technical controls, while ISO/IEC 27001:2022 defines the regulatory obligations.
| Framework | Control / Reference | Relevance |
|---|---|---|
| SLSA | Supply-chain Levels for Software Artifacts | Install-time compromise directly concerns build provenance and artifact integrity. |
| Recommendation — Harden build provenance and isolate dependency execution from release-signing credentials. | ||
| CIS Controls v8 | CIS-5 — Account Management | Build runners are dangerous when they carry standing accounts or tokens the package can abuse. |
| Recommendation — Remove standing accounts and shorten credential lifetime on build and scan systems. | ||
| NIST SP 800-53 Rev 5 | IA-5 — Authenticator Management | The danger hinges on exposed tokens, keys, and other authenticators in the runtime environment. |
| AC-6 — Least Privilege | Build and scanner jobs become high-risk when they have more access than installation needs. | |
| Recommendation — Use short-lived authenticators and rotate any secret reachable by build execution. Constrain pipeline identities to the minimum access needed for each job. | ||
| ISO/IEC 27001:2022 | A.8.24 — Use of cryptography | Credential and signing-material handling in pipelines depends on protecting identity-bearing material. |
| Recommendation — Protect secrets and signing material with controlled handling and storage. | ||
Practitioner Guidance
What to prioritise: Treat any build or scan step that can execute third-party code as a credential-bearing workload. The first question is not whether the package is known-bad, but whether the job can see production-like secrets or network paths.
What to verify: Confirm that dependency installation happens with the minimum secret set, short-lived credentials, and tightly scoped network egress. If the job can reach a registry, cloud API, or internal service, assume a malicious package can try to use that path.
Common mistake: Teams often harden the repository but leave the runner exposed. The safer model is to contain the runner, remove standing secrets, and only then trust scan results from that environment.
Practitioner takeaway: A malicious package becomes materially more dangerous when it can execute where credentials and trusted network reach already exist, because the package can turn a single install into reusable access.
Related resources from NHI Mgmt Group
Deepen Your Knowledge
Free weekly newsletter
Subscribe to the NHI & AI Identity Journal
The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.
Bonus 33% off our NHI Course when you subscribe.
Reviewed and updated by the NHIMG editorial team on October 12, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org