/

CVE-2026-33618

Severity:

HIGH RISK

(8.8)

Code Injection in Chamilo LMS Platform Configuration Parsing

CVE-2026-33618

Analyzed

Vulnerability type

Category:

Code Injection

CWE:

CWE-95

Impact:

Remote Code Execution

Severity:

HIGH RISK

(8.8)

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 versions prior to 2.0.0-RC.3 contain an eval injection vulnerability in the PlatformConfigurationController::decodeSettingArray() method, which uses PHP's eval() to parse platform settings loaded from the database.

An attacker who can modify platform settings (for example, via admin access obtained through a separate issue) may inject arbitrary PHP code that is executed whenever any user, including unauthenticated visitors, accesses the /platform-config/list endpoint.

Affected context

This vulnerability affects Chamilo LMS deployments where:

  • Platform configuration settings are stored in the database and interpreted at runtime, and
  • The PlatformConfigurationController::decodeSettingArray() method uses PHP's eval() to interpret those settings, and
  • Administrative users can create or modify configurable settings that are later parsed by this method.

In such environments, configuration data effectively crosses a trust boundary but is still treated as executable PHP code, turning the configuration subsystem into a code execution surface.

Exploit preconditions

  • Attack surface: HTTP requests to the /platform-config/list endpoint in Chamilo LMS.
  • Required access: Ability to modify platform settings in the database, typically via administrative privileges or any other avenue that grants write access to those settings.
  • Trigger point: Any visit (including by unauthenticated users) to /platform-config/list, which causes the vulnerable decodeSettingArray() method to read settings and invoke eval() on their contents.
  • Why exploitation is possible: Platform settings, which should be treated as data, are passed directly into PHP's eval() without robust confinement, allowing attacker-controlled configuration values to be interpreted as executable PHP code.

Why this happens

The root cause is the use of PHP's eval() to interpret configuration values retrieved from the database, mapping directly to CWE-95: Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection').

Instead of treating configuration as data, the decodeSettingArray() method executes it as code, effectively merging configuration and logic. Any attacker who can influence those settings can inject PHP directives that are evaluated at runtime. This pattern is inherently unsafe because:

  • It expands the attack surface from normal request handlers to configuration parsing paths.
  • It bypasses normal input validation layers by executing the raw configuration string.
  • It grants the attacker the same execution context and privileges as the application process.

Potential impact

  • Execution of arbitrary PHP code within the web server process.
  • Full compromise of the Chamilo LMS instance, including database and configuration data.
  • Theft or modification of learner records, course content, and assessment data.
  • Installation of webshells or backdoors for persistent access.
  • Use of the compromised LMS as a pivot point for further attacks within the hosting environment.
  • Defacement of the LMS portal or distribution of malicious content to end users.

General mitigation guidance

Effective mitigation focuses on eliminating dynamic code evaluation in configuration handling and tightening the trust boundaries around settings:

  • Replace any use of eval() in configuration parsing with structured data handling (e.g., arrays, JSON, or serialized formats) that are decoded using standard, non-executing parsing functions.
  • Constrain configuration values to well-defined data types (booleans, enums, numeric ranges, fixed-format strings) and enforce strict validation rules before use.
  • Treat configuration data as untrusted input, even when stored server-side, and avoid patterns where configuration can alter control flow through evaluated code.
  • Apply least-privilege to the web application runtime so that, if code execution occurs, its ability to affect the broader system is limited (file system permissions, database privileges, outbound network restrictions).
  • Separate administrative configuration that affects logic from general UI-driven settings, and avoid giving UI-level controls a direct path into executable code paths.

How teams detect issues like this

Organizations can detect and monitor for this class of vulnerability through several approaches:

  • Static analysis: Configure application security testing tools or linters to flag any use of eval(), create_function(), or similar dynamic evaluation functions, especially when arguments originate from databases or HTTP input.
  • Code review: Establish review guidelines that treat dynamic evaluation as a high-risk pattern requiring explicit justification and alternatives; reviewers should look for controller or configuration code paths that interpret strings as PHP code.
  • Configuration change auditing: Log and audit all changes to platform settings, particularly those that can influence behavior or contain templated content, and alert on unusual or code-like patterns (e.g., PHP tags, function calls) in stored settings.
  • Runtime monitoring: Use web application firewalls and intrusion detection systems to watch for anomalous responses or behaviors indicative of injected code execution, such as unexpected outbound connections or system-level error messages.
  • Policy enforcement: Integrate secure coding policies into CI/CD pipelines to automatically block new uses of eval() or similar constructs in critical components such as configuration controllers.

Sources

SourceLink
github.comgithub.com/chamilo/chamilo-lms/commit/f2c382c94a3f153a4d7e5ce5686c5a219fd09b3b
github.comgithub.com/chamilo/chamilo-lms/security/advisories/GHSA-hp4w-jmwc-pg7w

Frequently asked

questions

Yes. Once an attacker has managed to inject malicious PHP into the platform settings, exploitation occurs when any user accesses the /platform-config/list endpoint, which can typically be reached over the network without authentication. The actual code execution happens server-side as part of handling that request.

The attacker needs the ability to modify platform configuration settings that are processed by decodeSettingArray(). In many deployments, this corresponds to administrator-level access within the LMS, though such access may be obtained via another vulnerability or compromised credentials.

The most robust fix is to remove all use of eval() and similar dynamic evaluation mechanisms from configuration parsing, replacing them with structured data formats parsed by non-executing functions and guarded by strict validation rules. Configuration values should never be treated as executable PHP.

Prevention hinges on a secure coding policy that forbids dynamic code evaluation for user- or admin-controlled data, combined with automated checks to enforce that policy. Adopting safer configuration patterns (typed settings, schemas, and serialization formats), performing thorough code reviews of configuration-handling components, and applying least-privilege to the runtime environment all help reduce the likelihood and impact of similar vulnerabilities.

Find out what's already
exploitable in your codebase.