GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(lab-ops-hub): container validator refuses numeric-final-label hosts and malformed ports by dezren39 · Pull Request #503 · developing-today/code

Conversation

@dezren39

@dezren39 dezren39 commented Oct 21, 2026 •
edited by blacksmith-sh Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Fixes #502

The container crawler's validate_crawl_url fell through to "a public DNS name" for hosts that parse as neither ipaddress nor inet_aton IPv4, and never inspected the port — so invalid IPv4 spellings (256.1.1.1, 1.2.3.4.5, 4294967296), numeric-final-label names (example.123, example.0x7f) and malformed/out-of-range ports (:abc, :99999, :80abc) were all allowed, while the Worker's WHATWG validator refuses every one (differential probe in #502).

  • Refuse a host whose final label is numeric (decimal or 0x hex) when it is not a valid IPv4 address — WHATWG's ends-in-a-number rule. Valid inet_aton spellings are still judged by the address they resolve to (lab-ops-hub container crawler accepts inet_aton IPv4 spellings (127.1, 2130706433, 0x7f.1) — loopback SSRF bypass in validate_crawl_url #468 unchanged).
  • Read urlparse(...).port inside the validator so a malformed or out-of-range port raises there instead of lazily inside the fetcher. Port 0 stays allowed — both validators accept it today (probe-verified), so parity is kept.
  • Redirect targets inherit both rules via _ValidatingRedirectHandler's reuse of the same function.

Verification:

  • npm test in pkgs/lab-ops-hub: TS 18/18, Python 9/9 (2 new tests: numeric-final-label hosts, malformed ports; public-target controls extended with dead.beef, a1.beef, 123.example.com, :8080).
  • Ablation: with only app.py reverted, both new tests fail; restored, all pass.
  • Differential probe over ~600 inputs (special IPv4/IPv6 ranges, inet_aton spellings, ports, name forms): TS and Python verdicts now identical on every input.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Muse Sweep
fix(lab-ops-hub): container validator refuses numeric-final-label hos…
6ff8f35
…ts and malformed ports (#502)

validate_crawl_url fell through to 'a public DNS name' for hosts that
parse as neither ipaddress nor inet_aton IPv4 — including invalid IPv4
spellings (256.1.1.1, 4294967296) and names with a numeric final label
(example.123) — and never inspected the port, so :abc/:99999/:80abc
were allowed too. The Worker's WHATWG validator refuses every one.

Mirror it: refuse a host whose final label is numeric (decimal or 0x
hex) when it is not a valid IPv4 address (WHATWG ends-in-a-number),
and read urlparse's .port in the validator so malformed/out-of-range
ports raise there instead of lazily inside the fetcher. Port 0 and
non-numeric-final-label names (dead.beef, 123.example.com) stay
allowed, exactly as on the Worker side.

Differential probe over ~600 inputs now shows full TS/Python parity.
New tests ablation-verified: both fail with only app.py reverted.
@dezren39
dezren39 requested a review from a team as a code owner October 21, 2026 20:25
@github-actions github-actions Bot assigned dezren39 Oct 21, 2026
@coderabbitai

coderabbitai Bot commented Oct 21, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 35 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 27a41946-0665-42fb-9866-fa0d9ae92159
📥 Commits

Reviewing files that changed from the base of the PR and between 1c692fd and 6ff8f35.

📒 Files selected for processing: 2
  • pkgs/lab-ops-hub/container/app.py
  • pkgs/lab-ops-hub/test/test_container_validate.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
  • X
  • Mastodon
  • Reddit
  • LinkedIn

Comment @coderabbitai help to get the list of available commands.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T20:30:41.585135Z 6ff8f35 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dezren39
dezren39 merged commit eaf371c into main Oct 21, 2026
5 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@dezren39
dezren39 deleted the creator/502-container-validator-parity branch October 21, 2026 20:26
chatgpt-codex-connector[bot]
chatgpt-codex-connector Bot reviewed Oct 21, 2026
View reviewed changes

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6ff8f35473

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pkgs/lab-ops-hub/container/app.py
# refuse it instead of reclassifying it as a public DNS
# name, matching the Worker's validator (#502).
last_label = host.rsplit(".", 1)[-1]
if re.fullmatch(r"0[xX][0-9a-fA-F]+|[0-9]+", last_label):

@chatgpt-codex-connector chatgpt-codex-connector Bot Oct 21, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

P2 Badge Treat a bare hexadecimal prefix as a numeric label

When the container validates a direct request or redirect ending in 0x or 0X (for example, http://example.0x/), this regex requires at least one following hexadecimal digit and therefore accepts the URL as a DNS name. The Worker's WHATWG parser rejects the same URL because a bare hexadecimal prefix still triggers its ends-in-a-number handling, so the validators remain inconsistent and the container proceeds to a DNS fetch that the Worker refuses. Allow the hexadecimal digit portion to be empty or otherwise handle these two labels explicitly.

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pkgs/lab-ops-hub/container/app.py
Comment on lines +38 to +41
try:
u.port
except ValueError:
raise ValueError("url has an invalid port") from None

@chatgpt-codex-connector chatgpt-codex-connector Bot Oct 21, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

P2 Badge Handle backslashes before validating the port

For a redirect target such as http://example.com:80\\/path, the Worker's WHATWG URL parser treats the backslash as a path separator and accepts it as http://example.com//path, but urlparse leaves the backslash in the port string, so reading u.port now rejects the target. Because redirects are passed through this validator before the container fetches them, an otherwise Worker-valid redirect unnecessarily abandons the container path and breaks the validator-parity goal; normalize special-scheme backslashes or parse with equivalent semantics before applying the port check.

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
This was referenced Oct 21, 2026
lab-ops-hub: container validator still allows bare 0x hosts (example.0x, 0x) that the Worker validator refuses #504
Closed
fix(lab-ops-hub): container validator refuses bare 0x hosts #509
Merged
docs(dashboard): build out the Basement cluster project section (/program/lab-cluster) #1124
Closed
EPIC: Basement Talos/Cozystack cluster program #1817
Open
@dezren39 dezren39 mentioned this pull request Oct 29, 2026
docs(aggregator): lab-cluster reflects nix#501-508 predecessors + Grist disagreement (#1124) #2397
Merged
@dezren39 dezren39 mentioned this pull request Nov 8, 2026
Closure audit: every closed issue/PR verified; unmerged branches + unpushed worktrees inventoried #7079
Open
@dezren39 dezren39 mentioned this pull request Nov 24, 2026
AUDIT-7 Lane 4 — MERGED-PR-AUDIT: merged PRs since 2026-10-23 vs their spawning issues #13879
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@chatgpt-codex-connector chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@dezren39 dezren39

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

lab-ops-hub: container crawler treats invalid IPv4 spellings, numeric-final-label hosts and malformed ports as public DNS names

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@dezren39
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.