/

CVE-2026-38528

Severity:

HIGH RISK

(7.1)

SQL Injection in Krayin CRM Lead Data Grid (rotten_lead

CVE-2026-38528

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Unauthorized Data Access and Modification via SQL Injection

Severity:

HIGH RISK

(7.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Krayin CRM v2.2.x contains a SQL injection vulnerability in the rotten_lead parameter handled by /Lead/LeadDataGrid.php.

By manipulating this parameter, an attacker may inject arbitrary SQL into backend queries, potentially accessing or modifying CRM data when the application processes crafted requests.

Affected context

The vulnerability occurs in Krayin CRM v2.2.x within the lead management / data grid functionality, specifically in the handling of the rotten_lead parameter at /Lead/LeadDataGrid.php.

It is relevant in deployments where:

  • User-controlled request parameters are used to filter or query leads in the database
  • The rotten_lead value is interpolated into SQL without robust parameterization
  • The CRM is reachable over a network (e.g., Internet or internal LAN) by untrusted or semi-trusted users

Exploit preconditions

  • Attack surface: HTTP(S) interface exposed by Krayin CRM, particularly the /Lead/LeadDataGrid.php endpoint.
  • Required access: Ability to send requests to the CRM instance (e.g., authenticated user, or unauthenticated if the endpoint is publicly accessible).
  • Trigger point: Server-side processing of the rotten_lead parameter as part of a SQL query used for listing/filtering leads.
  • Why exploitation is possible: The parameter value is incorporated into SQL statements without proper use of prepared statements or equivalent parameter binding, allowing crafted input to alter the intended query structure.

Why this happens

This issue stems from constructing SQL queries by concatenating or interpolating user-supplied data from the rotten_lead parameter directly into the query string.

Instead of treating the parameter as data through bound parameters or ORM-safe query mechanisms, the backend likely mixes control and data, enabling attackers to break out of the intended query context.

This pattern maps to CWE-89: SQL Injection, where input validation and query parameterization are insufficient, and untrusted input can change the logic of database commands.

Potential impact

  • Read access to sensitive CRM data, including lead information and associated metadata
  • Modification or deletion of lead records and related tables
  • Bypassing of application-level authorization checks through manipulated queries
  • Extraction of additional database information (such as user tables or configuration data), depending on database permissions
  • Possible execution of database-specific functions that could aid in further compromise of the environment

General mitigation guidance

Mitigation generally focuses on separating SQL code from user input and reducing trust in request parameters:

  • Use parameterized queries or prepared statements for all database interactions involving request parameters like rotten_lead.
  • Prefer ORM or query builders that enforce binding over string concatenation when constructing filters and data grid queries.
  • Apply strict server-side validation and normalization on filter parameters (e.g., accept only expected types and whitelisted values).
  • Implement the principle of least privilege for the database user so that even if a query is abused, destructive operations are limited.
  • Centralize query construction patterns for data grid components so that secure practices are consistently applied.

How teams detect issues like this

Detection commonly involves a mix of code-centric and runtime approaches:

  • Static analysis rules to flag raw SQL construction that includes request parameters (e.g., $_GET, $_POST, or framework request objects) in /Lead/LeadDataGrid.php and related code.
  • Code reviews that look for dynamic query fragments, string concatenation in WHERE/ORDER/LIMIT clauses, and lack of bound parameters.
  • Automated security testing (DAST) targeting the rotten_lead parameter with benign injection payloads to observe anomalous database error messages or behavior.
  • Central logging of SQL errors and unusual query patterns, optionally combined with anomaly detection to identify suspicious query structures.

Sources

SourceLink
github.comgithub.com/TREXNEGRO/Security-Advisories/tree/main/CVE-2026-38528
github.comgithub.com/krayin/laravel-crm

Frequently asked

questions

Exploitability depends on how accessible the /Lead/LeadDataGrid.php endpoint is; if reachable by low-privilege or unauthenticated users, the exposure is broader, whereas deployments limited to trusted internal users reduce—but do not eliminate—risk.

Not necessarily. If the vulnerable endpoint is accessible without authentication, an attacker can exploit it anonymously; otherwise, any user able to reach the lead data grid with controlled rotten_lead input could attempt exploitation.

Refactor all affected queries to use prepared statements or ORM-level parameter binding, eliminating string concatenation of user inputs, and ensure that any dynamic parts are built from strictly controlled, whitelisted values.

Adopt a development standard that mandates parameterized queries for all database access, enforce this via code review and static analysis, apply strong server-side validation on all request parameters used in queries, and centralize data access logic to reduce ad-hoc SQL construction.

Find out what's already
exploitable in your codebase.