Skip to content

fix(api): require auth for sensitive reads - #744

Merged
frahlg merged 2 commits into
masterfrom
agent/protect-sensitive-api-reads
Aug 7, 2026
Merged

frahlg merged 2 commits into
masterfrom
agent/protect-sensitive-api-reads

Conversation

@frahlg

@frahlg frahlg commented Jul 31, 2026

Copy link
Copy Markdown
Member

Summary

  • Protect backup listing, backup downloads, and managed CalDAV credentials with the shared API security guard.
  • Keep token-free access for local LAN clients; remote clients and public/FQDN hosts must send the configured Bearer token.
  • Cover GET and HEAD requests with regression tests and add a patch changeset.

Why

Backup archives contain persistent state and configuration, while the CalDAV credentials endpoint returns a reusable password. Remote requests could read these values without the API token.

Root cause

The shared guard treated almost every GET and HEAD request as an ordinary read. These secret-bearing routes therefore skipped its Host, Origin, fetch-metadata, and remote-token checks.

Checks

  • go test ./internal/api -count=1
  • make verify
  • Pre-push make verify-all, including Linux arm64/amd64 and Windows amd64 builds

…protect-sensitive-api-reads

Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>

# Conflicts:
#	go/internal/api/security.go
#	go/internal/api/security_test.go
@frahlg

frahlg commented Aug 7, 2026

Copy link
Copy Markdown
Member Author

Updated this branch to current master e29f8d7 and kept the change limited to sensitive read authentication plus tests and its changeset. Verified head 52f6578 locally with go test ./internal/api -count=1, make verify, and the pre-push make verify-all hook. GitHub Actions run 31165606425 is green, including Core, full stack, the app registry contract, the driver contract, changeset, and repository checks. There are no pending reviews or comments. Marking this ready for merge as part of the maintainer cleanup.

@frahlg
frahlg marked this pull request as ready for review August 7, 2026 09:24
@frahlg
frahlg merged commit 434122a into master Aug 7, 2026
15 checks passed
@frahlg
frahlg deleted the agent/protect-sensitive-api-reads branch August 7, 2026 09:25
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.

1 participant