Skip to content

πŸ›‘οΈ Sentinel: [CRITICAL] Fix authorization bypass in API /usage endpoint - #119

Merged
ovasylenko merged 2 commits into
mainfrom
sentinel/fix-usage-endpoint-authorization-13184674616619685396
Sep 2, 2026
Merged

πŸ›‘οΈ Sentinel: [CRITICAL] Fix authorization bypass in API /usage endpoint#119
ovasylenko merged 2 commits into
mainfrom
sentinel/fix-usage-endpoint-authorization-13184674616619685396

Conversation

@ovasylenko

Copy link
Copy Markdown
Contributor

🚨 Severity: CRITICAL
πŸ’‘ Vulnerability: The /usage endpoint lacked an authorization check when a caller omitted the X-Tenant-Id header (unscoped caller). It allowed any unscoped caller to arbitrarily specify a tenant ID via the ?tenant= query parameter and view that tenant's usage and cost data.
🎯 Impact: This Insecure Direct Object Reference (IDOR) / Missing Authorization vulnerability allowed unauthenticated or unauthorized users to scrape usage and cost metrics across all tenants in the system.
πŸ”§ Fix: Updated the get_usage handler in orch8-api/src/usage.rs to require the admin_ctx extractor. If tenant_ctx is None, it now calls require_admin(&admin_ctx)? before allowing the use of the ?tenant= parameter. Also updated the MCP proxy logic in orch8-api/src/mcp_server.rs to match the new signature.
βœ… Verification: cargo +nightly test -p orch8-api --test usage passes successfully, and cargo +nightly check -p orch8-api confirms no compilation errors exist.


PR created automatically by Jules for task 13184674616619685396 started by @ovasylenko

Added missing `OptionalAdmin` authorization check when falling back to the `tenant` query parameter if the `tenant_ctx` is `None` (unscoped caller). Also updated the corresponding tool call in `mcp_server.rs`.

Co-authored-by: ovasylenko <3797513+ovasylenko@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

πŸ‘‹ Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a πŸ‘€ emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@ovasylenko
ovasylenko merged commit 6bde680 into main Sep 2, 2026
3 of 5 checks passed
@ovasylenko
ovasylenko deleted the sentinel/fix-usage-endpoint-authorization-13184674616619685396 branch September 2, 2026 14:17
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