Summary
An authorization bypass in an OCI registry's cross-repository blob mount can allow a restricted token to expose content from a private package in a public one. If the token owner can read the private source and write to a public package namespace, a private blob mounted into that namespace may become downloadable by anyone.
Affected context
The issue occurs in OCI registries that support cross-repository blob mounts and apply a public-only restriction to tokens. It becomes risky when the target package is checked against that restriction, but access to the source blob is instead evaluated using the token owner's broader account permissions.
Exploit preconditions
- Attack surface: The registry's cross-repository blob mount operation
- Required access: A
public-onlytoken withwrite:packagescope; its owner must be able to read the private source package and write to a public package namespace - Trigger point: A mount request that uses a private package as the blob source and a public package as the target
- Why exploitation is possible: The target is checked against the token restriction, while source access is checked against the owner's full account permissions
Why this happens
The authorization checks apply inconsistent permission contexts to the two sides of a cross-repository mount. Although the target package is checked against the token's public-only restriction, the source blob is checked against the token owner's broader account permissions. This is an authorization enforcement failure mapped to CWE-863: Incorrect Authorization.
Potential impact
- Private blobs, such as container layers, could be exposed through a public package
- Anyone with access to the public package may be able to download the mounted content
- Confidential data included in private package content could be disclosed
General mitigation guidance
Defensive patterns focus on applying the same effective authorization context to every resource involved in a mount.
- Enforce token restrictions when checking both source and target repositories
- Use secure-by-default authorization that denies cross-repository access unless explicitly permitted
- Reduce reliance on broad account permissions when evaluating restricted tokens
- Apply least privilege to package read and write capabilities
- Keep private and public package access policies distinct and consistently enforced
How teams detect issues like this
Review authorization logic for cross-repository operations, especially where source and target resources are checked by separate code paths. Static analysis and code review can look for permission checks that use account-level privileges where token-scoped restrictions should apply. Policy tests can verify that restricted tokens cannot expose private content through public namespaces, including checks for consistent authorization across all resources in a single operation.

