Skip to content

Bump addressable to 2.10.0 and pass docker host:port as authority - #5741

Open
Samze wants to merge 2 commits into
cloudfoundry:mainfrom
Samze:fix-docker-uri-converter-addressable-2.10
Open

Samze wants to merge 2 commits into
cloudfoundry:mainfrom
Samze:fix-docker-uri-converter-addressable-2.10

Conversation

@Samze

@Samze Samze commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Bump addressable 2.9.2 → 2.10.0 in the root Gemfile.lock.
  • Fix DockerURIConverter so it works with 2.10.0.

2.10.0 includes fixes for a batch of advisories published on 2026-12-01/02 (e.g. GHSA-qrq6-rcpx-pmm6, GHSA-mrrj-5mhw-rcf2, GHSA-xj9m-f88p-5j38, GHSA-xfg6-27c4-wr4r); all list 2.10.0 as the first patched version.

Why the code change is needed

UriUtils.parse_docker_uri returns the registry host together with its port (e.g. 10.244.2.6:8080). DockerURIConverter passed that as host: to Addressable::URI.new. 2.10.0 now rejects a colon in a host unless it is inside an IP literal:

Addressable::URI::InvalidURIError: A colon in a host must be inside the brackets of an IP literal: '10.244.2.6:8080'

This is what fails the five host:port examples in docker_uri_converter_spec.rb, and it is why the dependabot bump in #5710 is red.

Passing the value as authority: instead accepts host[:port] and gives identical output on 2.9.2 and 2.10.0 for valid image references (checked for 10.244.2.6:8080, foobar:8080, localhost, docker.io, [::1]:5000).

Malformed registry parts are handled differently by authority: than by host: (same on 2.9.2 and 2.10.0):

  • example.com:abc/image and example.com:/image now raise Addressable::URI::InvalidURIError (invalid port); host: serialized them as-is.
  • example.com:0/image drops the port and example.com:05000/image becomes :5000.
  • user:pass@example.com/image now serializes with the userinfo; host: raised InvalidURIError.

Valid references are unaffected. Such malformed references were already rejected downstream (BBS URL validation).

Testing

  • Added docker_uri_converter_spec.rb examples for the cases where authority: differs from host:: IPv6 with port, :0, :05000, non-numeric and empty ports, and userinfo.
  • Against 2.10.0, docker_uri_converter_spec.rb fails 5/16 without the change and passes 16/16 with it. I ran this on a downstream fork whose converter and spec are byte-identical to this repo's, not in this repo, so please rely on CI here.

Notes

🤖 Generated with Claude Code

addressable 2.10.0 validates the host component and rejects a colon
outside an IP literal. DockerURIConverter passed "host:port" as host:,
so converting any image reference with a registry port raised
Addressable::URI::InvalidURIError, which fails the host:port examples
in docker_uri_converter_spec.rb (and the dependabot bump in cloudfoundry#5710).

Pass the value as authority: instead, which accepts host[:port] and
yields the same output on 2.9.2 and 2.10.0.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@Samze
Samze marked this pull request as ready for review December 2, 2026 20:36
@Samze
Samze requested review from sethboyles and tcdowney December 2, 2026 20:36
Passing the registry as `authority:` changes behaviour for inputs the
existing examples do not exercise. Pin the current behaviour for IPv6
literals, zero and zero-padded ports, non-numeric and empty ports, and
userinfo.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant