Skip to content

fix(server): minimal health payload for tokenless requests - #1257

Merged
ajianaz merged 1 commit into
developfrom
fix/health-minimal-anonymous
Sep 15, 2026
Merged

ajianaz merged 1 commit into
developfrom
fix/health-minimal-anonymous

Conversation

@ajianaz

@ajianaz ajianaz commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

What

GET /health stays reachable without a token (load balancers and uptime probes keep working), but a tokenless or invalidly-authenticated request now receives only:

{"status":"ok"}

A valid bearer token (admin or read-only), or a server with auth disabled (single-operator local mode), still receives the full payload - version, memories, namespaces, api_versions, update_available - with an unchanged shape.

Why

The health endpoint was fully exempt from auth while returning the server version, memory count, namespace count, and update info. On a public deployment that lets anyone fingerprint the instance (exact version for targeted exploits) and size the memory store (counts) with zero credentials. Owner direction: public gets the minimum; holders of an apikey/token see everything. Closes #1252.

Testing

  • New test test_health_anonymous_gets_minimal_payload covers all four paths:
    • auth ON, no token -> 200, {"status":"ok"} only (no version/memories/namespaces/update_available)
    • auth ON, valid token -> 200, full payload
    • auth ON, wrong token -> 200, same minimal body as anonymous (invalid credentials must not see more than a scanner; uptime probes keep a 200 through token rotation)
    • auth OFF, no token -> 200, full payload (unchanged local behavior)
  • cargo test -p uteke-server --bins: 33 passed / 0 failed. cargo fmt --check + cargo clippy --bins -- -D warnings clean.

Note: response remains 200 for LB compatibility; only the body shrinks.

GET /health was fully exempt from auth and returned version, memory
count, namespace count, and update info - letting any scanner
fingerprint an internet-exposed instance and size its memory store.

Health stays reachable WITHOUT a token (load balancers and uptime
probes keep working), but a request without valid credentials now
receives only {"status":"ok"}. A valid bearer token (admin or
read-only), or a server with auth disabled, still gets the full
payload - unchanged shape.

Closes #1252
@github-actions

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

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.

/health exposes version + memory counts without auth on public deployments

1 participant