Skip to content

fix(network-proxy): fail closed on network-proxy DNS lookup errors#15909

Merged
viyatb-oai merged 3 commits intomainfrom
codex/viyatb/review-bugb15982-dns-timeout
Mar 26, 2026
Merged

fix(network-proxy): fail closed on network-proxy DNS lookup errors#15909
viyatb-oai merged 3 commits intomainfrom
codex/viyatb/review-bugb15982-dns-timeout

Conversation

@viyatb-oai
Copy link
Copy Markdown
Collaborator

Summary

Fail closed when the network proxy's local/private IP pre-check hits a DNS lookup error or timeout, instead of treating the hostname as public and allowing the request.

Root cause

host_resolves_to_non_public_ip() returned false on resolver failure, which created a fail-open path in the allow_local_binding = false boundary. The eventual connect path performs its own DNS resolution later, so a transient pre-check failure is not evidence that the destination is public.

Changes

  • Treat DNS lookup errors/timeouts as local/private for blocking purposes
  • Add a regression test for an allowlisted hostname that fails DNS resolution

Validation

  • cargo test -p codex-network-proxy
  • cargo clippy -p codex-network-proxy --all-targets -- -D warnings
  • just fmt
  • just argument-comment-lint
@viyatb-oai viyatb-oai changed the title [codex] Fail closed on network-proxy DNS lookup errors Mar 26, 2026
@viyatb-oai viyatb-oai marked this pull request as ready for review March 26, 2026 21:16
Copy link
Copy Markdown
Contributor

@rreichel3-oai rreichel3-oai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@viyatb-oai viyatb-oai enabled auto-merge (squash) March 26, 2026 22:15
@viyatb-oai viyatb-oai merged commit aea82c6 into main Mar 26, 2026
60 of 62 checks passed
@viyatb-oai viyatb-oai deleted the codex/viyatb/review-bugb15982-dns-timeout branch March 26, 2026 23:18
@github-actions github-actions bot locked and limited conversation to collaborators Mar 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

2 participants