Skip to content

docs(openspec): plan #2152 replace legacy IPv4 parser - #2971

Merged
dan-petty merged 1 commit into
mainfrom
refactor/2152-the-egress-checks-read-legacy-numeric
Nov 1, 2026
Merged

dan-petty merged 1 commit into
mainfrom
refactor/2152-the-egress-checks-read-legacy-numeric

Conversation

@devops-cli-service

Copy link
Copy Markdown
Contributor

Plans #2152

Replace the hand-written legacy IPv4 parser in core/validation.py with socket.getaddrinfo and the AI_NUMERICHOST flag. The C library parses all legacy forms (octal, hex, one-to-three-part, integer) without a DNS query. Delete _parse_part, _combine_ipv4_parts, _parse_legacy_ipv4, the repeated metadata check in _enforce_non_private_ssrf, and two unreachable branches. Add tests for octal, three-part, zone-ID, and unparsable-is-private forms. Existing tests for one-part, two-part, and hex forms still pass. No test starts a program or makes a DNS query.

Change: openspec/changes/2152-the-egress-checks-read-legacy-numeric/

@devops-cli-service
devops-cli-service Bot marked this pull request as ready for review November 1, 2026 01:13
@dan-petty
dan-petty merged commit 37561bc into main Nov 1, 2026
18 checks passed
@dan-petty
dan-petty deleted the refactor/2152-the-egress-checks-read-legacy-numeric branch November 1, 2026 01:22
dan-petty added a commit that referenced this pull request Nov 1, 2026
This change corrects the OpenSpec plan of #2152 in place. The Service
staged the plan in PR #2971. An evaluation on 2026-11-01 found defects
in it.

The corrected plan has three groups and no spec delta. Group 1 prepares
the test doubles for a call with AI_NUMERICHOST. Group 2 adds tests for
the legacy spellings. Group 3 makes parse_numeric_ip read a host as the
resolver does. The plan now names the existing tests that break when the
parser calls getaddrinfo. Every path in it exists on main, or is marked
new.

This change touches only the change folder of #2152.

Plans #2152
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.

1 participant