π‘οΈ Sentinel: [HIGH] Fix IDOR in bulk instance endpoints - #155
π‘οΈ Sentinel: [HIGH] Fix IDOR in bulk instance endpoints#155ovasylenko wants to merge 1 commit into
Conversation
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>
|
π 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
π¨ Severity: HIGH
π‘ Vulnerability: Insecure Direct Object Reference (IDOR) via Missing Authentication. The bulk instance endpoints (
bulk_update_state,bulk_reschedule,batch_action,list_dlq) inorch8-api/src/instances/bulk.rsdid not enforcerequire_adminfor unscoped callers. They accepted an arbitrarytenant_idfrom the payload/query if theX-Tenant-Idcontext 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: OptionalAdminextractor to the vulnerable endpoints and explicitly calledrequire_admin(&admin_ctx)?whentenant_ctx.is_none(). Validated thatmcp_server.rsproxy calls are updated to provideNonefor the admin context, preserving existing internal tooling.β Verification: Ran
cargo test -p orch8-apiand observed 100% pass rate. Specifically, the instances test suite passed, demonstrating functional equivalence for valid callers. Confirmed viacargo fmtandcargo clippythat no regressions or lint issues were introduced.PR created automatically by Jules for task 12090987662290184893 started by @ovasylenko