Skip to main content
HighInfo disclosureOWASP A07:2021CWE-306

How to fix: Docker Registry HTTP API V2 Open Without Authentication

The Docker-Distribution-Api-Version response header (registry/2.0) is present together with an empty '{}' JSON body and no WWW-Authenticate challenge, the exact success response the Docker Registry HTTP API V2 spec defines for a request to the API root that was allowed through without credentials.

Why it matters

An open registry root typically means /v2/_catalog and image manifest/blob endpoints are also reachable without credentials, letting anyone list and pull every private image in the registry, including any secrets, source code, or credentials baked into image layers.

A correctly secured Docker Registry V2 API responds to the same '/v2/' root request with a 401 status and a WWW-Authenticate: Bearer header describing the token endpoint. Responding with an open 200 and an empty JSON body means the registry has no authentication configured at all, or the reverse proxy in front of it is not enforcing it.

How to fix it

  1. 1Enable token authentication on the registry: set REGISTRY_AUTH to token (or htpasswd for a simpler setup) in the registry config.
  2. 2Never expose a registry to the internet without a reverse proxy that enforces authentication in front of it.
  3. 3Rotate any credentials or secrets that may have been baked into images if the registry was found open.
  4. 4Restrict network access to the registry to your CI/CD systems and internal network via a firewall or security group.

Code examples

Registry config.yml: require token auth

YAML
auth:
  token:
    realm: https://auth.example.com/token
    service: registry.example.com
    issuer: registry-token-issuer
    rootcertbundle: /certs/bundle.pem

Nginx in front of the registry: require basic auth

nginx
location /v2/ {
  auth_basic "Registry realm";
  auth_basic_user_file /etc/nginx/registry.htpasswd;
  proxy_pass http://localhost:5000;
}

References

Detected automatically by VulnRadar. The check id is docker-registry-v2-exposed, stable across every scan so you can filter or diff on it.

See every info disclosure check

Questions

How severe is Docker Registry HTTP API V2 Open Without Authentication?
VulnRadar rates this high severity in the info disclosure category. The severity is fixed per check, not scored per site, so the same finding is the same severity on every scan.
Does VulnRadar check for this automatically?
Yes. It runs as part of every scan under the check id docker-registry-v2-exposed, which stays the same between runs so you can filter, diff, or gate CI on it.
Which standards does Docker Registry HTTP API V2 Open Without Authentication map to?
It maps to CWE-306. In the OWASP Top 10 it falls under A07:2021.

Missing a check?

The detection set is open. If you know a misconfiguration this does not catch, propose it: the issue template asks for the threat model, how to detect it, the false-positive risk, and a test fixture, which is the same thing a maintainer would have to work out anyway.

Propose a checkHow a check is built

Scan your own site for docker registry http api v2 open without authentication

VulnRadar runs this check and hundreds more against a URL in seconds. No agent to install, just paste a URL.

Or scan this site as a demoRead the docs

Docker Registry HTTP API V2 Open Without Authentication | VulnRadar