/

CVE-2026-45146

Severity:

HIGH RISK

(7.2)

SQL Injection (CWE-89) in Chamilo LMS Session Search

CVE-2026-45146

Received

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Sensitive data exposure, database modification or deletion, and denial of service

Severity:

HIGH RISK

(7.2)

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

Chamilo LMS has a SQL injection vulnerability in the session search action because the groupOp value in a crafted filter is not restricted to expected operators. An authenticated administrator who can invoke the action may trigger blind or time-based queries, potentially exposing or changing database data or disrupting service.

Chamilo LMS has a SQL injection vulnerability in the session search action because the groupOp value in a crafted filter is not restricted to expected operators. An authenticated administrator who can invoke the action may trigger blind or time-based queries, potentially exposing or changing database data or disrupting service.

Affected context

The issue occurs in the get_sessions action in /main/inc/ajax/model.ajax.php when session searches are requested with _search=true and JSON filters are processed. Chamilo versions before 1.11.40 and 2.0.1 are affected when attacker-controlled groupOp input reaches query logic without validation against the expected operators.

The issue occurs in the get_sessions action in /main/inc/ajax/model.ajax.php when session searches are requested with _search=true and JSON filters are processed. Chamilo versions before 1.11.40 and 2.0.1 are affected when attacker-controlled groupOp input reaches query logic without validation against the expected operators.

Exploit preconditions

  • Attack surface: The session search action in Chamilo LMS.
  • Required access: An authenticated administrator account.
  • Trigger point: A search request with _search=true and a crafted JSON filters parameter.
  • Why exploitation is possible: The groupOp value is not restricted to expected operators before being incorporated into query logic, allowing SQL syntax to influence database execution.
  • Attack surface: The session search action in Chamilo LMS.
  • Required access: An authenticated administrator account.
  • Trigger point: A search request with _search=true and a crafted JSON filters parameter.
  • Why exploitation is possible: The groupOp value is not restricted to expected operators before being incorporated into query logic, allowing SQL syntax to influence database execution.

Why this happens

The application incorporates attacker-controlled input into SQL query logic without ensuring that the input is a valid operator. This is an injection flaw mapped to CWE-89: Improper Neutralization of Special Elements used in an SQL Command. Insecure query construction allows input to be interpreted as SQL rather than only as data.

The application incorporates attacker-controlled input into SQL query logic without ensuring that the input is a valid operator. This is an injection flaw mapped to CWE-89: Improper Neutralization of Special Elements used in an SQL Command. Insecure query construction allows input to be interpreted as SQL rather than only as data.

Potential impact

  • Sensitive user, course, session, configuration, password-reset, or administrative data could be disclosed.
  • Database records could be modified or deleted, subject to the database account's privileges.
  • Expensive delayed queries could degrade availability or cause denial of service.
  • Sensitive user, course, session, configuration, password-reset, or administrative data could be disclosed.
  • Database records could be modified or deleted, subject to the database account's privileges.
  • Expensive delayed queries could degrade availability or cause denial of service.

General mitigation guidance

Mitigation generally focuses on keeping untrusted values from becoming executable SQL.

  • Use parameterized queries for data values and avoid constructing SQL from request input.
  • Validate operator choices against a narrow allowlist, such as the supported AND and OR values.
  • Apply strict validation to structured search filters and reject unexpected fields or values.
  • Use database accounts with only the privileges required by the application.
  • Limit query cost and execution time where appropriate to reduce the impact of expensive searches.

Mitigation generally focuses on keeping untrusted values from becoming executable SQL.

  • Use parameterized queries for data values and avoid constructing SQL from request input.
  • Validate operator choices against a narrow allowlist, such as the supported AND and OR values.
  • Apply strict validation to structured search filters and reject unexpected fields or values.
  • Use database accounts with only the privileges required by the application.
  • Limit query cost and execution time where appropriate to reduce the impact of expensive searches.

How teams detect issues like this

  • Use static analysis to identify query construction that incorporates request-controlled values.
  • Review search and filter handlers for operator values that are not validated against a fixed allowlist.
  • Apply automated checks to flag unsafe SQL APIs and missing parameterization in code changes.
  • Monitor database activity for unusual delayed queries, unexpected query patterns, or excessive search-related errors.
  • Use static analysis to identify query construction that incorporates request-controlled values.
  • Review search and filter handlers for operator values that are not validated against a fixed allowlist.
  • Apply automated checks to flag unsafe SQL APIs and missing parameterization in code changes.
  • Monitor database activity for unusual delayed queries, unexpected query patterns, or excessive search-related errors.

Sources

SourceLink
github.comgithub.com/chamilo/chamilo-lms/commit/4472f3089bbbca1b4713bfd7059907676b80d07f
github.comgithub.com/chamilo/chamilo-lms/commit/7cc961d60ac27eaccd6bcc8db201de2c65adfdf3
github.comgithub.com/chamilo/chamilo-lms/releases/tag/v1.11.40
github.comgithub.com/chamilo/chamilo-lms/releases/tag/v2.0.1
github.comgithub.com/chamilo/chamilo-lms/security/advisories/GHSA-prqp-8x29-cr88

Frequently asked

questions

It affects the session search action in Chamilo LMS when crafted filter input reaches query logic without operator restrictions.

An attacker needs an authenticated administrator account to call the affected action.

Keep input separate from SQL using parameterized queries, and allow only explicitly supported values for query operators.

Validate structured inputs, review query-building paths, use static analysis for unsafe SQL patterns, and limit application database privileges.

It affects the session search action in Chamilo LMS when crafted filter input reaches query logic without operator restrictions.

An attacker needs an authenticated administrator account to call the affected action.

Keep input separate from SQL using parameterized queries, and allow only explicitly supported values for query operators.

Validate structured inputs, review query-building paths, use static analysis for unsafe SQL patterns, and limit application database privileges.

Find out what's already
exploitable in your codebase.