Skip to content

Reject non-https download URLs from registry metadata#15

Merged
andrew merged 1 commit intomainfrom
validate-metadata-urls
Apr 13, 2026
Merged

Reject non-https download URLs from registry metadata#15
andrew merged 1 commit intomainfrom
validate-metadata-urls

Conversation

@andrew
Copy link
Copy Markdown
Contributor

@andrew andrew commented Apr 8, 2026

resolveFromMetadata reads download_url and tarball from the registry's JSON response and hands them straight to the fetcher. A compromised or MITM'd registry could return file:///etc/passwd or http://169.254.169.254/latest/meta-data/ and we'd fetch it.

Now requires scheme https and a non-empty host before returning the ArtifactInfo. Anything else gets ErrUnsafeURL.

This doesn't check IP ranges. That defense belongs in the fetcher's dialer where DNS rebinding can't sneak past it, and would also cover URLs from URLBuilder.Download() and the template paths in resolveWithoutRegistry. Separate change.

@andrew andrew merged commit b5d86c5 into main Apr 13, 2026
2 checks passed
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