Skip to content

fix(poster-cache): resolve the proxy host normally in pinned agents - #915

Open
feruzabad wants to merge 1 commit into
cedya77:devfrom
feruzabad:fix/poster-cache-proxy-lookup
Open

feruzabad wants to merge 1 commit into
cedya77:devfrom
feruzabad:fix/poster-cache-proxy-lookup

Conversation

@feruzabad

@feruzabad feruzabad commented Nov 15, 2026 •

Copy link
Copy Markdown

Summary

With HTTPS_PROXY set, 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

  • Bug fix
  • New feature
  • Refactor
  • Tests only
  • Documentation only
  • CI / tooling

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 openImageStream through a local CONNECT proxy reached as localhost:

  • before: connect ETIMEDOUT <tmdb IP>:<proxy port>, no tunnel opened

  • after: 200, tunneled to image.tmdb.org:443

  • direct (no proxy) still 200; a private host is still refused

  • build:backend and eslint pass

  • I ran existing tests relevant to this change.

  • I added or updated tests where needed.

  • No tests were needed, and I explained why.

Documentation

  • I updated documentation or comments where needed.
  • No documentation updates were needed.

Author checklist

  • This PR is focused on one concern.
  • This PR is reasonably small and reviewable.
  • I read and followed CONTRIBUTING.md.
  • I can explain every code change in this PR.
  • I will respond to review feedback myself.

AI usage disclosure

  • No AI tools were used.
  • AI tools were used for part of this PR, and I personally reviewed and verified all changes.

If AI tools were used, briefly describe how: AI tools helped trace the bug and write the fix; I verified it as described above.

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).
@github-actions

Copy link
Copy Markdown
Contributor

PR Guard

  • All automated intake checks passed.

Maintainers may still close PRs that do not match project direction or review capacity.

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.

[BUG] Poster cache returns 502 for uncached images when HTTPS_PROXY is set

1 participant