Skip to content

fix(security): reference_extractor classifies addresses with ipaddress, and the sandbox local whitelist stops mapping host.docker.internal to pod loopback #1174

Closed

Description

@dan-petty

Ready: implementation plan (refined 2026-10-17 at 3dd7fa6)

This section supersedes any text below that conflicts with it.

Decisions

  • Key question 1 (classification): accept the stdlib classes. Every valid, specified address falls into exactly one class. It is documentation if it is in the documentation constant below. It is public if is_global and not is_reserved and not is_multicast holds and it is not in the 192.88.99.0/24 constant below. Every other address is local, and the unspecified addresses stay rejected as today. The RFC tables at src/devops_cli/security/reference_extractor.py:45-74 are deleted. With today's tables, an address in no class falls through check_threat_intel to the Cloudflare Radar domain lookup. Measured at 3dd7fa6: 224.0.0.1, 239.1.2.3 and ff02::1 are neither public, local nor example, so CloudflareRadarClient.check_domain sends them to /domain/<ip> (src/devops_cli/security/vulnerability_lookup.py:537-549, :458). Without a partition, 100.64.0.1 would join them.
  • The documentation constant: one closed tuple of ipaddress.ip_network objects, CONST_DOCUMENTATION_IP_NETWORKS, in src/devops_cli/config/constants.py, with each RFC cited. It holds 192.0.2.0/24, 198.51.100.0/24 and 203.0.113.0/24 (RFC 5737); 2001:db8::/32 (RFC 3849); 3fff::/20 (RFC 9637); 198.18.0.0/15 (RFC 2544); and 2001:2::/48 (RFC 5180). The stdlib folds these into is_private, so no library tells a documentation address from an RFC 1918 one. ipaddress objects, not strings, are the form feat(ci): hand-rolled URL and address parsing fails devops ci, AGENTS.md makes the library the rule, and reviews stop discarding the findings #1107's rules accept.
  • RFC 9637 (3fff::/20): it is in the documentation constant, so 3fff::1 is reported as a documented example, like 2001:db8::1. Today it is reported as local. Python 3.14.7 already reads it as private and not global, so it was never public; RFC 9637 reserves it for documentation, and IANA lists it as "Documentation".
  • 192.88.99.0/24: it stays non-public and is reported as local, through a second one-entry constant, CONST_NON_GLOBAL_NETWORKS_STDLIB_READS_GLOBAL, in src/devops_cli/config/constants.py, which cites RFC 7526 and RFC 6751. A test pins that ipaddress.ip_address("192.88.99.2").is_global is still True, so the constant is deleted when CPython follows IANA. IANA's IPv4 special-purpose registry lists the /24 as "Deprecated (6to4 Relay Anycast)" with no reachability values, and its one live entry, 192.88.99.2/32 (RFC 6751), as "Globally Reachable: False". Python 3.14.7 still reads the whole block as global. Sending it to Shodan would rest on a stdlib gap, so the stricter answer wins.
  • The other blocks that become public: 192.0.0.9, 192.0.0.10, 2001:1::1, 2001:1::2, 2001:3::/32, 2001:4:112::/48, 2001:20::/28 and 2001:30::/28. They are accepted as public, so Shodan may look them up. IANA marks each one "Globally Reachable: True", and none carries an internal address. A cross-check of both IANA special-purpose registries (CSV, fetched 2026-10-17) against this rule on Python 3.14.7 disagrees in the public direction only for 192.88.99.0/24 and 192.88.99.2/32. The other differences (64:ff9b::/96, 2001:1::3/128) make an address local, which is the safe side.
  • is_example_or_reserved_ip: deleted, with its export in src/devops_cli/security/__init__.py. Its callers use is_example_ip. is_private_or_local_ip becomes "specified, not documentation and not public". Reserved space is now local, not "example", so the two-predicate split has nothing left to carry. Pre-1.0, so there is no alias.
  • What shifts (the changelog fragment lists it): 0.0.0.0/8, 100.64/10, 192.0.0/24 (except .9 and .10), 192.88.99/24, 240/4, 255.255.255.255, 100::/64, 2002::/16 and the rest of 2001::/23 (Teredo 2001::/32 and the deprecated ORCHID 2001:10::/28 among them; 2001:2::/48 stays documentation) move from "Documented Example" to local. 192.0.0.9, 192.0.0.10, 2001:1::1, 2001:1::2, 2001:3::/32, 2001:4:112::/48, 2001:20::/28 and 2001:30::/28 move from "Documented Example" to public. 3fff::/20 moves from local to "Documented Example". Multicast moves from no class (sent to Radar) to local.
  • The message at src/devops_cli/ai/tools/builtin_tools.py:461-463 names exactly what is_example_or_invalid_network_target excludes: example domains (RFC 2606, RFC 6761), documentation addresses (RFC 5737, RFC 3849, RFC 9637) and benchmarking addresses (RFC 2544, RFC 5180). RFC 6890 is dropped from it.
  • Key question 2, host.docker.internal: it is refused in _validate_local_whitelist_item (src/devops_cli/sandbox/models.py:155), before is_loopback_or_private_host. The message asks for the IP or CIDR that the cluster reaches the host on. The name is a new CONST_DOCKER_HOST_GATEWAY_HOSTNAME in src/devops_cli/config/constants.py, compared with dns.name.from_text equality, which ignores case and the trailing dot. A host that dnspython cannot parse is not that name, so it falls through to the existing checks. That follows CONST_CLOUD_METADATA_DNS_HOSTNAMES (constants.py:2235, compared at core/validation.py:65-66 and :142), so there is no hand-rolled lower().rstrip("."). Refusing at validation means the name never reaches getaddrinfo, even after fix(security): local names come from the public suffix list, and domains match on DNS labels, not string suffixes #887 lets names with no public suffix through is_loopback_or_private_host. On the workstation the name resolves to the container runtime's gateway (169.254.1.2 under rootless Podman), which a cluster pod cannot reach.
  • Key question 2, localhost, and with it every loopback entry: a loopback entry emits no egress rule at all. That covers the name localhost and any loopback address or network, such as 127.0.0.1 or ::1/128. _resolve_local_host returns [] for it, using is_loopback_host (core/validation.py:70) for names and addresses and ip_network(...).is_loopback for CIDRs. _build_whitelist_egress skips any entry whose resolution is empty. NetworkPolicy never polices pod loopback, so an ipBlock for it is a no-op. A rule with to: [] would allow every destination on that port. The guard sits in the one function that builds the rules, so no resolver can ever produce to: [].
  • No DNS lookup is added to the policy builder. Loopback entries and host.docker.internal are settled before _resolve_local_dns.
  • The two RFC 1918 fixture addresses this PR touches in tests/test_sandbox_networking.py (:48-49, and the expected rules at :250-251) become RFC 5737 addresses (192.0.2.50 and 198.51.100.5), which the stdlib also classes private. AGENTS.md keeps RFC 1918 literals out of tests.

