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: Worker-fallback crawler follows redirects to non-public targets (no redirect validation, unlike the container) · Issue #460 · developing-today/code

lab-ops-hub: Worker-fallback crawler follows redirects to non-public targets (no redirect validation, unlike the container) #460

New issue
Copy link
New issue
Copy link
Closed
#461
Closed
lab-ops-hub: Worker-fallback crawler follows redirects to non-public targets (no redirect validation, unlike the container)#460
#461
Copy link
Assignees
dezren39

Description

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

Problem

The lab-ops-hub Worker-fallback crawler does not validate redirect targets, unlike the container crawler — so the #441 SSRF policy can be bypassed on the fallback path.

Evidence (verified on main 718d2674, 2026-10-21)

  • pkgs/lab-ops-hub/src/index.ts:345 — the /api/crawl handler validates only the caller-supplied URL: const target = validateCrawlUrl(b.url).
  • pkgs/lab-ops-hub/src/index.ts:159-161 — crawlFallback(url) then does a bare fetch with default redirect handling and no re-validation:
    const res = await fetch(url, { headers: { "user-agent": "LabOpsHub/0.1 (+personal crawler)" } });
    Per the Fetch spec, the default redirect mode is follow (up to 20 hops), so a public URL that replies 302 Location: http://169.254.169.254/… (or any private / loopback / link-local / localhost-style target that validateCrawlUrl in src/lib.ts:63 would refuse as a direct target) is fetched, and its body is extracted, returned in part, and archived to R2 (src/index.ts:358-382).
  • The caller can also force this path directly with {"via":"worker"} (src/index.ts:353), so the gap does not depend on the container being unavailable.
  • Contrast: the container crawler holds redirect targets to the same policy — pkgs/lab-ops-hub/container/app.py:47-50 (_ValidatingRedirectHandler.redirect_request calls validate_crawl_url(newurl)), and the comment at app.py:20-24 states "Redirect targets are held to the same policy."
  • pkgs/lab-ops-hub/README.md:46-52 describes both crawlers as refusing non-public targets "including redirect targets in the container" — the Worker fallback is the uncovered half.
  • Default-redirect behaviour reproduced locally this run: a spec-following HTTP client requesting a start URL that 302-redirects to a 127.0.0.1 target returned the private target's body (hits: ['/start', '/private']).

This is not the already-closed #441 (initial-URL validation + auth, both present) or #442 (budget).

Why it matters

The crawl endpoint is an authenticated fetch proxy by design; redirect-to-private is the standard SSRF bypass for exactly the initial-URL validation added in #441. The two crawler implementations were deliberately kept to one policy (defence in depth, per the app.py comment) — the fallback silently breaks that invariant.

Suggested fix / acceptance criteria

  • crawlFallback follows redirects manually (redirect: "manual"), validating every Location target with validateCrawlUrl before fetching it, with a bounded hop count (e.g. 5); a redirect to a non-public or non-http(s) target fails the crawl with a clear error and nothing is archived to R2.
  • Relative Location headers resolve against the current URL before validation.
  • A regression test covers: public URL → redirect to http://127.0.0.1/… / http://169.254.169.254/… is refused on the worker path; a public → public redirect still succeeds. (The redirect-following logic may need to move into src/lib.ts alongside validateCrawlUrl so it is testable with plain Node like the existing test/lib.test.ts tests.)
  • README crawl-target wording updated so it no longer implies redirect validation is container-only.

Single-repo: lab-ops-hub exists only in developing-today/code.

Activity

  1. github-actions
    assigned
    dezren39
    on Oct 21, 2026
  2. dezren39
    closed this as completedin #461on Oct 21, 2026
  3. dezren39
    added a commit that references this issue on Oct 21, 2026

    Merge pull request #461 from developing-today/creator/460-worker-craw…

    This issue will close once commit fb081b7 is merged into the 'main' branch.
    fb081b7
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.