Skip to content

fix(pipeline): drop caller-supplied internalAllowedFileRoots from scraper options - #652

Open
ucsurf wants to merge 1 commit into
arabold:mainfrom
ucsurf:fix/651-trpc-caller-supplied-allowedroots
Open

ucsurf wants to merge 1 commit into
arabold:mainfrom
ucsurf:fix/651-trpc-caller-supplied-allowedroots

Conversation

@ucsurf

@ucsurf ucsurf commented Dec 6, 2026

Copy link
Copy Markdown

Hardening for the scraper option path reported in #651, from a review of main at 47fd9b7 (v3.5.0, 2026-12-05).

internalAllowedFileRoots is an internal-only bypass of scraper.security.fileAccess. enqueueScrapeJob currently accepts options with no validation, so a caller who can already reach the unauthenticated /api (for example a LAN or Docker peer; the default bind is still loopback) can set the key and defeat the configured file-access policy. The key is also stored and replayed on refresh.

This change drops internalAllowedFileRoots in normalizeScraperOptions, which every enqueue and every replay of stored options passes through, and logs a warning. The web scraper's own temp-archive handoff sets the key after normalization on its own copy, so it is unaffected. Two regression tests are included. A fix.patch is available on request.

Fixes #651

Credit: Ugur Celik (ucsurf), @ucsurf

— Ugur Celik (ucsurf) · https://uc.surf
We find and report security issues in open source before attackers do. If our work helped you, a small contribution keeps it going and makes the internet a little safer for everyone:
https://buymeacoffee.com/ucsurf

…aper options

internalAllowedFileRoots opts paths out of scraper.security.fileAccess and is meant only for the scraper's own temp-archive handoff. The tRPC API accepts scraper options without validation, so a caller could set it. Strip it in normalizeScraperOptions, which every enqueue and every replay of stored options passes through. Adds two regression tests.

Fixes arabold#651

Credit: Ugur Celik (ucsurf), @ucsurf

— Ugur Celik (ucsurf) · https://uc.surf
We find and report security issues in open source before attackers do. If our work helped you, a small contribution keeps it going and makes the internet a little safer for everyone:
https://buymeacoffee.com/ucsurf
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.

Scraper options from the API can carry the internal-only internalAllowedFileRoots (file-access policy bypass)

1 participant