/

CVE-2021-48021

Severity:

HIGH RISK

(8.2)

SQL Injection (CWE-89) in Chamilo LMS Tag Search Endpoint

CVE-2021-48021

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Database Information Disclosure

Severity:

HIGH RISK

(8.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 an unauthenticated SQL injection vulnerability in tag-search handling, where the options parameter supplied to extra_field.ajax.php can influence a database query. A remote attacker may be able to inject SQL and extract database information by sending a crafted POST request to an affected deployment.

Affected context

The issue affects Chamilo LMS 1.11.10 and versions before 1.11.16. It occurs in the searchOptionsFromTags function, which processes the options parameter from requests to extra_field.ajax.php and uses it in an SQL IN clause.

Exploit preconditions

  • Attack surface: The extra_field.ajax.php endpoint, reachable over the network.
  • Required access: No authentication is required, according to the vulnerability description.
  • Trigger point: A POST request containing a malicious JSON options array reaches tag-search processing.
  • Why exploitation is possible: Values from the request can affect SQL query structure if they are incorporated into the IN clause without safe parameterization.

Why this happens

The underlying bug is the unsafe construction of a database query using request-controlled values. When input is inserted into SQL syntax instead of being handled as data through parameterized queries, an attacker may alter the query's intended meaning. This is CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').

Potential impact

  • An attacker may retrieve database information accessible to the application's database account.
  • Sensitive records could be exposed, depending on database permissions and application data.
  • The confidentiality of the LMS and its users' data could be affected.

General mitigation guidance

Reduce risk by treating request parameters as untrusted and keeping them separate from SQL syntax.

Common defensive patterns include:

  • Using parameterized queries or prepared statements for values in IN clauses.
  • Validating and constraining the expected structure and types of JSON input.
  • Applying least-privilege permissions to database accounts.
  • Returning only necessary data and limiting database access to the application's required scope.
  • Using secure-by-default data-access abstractions that do not build SQL from raw input.

How teams detect issues like this

  • Use static analysis to identify SQL statements assembled through string concatenation or interpolation with request data.
  • Review endpoint handlers and database-access code for unsafe use of JSON values in query clauses.
  • Enforce code-review and CI policies requiring parameterized queries for database operations.
  • Monitor database and application logs for unusual requests to tag-search endpoints and unexpected query errors.

Sources

SourceLink
github.comgithub.com/chamilo/chamilo-lms/commit/23787842c2013db318e82d6987469fc8b17df0f8
github.comgithub.com/chamilo/chamilo-lms/commit/e8332fd9d5607ae7866e27936b4376ea1053ae03
github.comgithub.com/projectdiscovery/nuclei-templates/blob/main/http/vulnerabilities/other/chamilo-lms-sqli.yaml
vulncheck.comvulncheck.com/advisories/chamilo-lms-1.11.10-1.11.16-sql-injection-via-extra-field-ajax-php
vulncheck.comvulncheck.com/advisories/chamilo-lms-1.11.10-before-1.11.16-sql-injection-via-extra-field-ajax-php

Frequently asked

questions

Yes. The described attack uses POST requests to a network-accessible endpoint.

No authentication is required according to the vulnerability description.

Use parameterized queries so request values are treated as data rather than SQL syntax.

Validate input structure, use safe database APIs consistently, and review query-building code for request-controlled values.

Find out what's already
exploitable in your codebase.