Skip to content

fix(security): enforce runtime access boundary on GET/POST /context (Fixes #271) - #274

Merged
uvwt merged 1 commit into
mainfrom
fix/issue-271-context-access-boundary
Nov 30, 2026
Merged

uvwt merged 1 commit into
mainfrom
fix/issue-271-context-access-boundary

Conversation

@uvwt

@uvwt uvwt commented Nov 30, 2026

Copy link
Copy Markdown
Owner

Fixes #271

Summary

  • Extract a shared runtimeAccessGuard in internal/httpx/runtime_analytics_access.go and enforce the same access boundary on GET/POST /context as /internal/runtime/*.
  • When Bearer/OAuth auth is disabled: block unauthenticated /context requests whenever AGENTDOCK_SERVER_URL is configured, and otherwise allow direct loopback requests only (rejecting non-loopback peers/hosts, proxy forwarding headers, Sec-Fetch-Site: cross-site, and cross-origin Origin).
  • When Bearer/OAuth auth is enabled: validate Host/Origin (defending against DNS rebinding and cross-origin browser requests) before verifying Bearer/OAuth credentials, returning structured runtime API errors and Allow: GET, POST on disallowed methods.
  • Update startup public-exposure warning log (internal/httpx/server.go) and runtime access documentation (docs/runtime-access-and-recovery.md).
  • Add comprehensive access boundary tests for /context in internal/httpx/runtime_access_test.go and internal/httpx/server_test.go.

Verification

  • Local: go test -count=1 ./internal/httpx/... passed.
  • CI: awaiting full GitHub Actions checks on this PR.

Acknowledgements

Thanks to Ranjit Banerjee (@x8bitranjit) for responsibly reporting this issue.

@uvwt
uvwt merged commit 7921469 into main Nov 30, 2026
10 checks passed
@uvwt
uvwt deleted the fix/issue-271-context-access-boundary branch November 30, 2026 13:39
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.

GET /context serves the management capability index without authorization - sibling of the CVE-2026-138077 runtime API fix (CWE-306)

1 participant