Skip to content

transport: block unspecified IPs (0.0.0.0, ::) in validateRealmURL#2285

Merged
Subserial merged 2 commits into
google:mainfrom
marwan9696:fix-realm-ssrf-unspecified
Apr 30, 2026
Merged

transport: block unspecified IPs (0.0.0.0, ::) in validateRealmURL#2285
Subserial merged 2 commits into
google:mainfrom
marwan9696:fix-realm-ssrf-unspecified

Conversation

@marwan9696

Copy link
Copy Markdown
Contributor

validateRealmURL checks IsLoopback, IsPrivate, IsLinkLocalUnicast,
and IsLinkLocalMulticast but not IsUnspecified. On Linux and macOS,
0.0.0.0 resolves to 127.0.0.1, so a malicious registry can redirect
auth requests to localhost by setting realm to https://0.0.0.0:PORT.

Add ip.IsUnspecified() to the existing check.

Fixes #2284

validateRealmURL checks IsLoopback, IsPrivate, IsLinkLocalUnicast,
and IsLinkLocalMulticast but not IsUnspecified. On Linux and macOS,
0.0.0.0 resolves to 127.0.0.1, so a malicious registry can redirect
auth requests to localhost by setting realm to https://0.0.0.0:PORT.

Add ip.IsUnspecified() to the existing check.
@google-cla

google-cla Bot commented Apr 30, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@marwan9696

Copy link
Copy Markdown
Contributor Author

CLA signed. Please re-check.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.85%. Comparing base (2d86301) to head (97e5346).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2285      +/-   ##
==========================================
+ Coverage   56.82%   56.85%   +0.03%     
==========================================
  Files         166      166              
  Lines       11279    11279              
==========================================
+ Hits         6409     6413       +4     
+ Misses       4103     4100       -3     
+ Partials      767      766       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Subserial Subserial merged commit 5cfc2a4 into google:main Apr 30, 2026
17 checks passed
Subserial pushed a commit to Subserial/go-containerregistry that referenced this pull request May 15, 2026
…oogle#2285)

* transport: block unspecified IPs (0.0.0.0, ::) in validateRealmURL

validateRealmURL checks IsLoopback, IsPrivate, IsLinkLocalUnicast,
and IsLinkLocalMulticast but not IsUnspecified. On Linux and macOS,
0.0.0.0 resolves to 127.0.0.1, so a malicious registry can redirect
auth requests to localhost by setting realm to https://0.0.0.0:PORT.

Add ip.IsUnspecified() to the existing check.

* trigger CLA re-check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

transport: validateRealmURL SSRF bypass via 0.0.0.0 (unspecified address)

3 participants