Security: enforce object ownership in customer-panel AJAX handlers#1370
Security: enforce object ownership in customer-panel AJAX handlers#1370vuckro wants to merge 2 commits into
Conversation
The customer-panel modals in the UI elements register their wu_form handlers with the 'exist' capability (any logged-in user) and reference the target object by a client-supplied id/hash. Several handlers acted on that object without verifying the caller owns it, while sibling handlers in the same files (e.g. handle_user_add_new_domain_modal, and the DNS record handlers via customer_can_manage_dns) already enforce ownership. Because the object identifiers are not secret, any authenticated user (including a subscriber on any sub-site) could target another tenant's objects. This adds the same is_customer_allowed()/ownership guard the codebase already uses elsewhere to: - Domain_Mapping_Element::handle_user_delete_domain_modal (delete domain) - Domain_Mapping_Element::handle_user_make_domain_primary_modal - Current_Site_Element::handle_edit_site (rename site) - Billing_Info_Element::handle_update_billing_address Network admins (manage_network) are unaffected; is_customer_allowed() returns true for them. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis PR adds customer authorization enforcement across three UI element handlers. A new domain-specific authorization helper is introduced for domain management, while billing and site operations receive simpler inline permission guards. All denied requests return a ChangesCustomer Authorization Enforcement
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
superdav42
left a comment
There was a problem hiding this comment.
LGTM! Thanks @vuckro
Stuck-merge detector: PR has been merge-eligible but unmerged past the thresholdThe pulse merge pass has classified PR #1370 as Failing checks on PR #1370
Worker guidance for the next attempt
Why you're seeing thisEvery pulse cycle (~120s) the deterministic merge pass re-evaluates open PRs. PRs that pass APPROVED + MERGEABLE but fail required checks have historically been re-evaluated silently every cycle until a human noticed. The stuck-merge detector (t3193) surfaces them after Posted automatically by aidevops.sh v3.20.53 automated scan. |
Summary
Several customer-panel modal handlers (registered as
wu_formactions with theexistcapability, i.e. available to any logged-in user) acted on an objectreferenced by a client-supplied id/hash without verifying the caller owns it.
Sibling handlers in the same files already enforce ownership
(
handle_user_add_new_domain_modal, the DNS-record handlers viacustomer_can_manage_dns), so this restores a consistent check.Because the object identifiers are not secret, any authenticated user (including
a subscriber on any sub-site) could reach another tenant's objects — a
cross-tenant (IDOR / broken access control) issue.
Changes
Adds the project's existing
Site::is_customer_allowed()/Membership::is_customer_allowed()ownership guard to:Domain_Mapping_Element::handle_user_delete_domain_modal(delete a domain)Domain_Mapping_Element::handle_user_make_domain_primary_modalCurrent_Site_Element::handle_edit_site(rename a site)Billing_Info_Element::handle_update_billing_addressNetwork admins (
manage_network) are unaffected —is_customer_allowed()returns
truefor them.Compatibility
No behavior change for legitimate users acting on their own objects; the guard
only rejects cross-tenant requests. No DB or API changes.
Part of a small series of focused security hardening PRs. Full technical detail
is available privately to the maintainers on request (coordinated disclosure).
Summary by CodeRabbit
Release Notes