Summary
wishthis has an authorization bypass in User::ownsWishlist() that can let an authenticated user modify wishes and wishlists belonging to other users. The risk arises when API handlers rely on supplied wish or wishlist identifiers without correctly verifying ownership.
Affected context
The issue occurs in wishthis wish and wishlist API handlers when they use wish_id or wishlist_id values to locate records and the ownership check does not adequately restrict access to the authenticated user's data. Authenticated users may be able to edit or add wishes, or rename or delete wishlists belonging to others.
Exploit preconditions
- Attack surface: Wishes and wishlists API handlers
- Required access: An authenticated account
- Trigger point: A request that references a wish or wishlist by its identifier
- Why exploitation is possible: The ownership check may not reliably bind the requested record to the authenticated user; sequential identifiers can make other records easier to target.
Why this happens
The underlying flaw is an authorization check that does not adequately verify access to an object identified by a user-controlled key. This maps to CWE-639: Authorization Bypass Through User-Controlled Key. When an application trusts a supplied identifier without enforcing ownership for each requested operation, a user may access or modify another user's records.
Potential impact
- Authenticated users may edit or add wishes associated with other users' wishlists.
- Users may rename or delete wishlists they do not own.
- Wishlist data integrity and availability could be affected.
- Unauthorized changes could undermine user trust in the service.
General mitigation guidance
Defensive patterns include enforcing object-level authorization on every operation and deriving ownership from the authenticated session rather than trusting client-supplied identifiers. Applications can use secure-by-default data access patterns that scope queries to the current user, minimize reliance on predictable identifiers, and grant handlers only the privileges they need. Consistent authorization checks should cover reading, creating, updating, and deleting records.
How teams detect issues like this
Review API handlers for database lookups that use client-supplied identifiers without binding results to the authenticated user's identity. Static analysis and code review can flag missing object-level authorization checks and inconsistent checks across create, update, and delete paths. Policy enforcement and automated tests should verify that users cannot act on records owned by other accounts, including when identifiers are predictable.

