Repository navigation
Conversation
The pinned lookup answered every hostname with the image host's addresses. axios copies the https agent's options, lookup included, into its CONNECT tunnel agent, so with HTTPS_PROXY set the tunnel dialed <image host IP>:<proxy port> and every uncached image failed with a 502 (connect ETIMEDOUT).
Contributor
PR Guard
Maintainers may still close PRs that do not match project direction or review capacity. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
With
HTTPS_PROXYset, every uncached poster-cache image failed with a 502. The pinned DNS lookup answered every hostname with the image host's addresses, and axios reuses that lookup in its CONNECT tunnel agent, so it dialed<image host IP>:<proxy port>. The lookup now pins only the validated host and resolves other names normally.Linked issue
Closes #914
Type of change
Why this approach
Smallest change that keeps the SSRF pinning intact: the image host is still dialed only at its validated addresses, and the proxy is operator-configured.
Testing
The repo has no test suite, so I used a script that runs
openImageStreamthrough a local CONNECT proxy reached aslocalhost:before:
connect ETIMEDOUT <tmdb IP>:<proxy port>, no tunnel openedafter: 200, tunneled to
image.tmdb.org:443direct (no proxy) still 200; a private host is still refused
build:backendand eslint passI ran existing tests relevant to this change.
I added or updated tests where needed.
No tests were needed, and I explained why.
Documentation
Author checklist
CONTRIBUTING.md.AI usage disclosure
If AI tools were used, briefly describe how: AI tools helped trace the bug and write the fix; I verified it as described above.