Summary
A broken authorization check in zot's bearer authentication flow treats DELETE requests like push operations instead of verifying separate delete permissions. A remote attacker with a bearer token limited to pull and push actions may delete manifests and blobs within the token's repository scope, making images unavailable and altering repository history.
Affected context
The issue occurs in zot deployments that use bearer-token authentication and repository-scoped permissions. DELETE requests can bypass the fine-grained authorization path, while manifest and blob deletion handlers do not perform an independent delete-permission check. The exposure depends on an attacker obtaining a valid token with access to the affected repository scope.
Exploit preconditions
- Attack surface: Remote HTTP API endpoints for manifest and blob deletion
- Required access: A valid bearer token with pull and push permissions for a repository
- Trigger point: A DELETE request handled by the bearer authentication flow
- Why exploitation is possible: Methods other than GET and HEAD are classified as push actions, and bearer-authenticated requests can bypass the distinct delete-authorization path
Why this happens
The underlying bug is an authorization decision based on an incomplete mapping between HTTP methods and repository actions. Because DELETE is grouped with push operations rather than mapped to a distinct delete permission, a token authorized for pushing can reach deletion handlers without an independent authorization check. This is consistent with CWE-285, Improper Authorization, where access-control logic fails to enforce the permissions required for a sensitive operation.
Potential impact
- Unauthorized users may delete image manifests or blobs.
- Images may become unavailable to consumers.
- Repository history could be altered or weakened.
- Downstream deployments may fail when referenced artifacts are removed.
- Supply-chain integrity and artifact retention policies could be undermined.
General mitigation guidance
Mitigation typically focuses on enforcing operation-specific authorization at
every sensitive endpoint.
Common defensive patterns include:
- Map each HTTP method to its exact required repository action, including a distinct delete permission.
- Apply the same fine-grained authorization policy to bearer-authenticated and other request paths.
- Perform independent permission checks in manifest and blob deletion handlers.
- Use deny-by-default authorization and grant deletion only to narrowly scoped identities.
- Limit bearer-token scope, lifetime, and privileges according to operational need.
- Preserve immutable or protected artifact policies where deletion is not required.
- Treat authorization decisions as security boundaries rather than relying solely on upstream routing.
How teams detect issues like this
Organizations can identify similar authorization flaws through:
- Static analysis and policy checks for HTTP-method mappings that collapse DELETE into write or push actions.
- Code review of authentication middleware, authorization bypass branches, and sensitive handler entry points.
- Tests verifying that pull-only and push-only credentials cannot perform deletion operations.
- Negative authorization tests covering every authentication mechanism and repository scope.
- Runtime monitoring for DELETE requests, especially when issued by tokens lacking explicit delete permissions.
- Policy enforcement requiring independent authorization checks for destructive API operations.
- Automated security review tools that flag missing permission checks and inconsistent authorization paths.

