By NHI Mgmt Group Editorial TeamBased on Hush Security: “Your Dependency Tree is Your Attack Surface” (April 1, 2026)

TL;DR: A malicious PyPI package, litellm 1.82.8, silently harvested cloud, Kubernetes, and SSH secrets from machines that installed it, then tried to persist and spread, showing how transitive dependency trust can turn ordinary package installs into credential theft and cluster compromise, according to Hush Security. Static secrets and perimeter tools were never enough for this threat model.


At a glance

What this is: This is an analysis of the litellm 1.82.8 supply chain compromise, where malicious package code stole secrets, attempted Kubernetes persistence and exposed how file-based credentials fail under dependency trust abuse.

Why it matters: It matters because NHI programmes still rely on secrets that malware can read at runtime, so identity, access and runtime controls have to reduce what can be stolen, not just detect what was committed.


Context

The security gap here is simple: package installation is being treated as a low-risk software action even when the installed code can execute before application logic and read secrets from the host. In this case, a malicious transitive dependency turned ordinary Python startup into credential collection, exfiltration and cluster access.

For NHI governance, the issue is not only malware detection. It is the assumption that credentials sitting on disk, in environment variables or in mounted service account paths are safe because they are "internal" to the machine. That model breaks the moment untrusted package code inherits the same filesystem and runtime access as the workload it arrives beside.

The article also shows why lifecycle thinking matters across machine and workload identities. If a dependency can reach cloud metadata, Kubernetes service accounts and local SSH material in one execution path, then identity scope, issuance time and runtime exposure all become part of the same control problem.


Key questions

Q: What breaks when a malicious dependency can run at interpreter startup?

A: The trust boundary breaks. A package that executes through startup hooks can read local secrets before application code or endpoint tooling has a chance to distinguish legitimate from malicious behaviour. In practice, install-time trust becomes runtime execution authority, so package provenance and process isolation become part of identity security.

Q: Why do NHI secrets in build systems create such a large blast radius?

A: Build systems often hold reusable credentials for source control, cloud access, and package publishing, so one compromise can cross multiple trust boundaries. When those credentials are not tightly scoped or rotated quickly, the attacker can move from local secret theft to registry abuse, cloud access, and persistence in developer tooling.

Q: How should security teams secure service accounts before attackers use them for lateral movement?

A: Security teams should treat service accounts as high-risk identities, not background infrastructure. The priority is to inventory them, remove unsupervised accounts, enforce strong password and authentication controls, and continuously monitor use for anomalies. Full visibility matters because attackers often target accounts that are forgotten, overprivileged, or poorly governed, then use them to access sensitive systems and move laterally across the environment.

Q: What should teams do immediately after a package-based secret theft incident?

A: Revoke the exposed credentials, freeze suspicious dependency updates, inspect build logs and developer endpoints for additional secret copies, and confirm whether secret stores or cloud roles were accessed with the stolen material. Containment has to cover the credential and every place it was duplicated.


Technical breakdown

How .pth files turn dependency install into code execution

Python processes .pth files automatically during interpreter startup, before application code runs. That makes them a powerful persistence and execution primitive for supply chain malware because no explicit import is needed and the payload triggers in any environment that loads the package. In this case, the malicious file executed on startup and could immediately inspect local files, metadata endpoints and environment state. The important architectural point is that package trust becomes execution trust. Once a transitive dependency is installed, the code inherits the privileges of the process that loads it, which is why ordinary software distribution can become a credential attack surface.

Practical implication: treat startup-executed package metadata and post-install hooks as an execution boundary, not a packaging detail.

Why static secrets fail under same-user file access

The payload searched for SSH keys, cloud credentials, Kubernetes configs, shell history and environment files because file-based secrets are readable by any process running as the same user. That is the core weakness of long-lived secrets: they authenticate possession, not intent. If malware arrives in the same process space as the workload, it does not need to break cryptography or defeat MFA. It simply reads the credential material and reuses it elsewhere. This is why vaults reduce sprawl but do not eliminate the trust assumption. As long as the secret exists on the machine, local code execution can usually reach it.

