# GHSA-853C-Q5Q4-JM2C: Authenticated RCE through .htaccess in dropbox (\< 1.11.40)

- Database: GitHub
- Severity: high (stated by ghsa, no CVSS score)
- Published: 2026-07-07
- Modified: 2026-09-16

## Tracked as

- [CVE-2026-61583](https://cve.now/CVE-2026-61583.md): Chamilo LMS remote code execution via file upload in course dropbox

## Affected versions

- chamilo/chamilo-lms (Packagist): through 1.11.38

## Description

### Summary

The course dropbox upload handler in Chamilo LMS 1.11.38 (`main/dropbox/dropbox_functions.inc.php`, reachable via `main/inc/ajax/dropbox.ajax.php?a=upload_file`) accepts a literal `.htaccess` filename and stores it unchanged inside the course dropbox directory. Because the dropbox directory is served directly by Apache through the root rewrite catch-all (and Chamilo requires `AllowOverride All`), an attacker-supplied `.htaccess` is applied by Apache. Any course participant (student) can chain a `.htaccess` upload with a second upload of a PHP payload disguised as a `.gif`, producing Remote Code Execution as the web-server user on a default Chamilo installation — no extra configuration required.


### Impact

- Vulnerability class: Unrestricted Upload of File with Dangerous Type + External Control of File Name (CWE-434, CWE-73) leading to Remote Code Execution.
- Required privileges: any authenticated user enrolled in a course (student) with the dropbox tool enabled (default).
- Affected version: Chamilo LMS 1.11.38 (default configuration, no special settings).
- Consequence: Remote Code Execution as the web-server user (typically `www-data`). Full read/write of the Chamilo installation, all course content, database credentials in `app/config/configuration.php`, and persistent backdoor placement. Chains with the pre-authentication SQLi in [[ADVISORY_V10]] (extract credentials → log in as student → RCE) or with the unauthenticated administrator-takeover in [[ADVISORY_V14]] (admin enrols an attacker account, then uploads) to become an effective pre-auth RCE.

### Status in later versions

#### Chamilo 1.11.36 (VULNERABLE)

`chamilo-1.11.36/main/dropbox/dropbox_functions.inc.php` contains the same `store_add_dropbox()` implementation: `$dropbox_filename = php2phps($dropbox_filename);` (no `htaccess2txt()`), the same `cb_overwrite` branch that skips the `uniqid` rename when no matching `sentWork` entry exists, and the same `move_uploaded_file()` sink. The default `upload_extensions_blacklist` value and the root-`.htaccess` catch-all are likewise unchanged. The four-weakness chain reproduces verbatim.

#### Chamilo 2.0.0 (NOT APPLICABLE)

The legacy dropbox tool has been removed in 2.0.0. `chamilo-2.0.0/public/main/dropbox/` and `chamilo-2.0.0/public/main/inc/ajax/dropbox.ajax.php` do not exist; uploads in 2.0.0 use the Symfony `ResourceNode` / `ResourceFile` model. The specific `store_add_dropbox()` primitive described above is gone.

### Author

- Sean MATTHEWS

## References

- https://github.com/chamilo/chamilo-lms/security/advisories/GHSA-853c-q5q4-jm2c

Page: https://cve.now/GHSA-853C-Q5Q4-JM2C
