/

CVE-2026-33704

Severity:

HIGH RISK

(7.1)

Unrestricted File Upload in Chamilo LMS

CVE-2026-33704

Analyzed

Vulnerability type

Category:

Unrestricted File Upload

CWE:

CWE-434

Impact:

Remote Code Execution (RCE) on vulnerable PHP/Apache deployments

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

Chamilo LMS exposes an unrestricted file upload issue in the BigUpload endpoint that allows any authenticated user to write arbitrary content to server-side files.

Because the attacker can control the filename and content, and the .pht extension is not safely filtered, this can result in remote code execution on Apache deployments that treat .pht as PHP.

Affected context

This vulnerability appears in Chamilo LMS deployments prior to 1.11.38 that:

  • Enable the BigUpload endpoint for authenticated users (including students)
  • Run on web servers (e.g., Apache) that interpret .pht files as PHP scripts
  • Store uploaded content in web-accessible locations without strict execution separation

The issue arises because the upload mechanism allows user-controlled filenames and raw body content to be written directly to disk, with only partial extension filtering.

Exploit preconditions

  • Attack surface: HTTP(S) BigUpload endpoint in Chamilo LMS
  • Required access: Any authenticated user account (including low-privilege student roles)
  • Trigger point: Sending a POST request where:
  • The key parameter sets the target filename
  • The raw POST body becomes the file content
  • Why exploitation is possible:
  • The upload handler allows arbitrary file paths/names based on user input
  • Only .php extensions are filtered, leaving .pht and potentially other executable mappings untouched
  • On Apache configurations that treat .pht files as PHP, the uploaded file is parsed as server-side code when accessed

Why this happens

The core issue is an unrestricted file upload pattern where user-controlled data is written to server-side files with insufficient validation and extension handling.

The BigUpload endpoint trusts the key parameter to define the filename and writes the raw POST body directly to disk, only applying a basic safeguard against .php extensions.

This maps to CWE-434: Unrestricted Upload of File with Dangerous Type, because attackers can:

  • Choose a script-capable extension (.pht in this case) that the server executes
  • Place arbitrary content in that file, which the server then interprets as executable PHP on certain configurations.

Potential impact

  • Remote code execution under the web server or application runtime user
  • Full compromise of the Chamilo LMS application and its data
  • Unauthorized access to user records, course content, and stored credentials or tokens
  • Lateral movement to other systems reachable from the compromised server
  • Installation of web shells, backdoors, or persistence mechanisms
  • Use of the compromised server as a pivot point in broader network attacks

General mitigation guidance

Effective mitigation focuses on strictly controlling what can be uploaded and where it resides:

  • Enforce an allowlist of safe file types/extensions and reject or neutralize all others; avoid relying on simple blacklist filtering (e.g., only blocking .php).
  • Store uploaded files outside of web-accessible document roots, or on storage that cannot be executed as code by the web server.
  • Decouple file names on disk from user-controlled parameters by generating server-side identifiers rather than trusting client-supplied filenames or paths.
  • Normalize and validate file paths to prevent extension tricks, double extensions, or alternate handler mappings such as .pht.
  • Configure the web server to disallow execution of dynamic code from upload directories (e.g., disable PHP handlers there).
  • Apply least-privilege to the web server user so that even if an upload-related flaw exists, its ability to modify sensitive locations is reduced.

How teams detect issues like this

Organizations can look for this class of issue using a combination of static and runtime techniques:

  • Static analysis: Flag code paths that:
  • Write HTTP request bodies to the filesystem
  • Use user input (e.g., request parameters like key) directly in file paths or names
  • Perform only simple extension checks or blacklists for dangerous file types
  • Code review signals:
  • Upload handlers that trust client-provided filenames or paths
  • Lack of a clear allowlist for file types and MIME types
  • Uploaded files stored under web-accessible directories with active script handlers
  • Runtime and log analysis:
  • Monitor access logs for requests to unusual script-like extensions in upload directories (.pht, .phar, etc.)
  • Alert on patterns where low-privilege accounts perform repeated uploads followed by execution attempts.
  • Policy enforcement:
  • Integrate secure upload policies into CI/CD checks and automated review tools that scan for risky file-handling constructs.

Sources

SourceLink
github.comgithub.com/chamilo/chamilo-lms/commit/9748f1ffbdb8b6dc84c0e0591c9d3c1d92e21c00
github.comgithub.com/chamilo/chamilo-lms/security/advisories/GHSA-phfx-pwwg-945v

Frequently asked

questions

Yes. Any user who can authenticate to the Chamilo LMS instance and reach the BigUpload endpoint can potentially exploit the issue, assuming the server is reachable over the network and executes .pht files.

Only a valid authenticated account is required, including low-privilege roles such as students. No administrative permissions are necessary if the vulnerable upload endpoint is accessible to regular users.

Implement a strict upload pipeline that uses server-generated file names, performs robust allowlist-based extension checks, stores uploaded files outside executable directories, and configures the web server so uploaded content cannot be executed as code. Treat all uploads as untrusted data, not executable resources.

Design upload features under a "data-only" assumption: enforce strong validation, avoid trusting client-controlled filenames, isolate uploads from execution contexts, and incorporate security reviews and automated checks specifically targeting file handling and upload logic.

Find out what's already
exploitable in your codebase.