Practical implication: reduce the number of secrets that exist on endpoints and workloads in reusable form.

How Kubernetes service account tokens enabled lateral movement

The malware checked for a mounted Kubernetes service account token and, if present, used the Kubernetes API to enumerate secrets across namespaces and attempt privileged pod scheduling. That moves the compromise from local credential theft to cluster-wide access. The abuse path depends on standing service account authority and a token that can be replayed for more than a single narrowly scoped task. Once the attacker can query the API server with sufficient rights, the blast radius expands from one machine to the entire cluster. The technical lesson is that workload identity scope determines whether a package compromise stays local or becomes infrastructure-wide.

Practical implication: scope workload identities so a stolen token cannot enumerate or modify cluster-wide resources.


Threat narrative

Attacker objective: The attacker wanted to steal reusable cloud and workload credentials, persist on affected systems and gain broader cluster access for follow-on compromise.

  1. Entry occurred when a malicious PyPI package was pulled in as a transitive dependency and its .pth file executed automatically at interpreter startup.
  2. Credential harvesting followed as the payload crawled local files, cloud credential paths, metadata endpoints and Kubernetes configuration locations for reusable secrets.
  3. Escalation and spread began when the malware used any available Kubernetes service account token to enumerate secrets and attempt privileged pod scheduling across the cluster.
  4. Impact was credential theft, attempted persistence on the host and a widened blast radius across machines and Kubernetes nodes.

Read our 52 NHI Breaches Analysis report for a comprehensive view of breaches impacting Non-Human Identities including AI Agents.


NHI Mgmt Group analysis

Static credential possession is the broken premise this attack exposed. The package succeeded because cloud, Kubernetes and SSH access were still represented as readable files on the machine. That assumption was designed for a trusted execution environment, but it fails when transitive dependencies can run arbitrary code at startup. The implication is that secret location, not just secret strength, is now a first-class governance variable.

Supply chain compromise turns endpoint file access into identity compromise. This was not a vulnerability in the usual CVE sense, and that is exactly why traditional vulnerability-centric controls missed it. The attacker did not need to exploit a binary, only to inherit the same local read permissions as the legitimate workload. Practitioners should read that as a failure of trust placement: the machine was allowed to host credentials that the machine's own software could not be trusted to protect.

Package provenance and workload identity are now linked control planes. A malicious dependency that can read cloud metadata, Kubernetes tokens and local configs collapses the boundary between software supply chain risk and NHI governance. The same event that starts as a package install ends as identity theft. That means governance teams have to evaluate transitive dependency trust alongside how credentials are issued, stored and scoped in runtime environments.

Kubernetes blast radius depends on whether workload identities are narrowly bound or cluster-reusable. The malware's attempted pivot into kube-system only works when a service account token can authorize far more than the task that needed it. That is not a patching problem. It is a scope problem in workload identity design. Practitioners should treat excessive token reach as a latent lateral movement path, not a convenience feature.

Runtime observability becomes a control, not a luxury, once secrets are on endpoints. The article shows that process ancestry, file opens and outbound connections are the only reliable way to reconstruct this kind of compromise in real time. Without that evidence, teams are left rotating credentials after the fact and guessing at exposure. The governance lesson is straightforward: when secrets remain local, detection has to see both file access and egress behaviour.

What this signals

Package provenance now sits inside the NHI governance conversation. When transitive dependencies can execute before application code, software supply chain trust becomes a credential exposure issue, not just a build integrity issue. Identity teams should assume that runtime code can inherit the same local access as the workload and design controls accordingly.

Static secrets make compromise scalable because they create a reusable artefact on the machine. Once those secrets are discoverable by local code, the only durable defence is to reduce the amount of credential material that exists in file or environment form at runtime.

