The vulnerability stems from the application's backend improperly trusting a client-controlled HTTP header, is-multi-tenant-query. When this header was set to true, a flag was enabled that caused critical authorization and tenant isolation checks to be skipped. The core of the issue was in the TenantPermission.addTenantScopeToQuery and ModelPermission.addTenantScopeToQuery functions, where the logic to enforce tenant-scoping on database queries was bypassed. This allowed any authenticated user, regardless of their privilege level, to read and modify data belonging to any other tenant on the platform.
The severity of this authorization bypass was significantly amplified by a secondary weakness: password reset tokens were stored in plaintext. An attacker could exploit the tenant isolation bypass to query the Project model of a victim. By including the createdByUser relation in the query, they could access sensitive fields on the User model, including the plaintext resetPasswordToken. The exploitation chain involved triggering a password reset for a victim and then immediately using the tenant bypass to read the newly generated token from the database, allowing for a complete account takeover. The patches address both issues: first, by correcting the faulty logic in the permission-checking functions to properly handle the is-multi-tenant-query case, and second, by implementing hashing for all password reset tokens to prevent them from being useful even if leaked.