Delivery

  1. PR 1 (M): the classification, both constants, the message, the whitelist changes, the test updates and changelog.d/1174.md. Closes fix(security): reference_extractor classifies addresses with ipaddress, and the sandbox local whitelist stops mapping host.docker.internal to pod loopback #1174. Tests first:

    • a parametrised address-to-class table asserting that exactly one of is_example_ip, is_public_ip and is_private_or_local_ip is True for each specified address. It covers 8.8.8.8 and 2606:4700::1 (public); 192.0.2.1, 198.18.0.1, 2001:db8::1, 2001:2::1 and 3fff::1 (documentation); the RFC 1918 addresses already used at tests/test_reference_extractor.py:21-23, 100.64.0.1, 192.0.0.1, 192.88.99.1, 240.0.0.1, 255.255.255.255, 224.0.0.1, ff02::1, 100::1, 2001::1 and 2002:a00:1::1 (local); 192.0.0.9, 2001:1::1 and 2001:4:112::1 (public); and the pitfall addresses 64:ff9b::a00:1, 4000::1 and 5f00::1 (local, because reserved);
    • ipaddress.ip_address("192.88.99.2").is_global is True (the guard for the gap constant);
    • check_threat_intel for 224.0.0.1, 100.64.0.1 and 192.88.99.1 making no HTTP request, with the Shodan and Radar clients' _client.get patched to fail;
    • the new message text;
    • local_whitelist=["host.docker.internal"] and ["HOST.DOCKER.INTERNAL."] raising the refusal at model validation, with socket.getaddrinfo patched to fail;
    • local_whitelist=["http://localhost:11434"], ["127.0.0.1"] and ["[::1]:8080"] each producing an egress list of only the kube-dns rule;
    • _build_whitelist_egress(["example.com"], lambda host: []) returning only the kube-dns rule;
    • every rule in every whitelist policy in _WHITELIST_POLICIES having a non-empty to.

    Files: src/devops_cli/config/constants.py, src/devops_cli/security/reference_extractor.py, src/devops_cli/security/vulnerability_lookup.py, src/devops_cli/security/__init__.py, src/devops_cli/ai/tools/builtin_tools.py, src/devops_cli/sandbox/models.py, tests/test_reference_extractor.py, tests/test_vulnerability_lookup.py, tests/test_builtin_tools.py, tests/test_sandbox_networking.py, changelog.d/1174.md, and a new task file docs/agent/tasks/task-1174-address-classes-and-local-whitelist.md (**Status**: Done).

