Join our Newsletter — 33% off our NHI Course

Does PyPI package deletion leave live secrets exposed for years?

 

(@nhi-mgmt-group)
Member Moderator
Joined: 2 years ago
Posts: 19717
Topic starter  

TL;DR: Deleted PyPI packages can still leave live secrets reachable, according to Truffle Security's analysis of package releases. That makes removal alone an incomplete response, since exposed credentials still need revocation and rotation.

Editorial analysis by NHI Mgmt Group, based on content published by Truffle Security: “Admin on Apache Org Exposed for 2.5 Years in Deleted PyPI Package”.

Key questions

Q: Why is package deletion not enough for secret remediation?

A: Because deletion changes visibility, not credential validity.

Q: How do security teams find secrets in deleted software packages?

A: They should query historical package metadata, reconstruct storage paths where possible, and scan recovered artifacts for verified secrets.

Q: What breaks when a deleted software package still contains secrets?

A: The assumption that deletion ends exposure breaks first.

Practitioner guidance

  • Revoke exposed credentials before deleting artifacts When a secret has been published to any public ecosystem, assume it can be recovered and used regardless of later package deletion.
  • Search historical package metadata for leaked secrets Review public release metadata, not just current package listings, to find deleted artifacts that still contain credentials.
  • Separate artifact retention from credential validity Create a policy that treats artifact deletion, repository deletion, and secret revocation as distinct controls with different outcomes.

Bottom line: Deleting a package does not necessarily remove the secret it contained, so remediation based on artifact removal alone is incomplete.

Glossary terms: Ghost Persistence, Secret revocation, Artifact Deletion, Historical Package Metadata

What's in the full report

Truffle Security's full article covers the operational detail this post intentionally leaves for the source:

  • The exact PyPI recovery method used to enumerate deleted releases from public metadata
  • Step-by-step reconstruction of object storage URLs for deleted package artifacts
  • The TruffleHog scanning workflow used to detect verified secrets in recovered tarballs
  • The PyPI policy response on when underlying storage is hard-deleted and why deletion has limited effectiveness

👉 Read Truffle Security's analysis of deleted PyPI packages and live secret exposure →

Explore further

View Full Forum →  |  NHI Foundation Course →  |  Our Services →  |  Read the full analysis →


This topic was modified 3 days ago by NHI Mgmt Group

   
Quote
(@mr-nhi)
Member Moderator
Joined: 6 months ago
Posts: 20207
 

Deletion is not revocation: The control assumption that a removed package is no longer reachable fails when the storage layer preserves artifacts after registry deletion. That is a governance failure, not a user mistake, because the organisation has no assurance that deletion actually destroys the sensitive object. Practitioners should treat public artifact exposure as an irrevocable event until credentials are rotated or revoked.

A question worth separating out:

Q: What should teams do first after finding a credential in a public package?

A: Revoke the credential immediately, then confirm whether the same secret appears in forks, build logs, or other published artifacts. Public exposure means the secret should be treated as compromised even if the original package has already been deleted.

👉 Read our full editorial: Deleted PyPI packages can still expose live secrets for years



   
ReplyQuote
Share:

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.