Summary
Midday contains an authorization flaw in its team-deletion workflow that allows any team member, including invited users, to delete the team. Because deletion also removes team-scoped records and triggers cleanup involving stored bank-connection tokens, an otherwise authorized member may cause extensive data loss and potentially affect connected provider operations.
Affected context
The vulnerability occurs in Midday's team-management API when the team-deletion procedure relies on a membership helper that confirms membership but does not distinguish between roles. Deployments are at risk when untrusted or lower-privileged members can invoke this procedure and the data layer repeats the same insufficient check instead of enforcing an owner-level authorization requirement. Related member-management procedures may contain role-aware checks, but those checks are not consistently applied to deletion and update operations.
Exploit preconditions
- Attack surface: Team-management API procedures in the application backend
- Required access: Membership in the target team, including an invited-member role
- Trigger point: Invocation of the team-deletion operation
- Why exploitation is possible: The authorization helper treats all team-membership records as sufficient permission and does not verify that the caller has an owner-level role
- Additional condition: The caller must be able to reach the affected procedure through the deployed API and the associated team record must exist
Why this happens
The underlying bug is a missing authorization check, mapped to CWE-862: Missing Authorization. The application verifies that a caller belongs to a team but incorrectly treats membership as equivalent to permission to perform a destructive administrative action. The data layer repeats the same membership-only decision, creating defense-in-depth failure, while role-aware checks used by neighboring procedures are not applied consistently to deletion or update operations.
Potential impact
- An ordinary member may delete a team without owner approval
- Team-scoped records and associated application data could be destroyed
- Cleanup processing may operate on stored bank-connection tokens
- Connected financial-provider integrations could be disrupted or affected
- Business operations, auditability, and data availability may be impaired
- The related update authorization gap could permit unauthorized changes to team data
General mitigation guidance
Mitigation generally focuses on enforcing operation-specific authorization at every layer that performs a security-sensitive action.
Common defensive patterns include:
- Require an explicit owner or administrator role for team deletion and other destructive operations
- Centralize policy decisions so membership checks cannot substitute for role checks
- Re-authorize sensitive actions in the data layer rather than relying solely on router-level checks
- Apply consistent role-aware authorization to deletion, update, and member-management procedures
- Prefer deny-by-default behavior for administrative operations
- Minimize the privileges and lifetime of tokens used by asynchronous cleanup jobs
- Add transaction safeguards, confirmation controls, and recoverability mechanisms for destructive workflows
- Record authorization decisions and sensitive team-management events for audit purposes
How teams detect issues like this
Organizations can identify similar authorization weaknesses through:
- Static analysis that flags destructive procedures guarded only by generic membership predicates
- Code review checks requiring explicit role or capability validation for administrative operations
- Comparison of authorization policies across neighboring create, update, delete, and member-management procedures
- Tests covering every supported role, including invited members and ordinary members
- Policy enforcement requiring owner-level authorization for team deletion and other irreversible actions
- Runtime monitoring for deletion requests initiated by non-owner roles and unusual cleanup-job activity
- Automated application-security review tools that trace authorization decisions from API routes through data-access functions