Acceptance criteria

  • src/devops_cli/security/reference_extractor.py holds no RFC tables. CONST_DOCUMENTATION_IP_NETWORKS and CONST_NON_GLOBAL_NETWORKS_STDLIB_READS_GLOBAL in src/devops_cli/config/constants.py are the only address constants the classification reads, both as ipaddress objects with their RFCs cited.
  • is_public_ip is is_global and not is_reserved and not is_multicast, outside 192.88.99.0/24 and outside the documentation constant.
  • Every specified address in the test table is in exactly one class. Multicast, 100.64.0.0/10 and 192.88.99.0/24 are local, and none of them reaches Shodan or Cloudflare Radar.
  • 3fff::1 is reported as "Documented Example". is_example_or_reserved_ip no longer exists in src or tests.
  • The message at ai/tools/builtin_tools.py:461-463 names RFC 2606, 6761, 5737, 3849, 9637, 2544 and 5180, and not RFC 6890.
  • host.docker.internal, in any case and with or without a trailing dot, is refused at SandboxNetworkConfig validation with a message asking for an IP or CIDR, and no DNS lookup happens.
  • Loopback entries (localhost, 127.0.0.1, [::1]) produce no egress rule. No generated NetworkPolicy rule has an empty or missing to. Neither name maps to 127.0.0.1/32.
  • Offline: every address in the new tests is a literal, and every test touching host.docker.internal or localhost patches socket.getaddrinfo to fail.
  • uv run devops ci passes within the 5-minute budget. changelog.d/1174.md lists the report-class shifts above and the new host.docker.internal and loopback handling; CHANGELOG.md and docs/ROADMAP.md are not edited.

