Skip to content

fix(paroche): scope get_request to caller and redact indexer creds - #558

Merged
forkwright merged 1 commit into
mainfrom
fix/paroche-auth-boundary
Jul 6, 2026
Merged

fix(paroche): scope get_request to caller and redact indexer creds#558
forkwright merged 1 commit into
mainfrom
fix/paroche-auth-boundary

Conversation

@forkwright

Copy link
Copy Markdown
Owner

Two auth-boundary defects (deep-audit).

  • IDOR (IDOR: get_request leaks cross-user request records #522)get_request accepted any authenticated user and never scoped to the caller, so any member could read any other user's request record by UUID. The caller's user_id is now threaded through RequestService::get_request and enforced is_owner || is_admin (non-owner non-admin → 403), mirroring cancel_request.
  • Indexer credentials in download_url (secrets: unredacted download_url exposes indexer API keys to non-admins #539) — the queue snapshot and search endpoints returned raw download_urls that embed the indexer apikey/passkey. A redact_download_url helper now replaces credential-param values with REDACTED on the outbound response (queue snapshot + search); the internal enqueue/fetch path keeps the real URL. Inclusive key matching (apikey/api_key/passkey/torrent_pass/authkey/token/secret/…).

Gate kanon gate --full green; endpoint-level tests assert owner/non-owner/admin access and apikey=REDACTED in both response bodies.

Closes #522
Closes #539

… download_url

GET /api/v1/requests/{id} accepted any AuthenticatedUser and never checked
ownership — any member could read any other user's request by UUID (title,
decided_by, deny_reason, want_id). RequestService::get_request now takes the
authenticated caller_id and enforces the same owner-or-admin boundary as
cancel_request (non-owner member -> InsufficientPermission -> 403); the
signature change is threaded through DynRequestService, the aitesis impl,
the archon adapters, and the route handler.

GET /api/v1/downloads and POST /api/v1/search returned each item's raw
download_url, which by Torznab/Newznab convention embeds the indexer
apikey/passkey — a member-visible credential leak of the operator's
private-tracker keys. A lexical redaction helper (paroche::redact) now
replaces credential query-parameter values (apikey/passkey/authkey/token/
secret/r and variants, case-insensitive) with REDACTED on every outbound
response path: DownloadResponse::from and both search-result handlers.
The stored row and the enqueue/fetch path keep the real URL.

Gate-Passed: kanon 0.1.5 +stages:fmt,check,clippy,nextest,lint sha:23072b32135426354452cb9291f817c7de7acb1d
@forkwright
forkwright merged commit eb906b2 into main Jul 6, 2026
12 checks passed
@forkwright
forkwright deleted the fix/paroche-auth-boundary branch July 6, 2026 15:21
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.

secrets: unredacted download_url exposes indexer API keys to non-admins IDOR: get_request leaks cross-user request records

1 participant