/

CVE-2026-31801

Severity:

HIGH RISK

(7.7)

Incorrect Authorization in zot OCI Registry

CVE-2026-31801

Analyzed

Vulnerability type

Category:

Incorrect Authorization

CWE:

CWE-863

Impact:

Unauthorized Modification of Container Images

Severity:

HIGH RISK

(7.7)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

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 latest manifest; the user targets an overwrite of latest.
  • 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 overwriting latest.

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 latest tag for container images or artifacts.
  • Deployment of untrusted or malicious images in environments that pull :latest by 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 latest tag 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.

Sources

SourceLink
github.comgithub.com/project-zot/zot/security/advisories/GHSA-85jx-fm8m-x8c6

Frequently asked

questions

Exploitability is limited to authenticated users or systems that already have create permissions but lack update permissions; they can abuse this flaw to overwrite latest in affected zot versions when that tag is present.

No. The issue can be triggered by any principal with create rights on the repository, even if they are explicitly denied update rights; no administrative privileges are required.

The fix pattern is to align authorization decisions with the true operation semantics: any attempt to overwrite an existing tag—latest included—must be classified as an update and checked against update permissions, with no special-case bypasses.

Preventive strategies include designing access control around clear, centralized policies; avoiding special-case logic for specific identifiers; adding regression tests for each permission boundary; and incorporating security-focused code review and automated policy tests into the development pipeline.

Find out what's already
exploitable in your codebase.