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 — lab-ops-hub: fetchFollowingValidatedRedirects fetches its start URL unvalidated — the SSRF guard is not safe by construction (PR #461) · Issue #464 · developing-today/code

lab-ops-hub: fetchFollowingValidatedRedirects fetches its start URL unvalidated — the SSRF guard is not safe by construction (PR #461) #464

New issue
Copy link
New issue
Copy link
Closed
#465
Closed
lab-ops-hub: fetchFollowingValidatedRedirects fetches its start URL unvalidated — the SSRF guard is not safe by construction (PR #461)#464
#465
Copy link
Assignees
dezren39

Description

@dezren39
dezren39
opened on Oct 21, 2026
Issue body actions

Problem

PR #461's new fetchFollowingValidatedRedirects (the Worker-fallback crawler's SSRF guard, fixing #460) validates every redirect target with validateCrawlUrl — but fetches its startUrl argument without validating it at all. The fetching component itself therefore does not enforce the #441 policy; it relies entirely on its one current caller pre-validating.

Evidence (verified on current main 468b9155, 2026-10-21)

  • pkgs/lab-ops-hub/src/lib.ts — fetchFollowingValidatedRedirects(startUrl, fetchFn, maxRedirects = 5): the loop's first action is const res = await fetchFn(current) with current = startUrl unchecked; validateCrawlUrl is only called on Location-derived URLs.
  • Empirically reproduced this run against the merged src/lib.ts (plain Node, injected stub fetcher): fetchFollowingValidatedRedirects("http://127.0.0.1/secret", stub) fetched http://127.0.0.1/secret and returned its 200 response — no refusal. Redirect targets in the same probe (integer/hex IPv4 forms, IPv4-mapped IPv6, NAT64-embedded 169.254.169.254, userinfo tricks) were all correctly refused, so the gap is specifically hop 0.
  • The only production caller is safe today by accident of wiring, not by the helper's contract: src/index.ts /api/crawl handler validates and rewrites b.url = target.url before crawlFallback(b.url). Any future caller — or a refactor that drops the rewrite — silently re-opens the lab-ops-hub: Worker-fallback crawler follows redirects to non-public targets (no redirect validation, unlike the container) #460/lab-ops-hub: public Worker has no auth on mutating, upload, AI and crawl endpoints (PR #436) #441 SSRF on the first hop.
  • This contradicts the repo's own stated design for the sibling crawler: pkgs/lab-ops-hub/container/app.py validates in the fetching component itself ("this service re-validates independently (defence in depth — it is the component that actually fetches)"). The Worker fallback is the component that actually fetches on its path, yet validates only hops 1..n.

Why it matters

#460 existed precisely because one fetch path in this package silently skipped the validation every other path applied. A security helper whose name and doc comment promise validated fetching ("Redirect-following fetch with per-hop validation") but which leaves hop 0 to caller discipline recreates that failure mode one refactor away. Making the helper safe by construction costs one validateCrawlUrl call at entry and breaks no current caller (the handler's URL is already validated/normalised; the PR's tests all start from public URLs).

Acceptance criteria

  • fetchFollowingValidatedRedirects validates startUrl with validateCrawlUrl before the first fetch and throws a clear error (fetching nothing) for a non-public / non-http(s) start URL; the first fetch uses the validated/normalised URL.
  • Regression test: a start URL of http://127.0.0.1/… (and/or http://169.254.169.254/…) is refused with the fetcher never invoked; existing public-start redirect tests still pass.
  • npm test and tsc --noEmit pass for pkgs/lab-ops-hub.

Single-repo: lab-ops-hub exists only in developing-today/code (as established in #460). Deduped: no open or closed issue names fetchFollowingValidatedRedirects, the start-URL gap, or crawlFallback validation (issue searches empty, 2026-10-21).

Activity

  1. github-actions
    assigned
    dezren39
    on Oct 21, 2026
  2. dezren39
    added a commit that references this issue on Oct 21, 2026

    Merge pull request #465 from developing-today/sweep/464-validate-star…

    36ca7ef
  3. dezren39
    closed this as completedin #465on Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @dezren39
    dezren39

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    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.