Summary
A broken object-level authorization flaw in the LeadController endpoint of Webkul Krayin CRM v2.2.x allows authenticated users to access lead records they do not own by manipulating request parameters.
By sending crafted GET requests, an attacker can arbitrarily read, modify, or permanently delete leads belonging to other users, violating data confidentiality and integrity within the CRM.
Affected context
This vulnerability occurs in deployments of Webkul Krayin CRM v2.2.x where the /Controllers/Lead/LeadController.php endpoint is exposed to authenticated users.
The issue arises when the application relies on user-supplied identifiers (such as lead IDs) to fetch and manipulate lead records without enforcing per-object ownership or permission checks.
Any environment where multiple users manage leads through the same CRM instance, especially multi-tenant or multi-team setups, is at heightened risk of unauthorized data access and manipulation.
Exploit preconditions
- Attack surface: HTTP(S) API exposed by the CRM, specifically the LeadController-related endpoints.
- Required access: Valid authenticated account on the CRM (even with low privileges).
- Trigger point: Submission of crafted GET requests that reference lead IDs owned by other users.
- Why exploitation is possible: The application authorizes the user at a session level but does not verify that the requested lead object is owned by, or accessible to, the current user. As a result, arbitrary object identifiers can be supplied to operate on other users' leads.
Why this happens
The root cause is a missing object-level authorization check when operating on lead entities in the LeadController.
While the application appears to authenticate users, it fails to enforce that the current user is authorized to access a specific lead identified in the request parameters.
This aligns with CWE-639: Authorization Bypass Through User-Controlled Key, where user-controllable object identifiers (such as numeric IDs or UUIDs) are trusted without verifying ownership or access rights.
Abstractly, the insecure pattern is: load_object(request.id) followed by business operations, without a mandatory ensure_user_can_access(current_user, object) check on every read, update, or delete operation.
Potential impact
- Authenticated users may read leads owned by other users or teams, exposing sensitive business and customer data.
- Attackers could modify fields of other users' leads, corrupting pipelines, notes, or deal values.
- Leads can be permanently deleted, causing data loss and disrupting sales or support workflows.
- Audit trails and reporting may be skewed, as unauthorized changes are recorded under legitimate user sessions.
- In multi-tenant or partner environments, one tenant's user could potentially access another tenant's leads if tenancy boundaries rely on lead ownership alone.
General mitigation guidance
Effective mitigation focuses on enforcing strict, consistent object-level authorization for all lead operations:
- Introduce centralized permission checks that validate ownership or role-based access before reading, updating, or deleting any lead record.
- Treat all client-supplied identifiers (e.g., lead IDs in path or query parameters) as untrusted and always resolve them in the context of the current user or tenant.
- Use an access-control layer (policy objects, middleware, or declarative authorization rules) that is applied uniformly to controller actions dealing with leads.
- Ensure that database queries are scoped by user or tenant where applicable (for example, adding mandatory filters for owner, team, or tenant identifiers).
- Prefer secure-by-default patterns where controllers only operate on objects derived from the authenticated user's context, rather than free-form IDs directly from the request.
- Limit the privileges of general user roles so that damage from any single compromised account is reduced.
How teams detect issues like this
Detection typically involves both code-centric and behavior-centric approaches:
- Static analysis and code review:
- Search for controller actions in
LeadController.phpthat accept IDs from request parameters and directly load lead records without calling a shared authorization check. - Flag patterns where authorization is performed once at login but not re-evaluated per object, especially on read, update, and delete handlers.
- Review database queries for missing ownership or tenant scoping (e.g.,
WHERE id = ?withoutAND owner_id = current_useror equivalent). - Automated testing and security scanning:
- Implement API tests that attempt to access or modify leads created under other test users by varying object IDs.
- Leverage DAST tools configured with multiple accounts to probe for ID-based horizontal privilege escalation.
- Operational monitoring:
- Monitor access logs for accounts accessing large ranges of lead IDs or leads associated with multiple different owners.
- Use anomaly detection to flag unusual cross-user access patterns within the CRM.