Current references

  • RFC tables: src/devops_cli/security/reference_extractor.py:45-74; is_example_ip :102-111; is_example_or_reserved_ip :114-125; is_example_or_invalid_network_target :168-195; is_public_ip :198-215; is_private_or_local_ip :218-229; _is_url_local_host :444-450; _extract_url_reference example tag :481; _extract_ip_reference :504-545 (example tag :517, public :520, local :531); _TLD_EXTRACTOR (which fix(security): local names come from the public suffix list, and domains match on DNS labels, not string suffixes #887 replaces) :37
  • Exports: src/devops_cli/security/__init__.py:22-29 and :74-82
  • Shodan gate and summary: src/devops_cli/security/vulnerability_lookup.py:314-319; Radar gates :354-361, :531-541; Radar HTTP request :458
  • Threat-intel message and Shodan branch: src/devops_cli/ai/tools/builtin_tools.py:459-466
  • Local whitelist tuple: src/devops_cli/sandbox/models.py:162-165 (in _validate_local_whitelist_item :155-168); localhost/host.docker.internal → 127.0.0.1/32 mapping :268-269 (in _resolve_local_host :266-280); _build_whitelist_egress :283-299; _resolve_local_dns :242-263
  • is_loopback_host: src/devops_cli/core/validation.py:70; is_loopback_or_private_host: :255; the dns.name comparison pattern :65-66, :142; CONST_CLOUD_METADATA_DNS_HOSTNAMES: src/devops_cli/config/constants.py:2235
  • Tests: tests/test_reference_extractor.py:17-24 and :857-995 (special IPs :918-930, filtered benchmark :992); tests/test_sandbox_networking.py:44-52 (fixture with host.docker.internal), :240-254 (expected loopback ipBlocks at :249 and :252), :636 (127.0.0.1/32 on 11434); tests/test_builtin_tools.py:257-261

Dependencies and order


Problem

Split from #897 (owner decision, 2026-10-04: one issue = one PR). This is #897's former PR2 scope: two hand-rolled constructs whose fix changes output and behaviour, so each needs an owner decision. Lines cited at b61e5a0 (release/v0.2.26) unless stated.

  • RFC tables. security/reference_extractor.py was rewritten by fix(security): network references come from url and ip syntax, not identifier-prefix and property-suffix lists #431 (merged, v0.2.26). Its RFC tables are at :45-74. They are read by is_example_or_reserved_ip (:115), is_public_ip (:199) and is_private_or_local_ip (:219).
  • A wrong host-gateway mapping. sandbox/models.py:213-214 maps host.docker.internal (and localhost) to 127.0.0.1/32, and :129-132 accepts both names in the local whitelist.
    • The host gateway is not the pod's loopback.
    • A 127.0.0.1/32 ipBlock does nothing, because NetworkPolicy never polices pod loopback.
    • Resolving the name on the workstation is no fix either: in a rootless Podman container, /etc/hosts maps it to 169.254.1.2, a link-local address the metadata guard refuses.
  • Pitfall (measured in fix(security): egress guards refuse cloud metadata in every numeric, NAT64 and provider form, classified by ipaddress and one maintained library #897). is_global does not imply not is_reserved or not is_multicast. 64:ff9b::a00:1 (the NAT64 form of an RFC 1918 address) and 4000::1 are global and reserved, and 224.0.0.1 is global and multicast. is_public_ip gates Shodan InternetDB lookups (security/vulnerability_lookup.py:315, ai/tools/builtin_tools.py:460). Dropping those terms would send wrapped internal addresses to a third party.

Acceptance criteria

  • The reference_extractor RFC tables (security/reference_extractor.py:45-74) are replaced as key question 1 decides. is_public_ip keeps not is_reserved and not is_multicast.
  • The RFC list in the message at ai/tools/builtin_tools.py:456 matches the new classes.
  • host.docker.internal and localhost in the sandbox local whitelist (sandbox/models.py:129-132, :213-214) are handled as key question 2 decides. Neither name maps to 127.0.0.1/32, and no DNS lookup is added to the policy builder.
  • Tests updated: tests/test_sandbox_networking.py:174-197 and tests/test_reference_extractor.py:1019-1031 and :1093 (cited at dcafadf; re-check when refined, since fix(security): network references come from url and ip syntax, not identifier-prefix and property-suffix lists #431 rewrote the module).
  • Offline: every address is a literal, and no test makes an unpatched non-numeric lookup.
  • uv run devops ci passes within the 5-minute budget. A changelog.d fragment named for this issue lists the report-class changes and the new host.docker.internal handling. CHANGELOG.md and docs/ROADMAP.md are not edited.

Key questions

  1. What about reference_extractor's classification shift? (was fix(security): egress guards refuse cloud metadata in every numeric, NAT64 and provider form, classified by ipaddress and one maintained library #897 key question 4; owner decision when this item is refined) Proposed:
    • Accept the stdlib classes, keeping not is_reserved and not is_multicast in is_public_ip.
    • Keep one closed constant of ip_network objects for the documentation and benchmarking ranges (RFC 5737, RFC 3849, RFC 9637, RFC 2544, RFC 5180), with the RFCs cited. The stdlib folds these ranges into is_private, and no library tells a documentation address from an RFC 1918 one. This is the one address constant the item would keep, so it is weighed against the rule decided in fix(security): egress guards refuse cloud metadata in every numeric, NAT64 and provider form, classified by ipaddress and one maintained library #897's key question 1 (reputable libraries, never literal address sets).
    • What shifts: without the tables, 0.0.0.0/8, 100.64/10, 192.0.0/24, 198.18/15, 240/4, 255.255.255.255, 100::/64, 2002::/16 and parts of 2001::/23 change report class. The RFC list in the message at ai/tools/builtin_tools.py:456 changes with them.
  2. What happens to host.docker.internal and localhost in the local whitelist? (was fix(security): egress guards refuse cloud metadata in every numeric, NAT64 and provider form, classified by ipaddress and one maintained library #897 key question 5; owner decision when this item is refined) Proposed:
    • Refuse host.docker.internal with a message asking for an IP or CIDR.
    • localhost emits no ipBlock, because pod loopback is never policed.
    • No DNS lookup is added to the policy builder.

Dependencies

Strategic alignment

Update 2026-10-08: refinement

Both defects stand; #897 landed. Test lines moved: tests/test_reference_extractor.py:918-930 and :992; tests/test_sandbox_networking.py:174-197 is unchanged. Whichever of this item and #887 lands second drops sandbox/models.py:129-132. Both key questions wait for the owner.

Proposed design

Problem statement

The security reference extractor uses hand-rolled RFC tables that are inconsistent with standard IP classification libraries. Additionally, the sandbox local whitelist incorrectly maps host.docker.internal to pod loopback, which is not a valid network policy action.

Acceptance criteria

  • Criterion 1: The reference_extractor RFC tables are replaced with standard library classes while maintaining is_public_ip's gate of not is_reserved and not is_multicast.
    Verification: Verify that security/reference_extractor.py uses ipaddress module classes instead of hand-rolled tables, and that is_public_ip still excludes reserved and multicast addresses.
  • Criterion 2: The RFC list in the message at ai/tools/builtin_tools.py:456 matches the new IP address classifications.
    Verification: Check that ai/tools/builtin_tools.py contains an updated RFC list reflecting the new classification rules from reference_extractor.
  • Criterion 3: host.docker.internal and localhost are handled correctly in the sandbox local whitelist without mapping to 127.0.0.1/32.
    Verification: Ensure sandbox/models.py does not map host.docker.internal or localhost to 127.0.0.1/32, and no DNS lookup is added to the policy builder.
  • Criterion 4: Tests are updated to reflect the new behavior of reference_extractor and sandbox local whitelist.
    Verification: Run tests/test_sandbox_networking.py:174-197 and tests/test_reference_extractor.py:1019-1031 to verify they pass with updated expectations.
  • Criterion 5: No network lookups are performed during testing, ensuring offline execution.
    Verification: Confirm that no unpatched DNS or IP resolution occurs in test environments by checking for literal addresses only.

Key questions

Open questions

  • Accept the stdlib classes, keeping not is_reserved and not is_multicast in is_public_ip.
  • Keep one closed constant of ip_network objects for the documentation and benchmarking ranges (RFC 5737, RFC 3849, RFC 9637, RFC 2544, RFC 5180), with the RFCs cited. The stdlib folds these ranges into is_private, and no library tells a documentation address from an RFC 1918 one. This is the one address constant the item would keep, so it is weighed against the rule decided in fix(security): egress guards refuse cloud metadata in every numeric, NAT64 and provider form, classified by ipaddress and one maintained library #897's key question 1 (reputable libraries, never literal address sets).
  • What shifts: without the tables, 0.0.0.0/8, 100.64/10, 192.0.0/24, 198.18/15, 240/4, 255.255.255.255, 100::/64, 2002::/16 and parts of 2001::/23 change report class. The RFC list in the message at ai/tools/builtin_tools.py:456 changes with them.
  • Refuse host.docker.internal with a message asking for an IP or CIDR.
  • localhost emits no ipBlock, because pod loopback is never policed.
  • No DNS lookup is added to the policy builder.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    type/security
    scope/security
    priority/p1-high
    on Oct 4, 2026
  2. added this to the v0.2.37 milestone on Oct 11, 2026
  3. dan-petty commented on Oct 17, 2026

    @dan-petty
    OwnerAuthor

    Readiness check for v0.2.37, against release/v0.2.36 at 22d8748. Line numbers are at that commit.

    Status: ready after a reference refresh, once the owner signs off the two decisions in the body. One pull request (M).

    Today

    • The RFC tables are at src/devops_cli/security/reference_extractor.py:45-74.
    • The functions that read them:
      • is_example_ip (:103, uncited);
      • is_example_or_reserved_ip (:115);
      • is_public_ip (:199);
      • is_private_or_local_ip (:219).
    • src/devops_cli/sandbox/models.py:161-166 accepts both names, and :268-269 maps them to 127.0.0.1/32.
    • The pitfall still reproduces on Python 3.14.7.

    References that moved

    • models.py:129-132 → :161-166, and :213-214 → :267-269
    • src/devops_cli/ai/tools/builtin_tools.py:456 → :462, and :460 → :466
    • src/devops_cli/security/vulnerability_lookup.py:315 → :314
    • tests/test_sandbox_networking.py:174-197 → :236-252. The fixture at :45-52 and :636 also changes.

    Dependencies: #897 and #431 are closed. #887 (open) edits the same tuple (models.py:161-166); whichever lands second deletes it. #698's seccomp slice also edits sandbox/models.py.

    Gaps in the body

    • "localhost emits no ipBlock" is dangerous as written. _build_whitelist_egress (:283-298), given an empty list, produces to: [], which allows every destination on that port. The rule must be dropped entirely, and a test must assert that.
    • The host.docker.internal refusal belongs in _validate_local_whitelist_item (:155). Anywhere later, it falls through to getaddrinfo.
    • 192.88.99.0/24 is in today's table, but the standard library says is_global=True for it. Without the table it becomes public and is sent to Shodan. The body's "what shifts" list doesn't mention this.
    • RFC 9637 (3fff::/20) is not in today's tables.

    Plan, tests first

    1. Tests:
      • an address-to-class table, including the pitfall addresses, 192.88.99.1 and 100.64.0.1;
      • the refusal message;
      • localhost producing no rule;
      • getaddrinfo patched.
    2. Then change reference_extractor.py, the message at builtin_tools.py:462 and models.py, and add changelog.d/1174.md.
  4. added
    status/in-progress
    on Oct 17, 2026
  5. added a commit that references this issue on Oct 18, 2026
    25e2cda
  6. dan-petty commented on Oct 18, 2026

    @dan-petty
    OwnerAuthor

    What changed

    #1622, merged into release/v0.2.37 as 25e2cda.

    What changed and why

    security/reference_extractor.py kept hand-written RFC 6890 tables, and they left gaps: multicast (224.0.0.1, ff02::1) was in no class, so check_threat_intel and CloudflareRadarClient.check_domain sent it to Cloudflare Radar's domain lookup, and the tables could not tell documentation space from reserved space consistently. The tables are gone. Every specified address is now in exactly one of three classes read through Python's ipaddress: a documented example when it lies in CONST_DOCUMENTATION_IP_NETWORKS (RFC 5737, 3849, 9637, 2544, 5180); public when ipaddress reads it as global, not reserved and not multicast, outside CONST_NON_GLOBAL_NETWORKS_STDLIB_READS_GLOBAL (192.88.99.0/24 and the deprecated site-local fec0::/10, which CPython still reads as global although IANA does not); and local otherwise. An IPv4-mapped IPv6 address is classed as the IPv4 address it carries. A test pins that CPython still reads those two networks as global, so each can leave the constant when CPython follows IANA. is_example_or_reserved_ip is removed and its callers use is_example_ip.

    Every class now reads the address a target actually names (network_target_address): without trailing prose punctuation, as the host of a URL or host:port without its trailing dot, and in the legacy numeric spellings inet_aton reads (through core.validation.parse_numeric_ip, now public), with no DNS lookup. A target holding whitespace names no address, since gl…

    17 file(s) changed.

    How it was verified

    Check runs at 305071e:

    • Prune PR DevContainer Images: pass
    • Audit Defect PR Hardening: skipping
    • zizmor: pass
    • devops-cli: pass
    • bandit: pass
    • CodeQL: pass
    • Service Image: skipping
    • Rule Pack Tests: pass
    • Fail-to-Pass Self-Check: pass
    • Changed-Test Independence: pass
    • Tests & Coverage: pass
    • Analyze (python): pass
    • Fail-to-Pass Check: pass
    • Analyze (actions): pass
    • Static Analysis: pass
    • DevContainer Image: skipping
    • Dependency Freshness: skipping

    Acceptance Criteria of docs/agent/tasks/task-1174-address-classes-and-local-whitelist.md:

    • security/reference_extractor.py holds no RFC tables; CONST_DOCUMENTATION_IP_NETWORKS and CONST_NON_GLOBAL_NETWORKS_STDLIB_READS_GLOBAL are the only address constants the classification reads (test_every_specified_address_is_in_exactly_one_class).
    • is_public_ip is is_global and not is_reserved and not is_multicast, outside 192.88.99.0/24, fec0::/10 and the documentation constant; test_the_stdlib_still_reads_each_non_global_network_as_global reports when CPython follows IANA and a network of the second constant can go. ::ffff:192.88.99.2 is local and ::ffff:192.0.2.1 a documented example (test_every_specified_address_is_in_exactly_one_class).
    • Multicast, 100.64.0.0/10, 192.88.99.0/24 and fec0::/10 are local and reach neither Shodan nor Cloudflare Radar, and Radar answers 0.0.0.0, :: and http://0.0.0.0:8000 without a request (test_check_threat_intel_asks_no_service_about_a_local_address, test_shodan_answers_a_documentation_or_local_address_without_a_request, test_cloudflare_radar_answers_a_documentation_or_local_address_without_a_request).
    • 3fff::1 is reported as "Documented Example" (test_a_report_tags_documentation_space_as_an_example_and_reserved_space_as_local), and is_example_or_reserved_ip no longer exists in src or tests.
    • check_threat_intel's reply names RFC 2606, 6761, 5737, 3849, 9637, 2544, 5180, 1122 and 4291 and fictional phone numbers, and not RFC 6890, for 3fff::1, 555-0100, 0.0.0.0, ::, http://0.0.0.0:8000 and 3221225985 (192.0.2.1) alike (test_check_threat_intel_names_the_rfcs_of_every_target_it_excludes).
    • An address is classed without trailing prose punctuation, and a URL, host:port or inet_aton spelling names the address a resolver dials, with no lookup (test_an_address_is_classed_without_the_punctuation_prose_leaves_after_it, test_a_network_target_names_the_address_a_resolver_would_dial).
    • 100.64.0.1., 224.0.0.1,, 10.0.0.1., 2130706433 and http://100.64.0.1./v1 reach neither Shodan nor Radar, by check_threat_intel, CloudflareRadarClient.check_domain or its batch path; check_threat_intel replies that the target is a local address and no service was asked, and a public address with a trailing mark goes to Shodan as the bare address (test_check_threat_intel_asks_no_service_about_a_local_address, test_check_threat_intel_asks_shodan_about_the_address_the_target_names, test_cloudflare_radar_answers_a_documentation_or_local_address_without_a_request, test_cloudflare_radar_batch_sends_no_local_address).
    • Shodan's and Radar's static records name what the target is: a documentation or benchmarking address, an unspecified address, local network space, a fictional phone number, an example domain or a local domain, each with its RFCs (test_shodan_answers_a_documentation_or_local_address_without_a_request, test_cloudflare_radar_answers_a_documentation_or_local_address_without_a_request).
    • host.docker.internal, in any case and with or without a trailing dot, is refused at validation with a SandboxValidationError and no getaddrinfo call, even when the private-host check would admit it (test_the_host_gateway_name_is_refused_in_the_local_whitelist_without_a_lookup).
    • Loopback entries produce no egress rule, no rule has an empty or missing to, and neither name maps to 127.0.0.1/32 (test_a_loopback_entry_opens_no_egress_rule, test_a_loopback_host_or_network_resolves_to_no_address, test_an_entry_that_resolves_to_no_address_adds_no_rule, test_every_whitelist_rule_names_a_destination).
    • Offline: every address in the new tests is a literal, and the tests touching host.docker.internal or localhost patch socket.getaddrinfo to fail.
    • changelog.d/1174.md lists the report-class shifts and the host.docker.internal and loopback handling; CHANGELOG.md and docs/ROADMAP.md are not edited.
  7. added a commit that references this issue on Oct 20, 2026
    954914e
  8. removed
    status/in-progress
    on Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority/p1-highscope/securitytype/security

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions