Require trust bindings to use immutable repository identifiers, not just repository names. Revalidate every binding when a repository is renamed, transferred or deleted, and reject publish exchanges that do not match the expected repository_id and owner identity. That removes the opportunity for an attacker to recreate a freed slug and inherit the original trust relationship.
Why a freed repository slug can still be trusted by the wrong party
The core failure is that a repository name or slug is not a durable security boundary. If a trust relationship is bound only to a mutable name, then deleting, renaming, or transferring the original repository can free that slug for reuse. An attacker who later claims the same slug can appear to be the original source unless the trust check also verifies immutable repository identity and owner identity.
That is why repository trust should be treated like any other identity-binding problem: the binding must survive lifecycle changes, not just match a human-readable label. The safer model is to anchor trust to the repository_id and the owning identity, then revalidate those facts whenever the repository object changes.
For package publishing systems, the lesson is the same as in the broader supply chain: names are convenient for discovery, but identifiers are what preserve trust. NHIMG’s Private Package Repository and Proxy Guide is useful here because it explains why namespace binding, resolution order, and curated sources matter when you are trying to keep an internal package trust boundary intact.
What must be checked before a publish exchange is accepted
A publish flow should not rely on repository ownership as it appears at the moment of the request alone. It should confirm that the expected repository_id still matches the source of the exchange, that the owner identity still maps to the approved trust relationship, and that the repository has not been renamed, transferred, or recreated under the same slug.
This matters most when trust is created outside the registry itself, for example in CI systems, deployment tooling, or publishing automation that caches an approved repository reference. If those systems store only the slug, they can silently keep trusting a different repository after the original one disappears.
Where the package ecosystem uses additional trust signals, such as signed publishing or scoped package controls, those signals should be checked as supporting evidence rather than as a substitute for repository identity. OpenSSF is a useful reference point for the broader supply chain controls that help reduce this kind of trust confusion.
How to stop slug reuse from becoming a trust confusion attack
The practical fix is to make repository lifecycle events first-class security events. Renames, transfers, deletions, and recreations should invalidate any existing trust binding and force a fresh approval path. If the platform cannot guarantee that a slug belongs to the same repository instance, the binding must not survive the change.
That approach reduces the attacker’s opportunity to resurrect a freed name and inherit old permissions, publishing rights, or trust status. It also forces downstream systems to fail closed when the repository object they expected is no longer the one presenting itself.
- Store immutable repository identifiers in allowlists, trust policies, and automation metadata.
- Revalidate repository ownership after any rename, transfer, or deletion event.
- Reject publish requests when the repository_id or owner identity does not match the expected binding.
- Require re-approval when a repository is recreated, even if the slug is identical.
Risk and Threat Considerations
Freed slugs create a trust confusion condition: an attacker does not need to break the original trust control if the system still recognizes the old name as authoritative. That can let a new repository inherit publishing trust, package provenance assumptions, or automated delivery privileges that were intended for a different object.
Failure mechanism: A trust binding survives a repository rename, transfer, or deletion even though the repository instance behind the slug has changed. When the slug is reclaimed, the control evaluates the wrong object and grants trust to the attacker-controlled replacement.
Impact: Malicious packages can be published under an apparently trusted source, downstream consumers may accept them without challenge, and incident response becomes harder because the trust break is rooted in lifecycle state rather than a simple credential leak.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
CIS Controls v8, NIST SP 800-53 Rev 5, SLSA and OWASP ASVS set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| CIS Controls v8 | CIS-14 — Security Awareness and Skills Training | Slug-reuse trust failures need process awareness and secure publishing discipline. |
| Recommendation — Train release owners to treat repository renames and deletions as trust-binding changes. | ||
| NIST SP 800-53 Rev 5 | IA-5 — Authenticator Management | Publishing trust depends on managing identity-bearing material and invalidating stale bindings. |
| AC-3 — Access Enforcement | Publish authorization must enforce the expected repository identity before accepting an exchange. | |
| Recommendation — Rotate or revoke trust material when a repository identity changes. Enforce publish decisions against immutable repository identifiers and owner identity. | ||
| SLSA | Provenance | The question is about preserving source trust in software publication chains. |
| Recommendation — Bind release provenance to immutable source identity rather than a reused name. | ||
| OWASP ASVS | V8 — Authorization | The publish flow must authorize the correct repository object, not just a matching label. |
| Recommendation — Verify the repository object behind each publish request before granting release rights. | ||
Practitioner Guidance
What to verify: Check whether your trust workflow uses a stable repository identifier, not a slug or display name, at every enforcement point. If the platform, broker, or CI job cannot distinguish the old repository from a newly created one, the binding is too weak.
Decision rule: If a repository has been renamed, transferred, or deleted, treat the old trust relationship as invalid until it is explicitly re-established against the current repository object. Do not allow “same name” to stand in for provenance.
What practitioners underestimate: The dangerous case is not only malicious takeover after deletion, but also accidental reuse through automation that caches stale metadata. The safest posture is to assume the slug can be recycled and to make trust depend on something the attacker cannot reclaim by naming.
Practitioner takeaway: Trust for package publishing should be bound to immutable identity, then rechecked whenever the repository lifecycle changes, because a reused slug is indistinguishable from the original only if your control model lets it be.
Related resources from NHI Mgmt Group
- What breaks when package trust checks only cover the source repository?
- What breaks when package trust is based only on name similarity and repository popularity?
- When does identity-based Zero Trust fail to stop attackers?
- How should organisations implement Zero Trust without breaking existing access workflows?
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 November 25, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org