Skip to content

πŸ›‘οΈ Sentinel: [HIGH] Fix IDOR in bulk instance endpoints - #155

Open
ovasylenko wants to merge 1 commit into
mainfrom
sentinel/fix-idor-bulk-instances-12090987662290184893
Open

πŸ›‘οΈ Sentinel: [HIGH] Fix IDOR in bulk instance endpoints#155
ovasylenko wants to merge 1 commit into
mainfrom
sentinel/fix-idor-bulk-instances-12090987662290184893

Conversation

@ovasylenko

Copy link
Copy Markdown
Contributor

🚨 Severity: HIGH
πŸ’‘ Vulnerability: Insecure Direct Object Reference (IDOR) via Missing Authentication. The bulk instance endpoints (bulk_update_state, bulk_reschedule, batch_action, list_dlq) in orch8-api/src/instances/bulk.rs did not enforce require_admin for unscoped callers. They accepted an arbitrary tenant_id from the payload/query if the X-Tenant-Id context was missing, allowing an unauthenticated/unscoped attacker to perform bulk actions on any tenant's data.
🎯 Impact: An attacker could pause, resume, cancel, or modify states for instances belonging to arbitrary tenants without being authenticated or authorized for that tenant.
πŸ”§ Fix: Added the admin_ctx: OptionalAdmin extractor to the vulnerable endpoints and explicitly called require_admin(&admin_ctx)? when tenant_ctx.is_none(). Validated that mcp_server.rs proxy calls are updated to provide None for the admin context, preserving existing internal tooling.
βœ… Verification: Ran cargo test -p orch8-api and observed 100% pass rate. Specifically, the instances test suite passed, demonstrating functional equivalence for valid callers. Confirmed via cargo fmt and cargo clippy that no regressions or lint issues were introduced.


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

This commit secures the `bulk_update_state`, `bulk_reschedule`,
`list_dlq`, and `batch_action` endpoints in `orch8-api/src/instances/bulk.rs`.
Previously, these endpoints relied solely on `auth::scoped_tenant_id`
to extract the tenant. Because they allowed falling back to a query
parameter or request body value for `tenant_id`, an unauthenticated
or unscoped caller could specify an arbitrary tenant ID and bypass
tenant isolation.

By injecting the `OptionalAdmin` extractor into these handlers and
enforcing `require_admin` when `tenant_ctx` is missing, we ensure
that only authenticated tenants or global admin callers can interact
with these endpoints. proxy calls in `mcp_server.rs` were also updated.

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.

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