Repository navigation
fix(security): remove pre-flight resolve paths for egress - #2845
Merged
Merged
Conversation
…hecks call vet_addresses, and the docs say every http client is checked at the connect Remove pre-flight DNS and SSRF resolution paths in favor of connect-time egress enforcement. Kept pre-flight checks (docker engine, config wizard, k8s manifest URL, and qdrant URL) now call vet_addresses. Add transport parameter to new_http_client and new_async_http_client. Add ast-grep rules and tests to prevent raw HTTP client instantiation and pre-flight resolve paths. Update documentation to clarify connect-time egress checking. Closes #2437
dan-petty
marked this pull request as ready for review
October 31, 2026 07:39
…ht-resolve-paths-go # Conflicts: # src/devops_cli/commands/k8s/cluster_context.py # tests/ai/client/test_ollama_dynamic_leasing.py
dan-petty
pushed a commit
that referenced
this pull request
Oct 31, 2026
🤖 I have created a release *beep* *boop* --- ## [0.26.1](v0.26.0...v0.26.1) (2026-10-31) ### Bug Fixes * **ci:** allow only declared scopes in pull request titles ([#2846](#2846)) ([f6aea38](f6aea38)), closes [#2800](#2800) * **security:** remove pre-flight resolve paths for egress ([#2845](#2845)) ([6ebc968](6ebc968)), closes [#2437](#2437) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
This was referenced Nov 1, 2026
dan-petty
added a commit
that referenced
this pull request
Nov 1, 2026
<!-- claude-projects-attribution: {"github_login":"dan-petty"} -->
_Requested by **D** · [project
thread](https://claude.ai/code/project/chan_012AN6yqDPaw2ALcEb3GvKNZ?thread=cmsg_012AN6yqDPaw2ALcEb3GvKNZAsn3P8zcUBU81CBBS6sGhU)_
`parse_numeric_ip` reads an address literal with `ipaddress.ip_address`,
an IPv6 zone ID included. It reads a legacy IPv4 spelling, such as
`0177.0.0.1`, `127.1` or `2130706433`, with `socket.getaddrinfo(host,
None, flags=socket.AI_NUMERICHOST)`. The C library reads the host by the
rules of the resolver and makes no DNS query. The call catches `OSError`
and `UnicodeError`, because a long label makes `getaddrinfo` raise
`UnicodeEncodeError`.
The hand-written parser (`_parse_part`, `_combine_ipv4_parts`,
`_parse_legacy_ipv4`) is deleted, and with it the two branches that
could not run. The repeated metadata check of the issue was already
deleted with `validate_url` (#2845). The DNS seam of #1314 is still
open, so the call goes to `socket.getaddrinfo` directly.
Spellings that only Python read as numbers (`0b11.1`, `1_0.0.0.1`,
`+1.2.3.4`, Arabic-Indic digits, a trailing space) now give no address,
as a resolver reads them as names. `127。0。0。1` now gives `127.0.0.1`, as
a resolver reads it. `is_loopback_or_private_host` refuses every one of
these hosts before and after.
New tests in `tests/core/test_numeric_hosts.py` and
`tests/security/test_reference_address_classes.py` pin the octal,
three-part and zone-ID forms, the metadata address with a zone ID, and
the unparsable-is-private default. The test doubles of `getaddrinfo` in
`tests/web_fakes.py` and the two reference tests pass a call with
`AI_NUMERICHOST`, which makes no DNS query, and still fail on any other
call.
Closes #2152
Change:
`openspec/changes/archive/2026-11-01-2152-the-egress-checks-read-legacy-numeric/`
---
_Generated by [Claude
Code](https://claude.ai/code/session_01PeiMDmFc95FzHYeE9XSjKp)_
---------
Co-authored-by: Claude <[email protected]>
This was referenced Nov 2, 2026
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.
Description
This pull request completes part 5 of issue #1381.
Verification
Closes #2437