Skip to main content
Menu
Advisories

Advisory

Authenticated RCE through .htaccess in dropbox (< 1.11.40)

GHSA-853C-Q5Q4-JM2CPublished Updated GitHub

Description

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

Affected versions