Identity blast radius is the right concept for this class of incident. The more broadly a credential can reach into cloud, Kubernetes and developer environments, the more a single dependency compromise can spread. Teams should evaluate whether their issuance model limits the damage of one compromised process or simply delays the inevitable cleanup.


For practitioners

  • Eliminate file-based reusable secrets Move cloud, Kubernetes, database and API access to short-lived runtime credentials so package-installed code cannot scrape secrets from disk or environment files.
  • Audit package startup execution paths Review dependencies for .pth files, setup-time hooks and other automatic interpreter entry points that can execute before application code is loaded.
  • Scope Kubernetes service accounts tightly Ensure workload tokens cannot enumerate secrets across namespaces or create privileged pods in kube-system unless the workload explicitly needs that reach.
  • Monitor file access plus outbound egress together Correlate credential-shaped file reads, metadata endpoint access and unusual TLS destinations from Python and other build-time runtimes.
  • Prepare a post-compromise credential rotation playbook Define which SSH keys, cloud credentials, service account tokens and environment-based API keys are rotated immediately after a package compromise.

Key takeaways

  • The attack worked because ordinary package installation was allowed to cross into code execution and secret access.
  • The incident showed that disk-stored credentials, Kubernetes tokens and cloud metadata endpoints can all be abused from the same compromised runtime.
  • The limiting control is not faster rotation after the fact, but removing reusable secrets from places untrusted code can read.

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 and MITRE ATT&CK address the attack and risk surface, while NIST CSF 2.0 sets the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP Non-Human Identity Top 10NHI-02 — Secret LeakageThe package stole secrets from files, environments and metadata endpoints.
NHI-05 — Overprivileged NHIThe attack widened when Kubernetes credentials allowed broad cluster actions.
NHI-07 — Long-Lived SecretsThe article shows how static secrets on disk enabled replay after theft.
Recommendation — Remove reusable secrets from endpoints and workloads so local code cannot harvest them. Reduce workload permissions so a stolen token cannot enumerate or modify cluster-wide resources. Replace long-lived credentials with short-lived issuance that expires before replay is useful.
MITRE ATT&CKTA0006; TA0008 — Credential Access; Lateral MovementThe attack chain moved from credential harvesting to cluster spread.
Recommendation — Map package-driven secret theft to credential access and constrain lateral movement paths.
NIST CSF 2.0PR.AA-05 — Access Permissions, Entitlements and AuthorizationsThe compromise depended on overbroad permissions carried by local and workload identities.
Recommendation — Constrain entitlements so compromised process access cannot become infrastructure-wide reach.

Key terms

  • Transitive Dependency Compromise: A transitive dependency compromise happens when malicious code enters through a package your software did not pin directly but still trusts at install or runtime. The risk is not the dependency label itself, but the inherited execution path and permissions that let the payload read files, call APIs or persist.
  • File-Based Secret: A file-based secret is any credential material stored on disk or in environment-form where local code can read and reuse it. For identity governance, it is a weak trust model because possession becomes sufficient authority, so any process with the same user-level access may inherit the credential.
  • Workload Identity: The identity assigned to a software workload, such as a containerised application, serverless function, or microservice, enabling it to authenticate to other services without storing static credentials.
  • Workflow Execution Boundary: The workflow execution boundary is the point where user-authored logic stops being data transformation and starts becoming privileged runtime activity. In secure designs, that boundary prevents untrusted workflow content from reaching process memory, system calls, or secret stores without strict containment.

Deepen your knowledge

NHI governance, agentic AI identity, and machine identity lifecycle are core topics in our NHI Foundation Level course, the industry's only accredited NHI security programme. If you are responsible for identity security strategy or NHI governance in your organisation, it is worth exploring.
NHIMG Editorial Note
Published by the NHIMG editorial team on June 23, 2026.
Updated on October 6, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org