Summary
A flawed authorization check in zot's OCI distribution middleware mishandles permissions for the latest tag when processing PUT /v2/{name}/manifests/{reference} requests.
Users who should only be able to create tags can, under specific conditions, overwrite an existing latest tag, enabling unauthorized modification of container images or artifacts.
Affected context
The vulnerability appears in zot deployments using versions 1.3.0 through 2.1.14, where the registry enforces fine-grained authorization on manifest operations.
It specifically impacts the authorization middleware that interprets PUT /v2/{name}/manifests/{reference} requests for repositories using the latest tag.
Environments that distinguish between create and update permissions on tags, but allow users to create manifests, are more exposed to this logic flaw.
Exploit preconditions
- Attack surface: HTTP API endpoint
PUT /v2/{name}/manifests/{reference}exposed by the zot registry. - Required access: Valid credentials or access token with permission to create manifests/tags but without permission to update/overwrite them.
- State requirements: The repository already has a
latestmanifest; the user targets an overwrite oflatest. - Trigger point: An authorized client issues a PUT request for a manifest where the middleware incorrectly infers the action as "create" rather than "update" for
latest. - Why exploitation is possible: The authorization middleware defaults the required action to create, and only upgrades to update when the tag exists and
reference != "latest", causing an under-enforced policy for overwritinglatest.
Why this happens
The root cause is an incorrect authorization decision tied to flawed request classification logic in the middleware.
Instead of consistently determining whether a PUT is creating a new tag or updating an existing one based on repository state and reference, the code applies a special-case rule for latest that leaves overwrite attempts classified as create operations.
This maps to CWE-863: Incorrect Authorization, where the system performs access checks that do not reflect the intended security policy, permitting an operation (update) under more permissive rules (create).
Conceptually, it is a mismatch between the semantic action (overwriting an existing tag) and the action used for permission evaluation (creating a new tag).
Potential impact
- Unauthorized overwrite of the
latesttag for container images or artifacts. - Deployment of untrusted or malicious images in environments that pull
:latestby default. - Integrity loss of image repositories and associated supply-chain pipelines.
- Potential distribution of compromised workloads to downstream users or clusters.
General mitigation guidance
Effective mitigation generally focuses on tightening authorization semantics and reducing reliance on special cases in access control logic.
Useful patterns include:
- Ensuring authorization checks derive required actions (create vs. update) strictly from repository state and request target, without exceptions for specific tags like
latest. - Applying a consistent policy where any overwrite of an existing tag is treated as an update operation requiring explicit update permissions.
- Reducing or avoiding reliance on the
latesttag in production, favoring immutable, content-addressable references (digests) or versioned tags. - Implementing defense-in-depth through additional controls such as registry-side tag immutability policies, approval workflows, and image signing/verification to guard against unauthorized changes.
- Adopting least-privilege access models so that accounts used for CI/CD or automation have only the minimal tag creation and update rights required.
How teams detect issues like this
Organizations can approach detection from both code and operational perspectives:
- Static analysis & code review: Look for authorization middleware that infers operation type using default values or special handling for certain tag names (e.g.,
latest) instead of consistently checking object existence. - Policy review: Examine RBAC and access policies for mismatches between documented expectations (e.g., no overwrite of certain tags) and the actual enforcement logic.
- Runtime monitoring: Instrument the registry to log manifest PUT operations, including tag name, actor identity, and whether the tag previously existed, then alert on overwrites performed by principals lacking update permissions.
- Automated checks: Use security testing tools or custom integration tests that simulate users with create-only rights and validate that they cannot overwrite existing tags, especially
latest.

