CVE-2026-32756: Admidio: Unrestricted File Upload via CSRF Token Validation Bypass in Documents & Files Module

Published Mar 16, 2026
·
Updated

Summary

A critical unrestricted file upload vulnerability exists in the Documents & Files module of Admidio. Due to a design flaw in how CSRF token validation and file extension verification interact within UploadHandlerFile.php, an authenticated user with upload permissions can bypass file extension restrictions by intentionally submitting an invalid CSRF token. This allows the upload of arbitrary file types, including PHP scripts, which may lead to Remote Code Execution (RCE) on the server.

Details

1. Critical - Unrestricted File Upload leading to Remote Code Execution (RCE)

Root Cause Analysis:

The root cause lies in a design flaw in src/Infrastructure/Plugins/UploadHandlerFile.php. The UploadHandlerFile class overrides two methods from its parent UploadHandler class:

- handleformdata($file, $index) — Validates the CSRF token. On failure, it sets $file->error and returns. The request is not terminated. - handlefileupload(...) — Calls parent::handlefileupload() to physically write the file to disk, then checks if (!isset($file->error)) before running file extension validation (allowedFileExtension()).

The execution flow differs based on whether the CSRF token is valid:

- Valid CSRF token: handleformdata() does not set an error → extension check runs → invalid extension causes the uploaded file to be deleted from disk. - Invalid CSRF token: handleformdata() sets $file->error → the if (!isset($file->error)) guard in handlefileupload() causes the extension validation to be skipped entirely → the cleanup code (FileSystemUtils::deleteFileIfExists()) is never reached → the file, already written to disk by the parent class, remains on the server and is directly accessible.

In summary, the file is always saved to disk by the parent class first. The extension check and cleanup only execute when no prior error exists. A deliberate CSRF token failure bypasses the extension filter while the file remains on disk.

Affected code (src/Infrastructure/Plugins/UploadHandlerFile.php):

php // File is physically saved to disk here, before any Admidio-specific checks $file = parent::handlefileupload($uploadedfile, $name, $size, $type, $error, $index, $contentrange);

if (!isset($file->error)) { // Extension validation is only reached when no prior error is set. // If CSRF validation failed in handleformdata(), this block is skipped // and the uploaded file is never cleaned up from disk. if (!$newFile->allowedFileExtension()) { throw new Exception('SYSFILEEXTENSIONINVALID'); } }

PoC

Documents & Files Create folder <img width="762" height="729" alt="image" src="https://github.com/user-attachments/assets/2c927482-851b-4945-93d6-6e7a1e3bc21f" />

<img width="749" height="690" alt="image" src="https://github.com/user-attachments/assets/72443c87-e15f-4312-9659-8cd0661a4dae" />

File Upload Try 1-1 (before request) <img width="1856" height="635" alt="image" src="https://github.com/user-attachments/assets/d1ffaa12-aec1-45ff-a612-885d9554fb60" />

File Upload Try 1-2 (after request) <img width="1850" height="855" alt="image" src="https://github.com/user-attachments/assets/4ece4aac-1255-4189-9048-45ff3df4abcf" />

File Upload Try 1-3 (After changing CSRF to a test value, request → PHP file upload succeeds) <img width="1847" height="928" alt="image" src="https://github.com/user-attachments/assets/63f9d108-5e4f-4d32-96d2-09f9ad910873" />

✅ rcepoc.php Upload Success! <img width="926" height="814" alt="image" src="https://github.com/user-attachments/assets/4de99c31-dc3c-44f2-9936-19c3da0dfffb" />

Access the rcepoc upload path confirmed in the response and check the web shell. <img width="1635" height="922" alt="image" src="https://github.com/user-attachments/assets/0b770caf-e737-4cbd-97b9-ae191a8b79f5" />

🆗 WebShell Success <img width="685" height="187" alt="image" src="https://github.com/user-attachments/assets/e90f162b-7949-41c4-9fd1-aad3b6365adf" />

<img width="794" height="209" alt="image" src="https://github.com/user-attachments/assets/f45dae74-a830-4761-af31-f2ac28eb2586" />

Steps to Reproduce:

1. Log in to Admidio as an authenticated user with upload permissions on the Documents & Files module. 2. Navigate to a folder in the Documents & Files module and open the file upload dialog. 3. Intercept the upload POST request to /system/fileupload.php?module=documentsfiles&mode=uploadfiles&uuid=<folderuuid> using a proxy tool such as Burp Suite. 4. Replace the value of the admcsrftoken field with an arbitrary invalid string (e.g., webshellgogo). 5. Set the file to be uploaded to a PHP webshell (e.g., <?php system($GET[1]); ?>). 6. Forward the modified request. 7. Observe that the server responds with HTTP 200 OK. The JSON body contains "error":"Invalid or missing CSRF token!", yet the file is physically present on the server at the path indicated in the url field. 8. Access the uploaded PHP file directly via the URL provided in the response — arbitrary command execution is confirmed.

Impact

- An authenticated attacker with upload permissions can bypass file extension validation and upload arbitrary server-side scripts such as PHP webshells. - This leads to Remote Code Execution (RCE), potentially resulting in full server compromise, sensitive data exfiltration, and lateral movement. - While authentication is required, the attack is not limited to administrators — any member granted upload rights may exploit this vulnerability, making the attack surface broader than it may initially appear.

Remediation Measures

- The extension validation logic should be executed independently of the CSRF error state. It is recommended to move the extension check and the corresponding cleanup outside of the if (!isset($file->error)) block so that files with disallowed extensions are always removed from disk, regardless of other errors. - Rather than relying on a blacklist of dangerous extensions (e.g., .php, .phar, .phtml), it is strongly recommended to implement a whitelist of permitted extensions appropriate to a documents module (e.g., .pdf, .docx, .xlsx, .pptx, .txt). - CSRF token validation should either be performed before the file is written to disk, or a validation failure should result in immediate request termination rather than merely setting an error flag on the file object.

Other sources

Admidio is an open-source user management solution. Versions 5.0.6 and below contain a critical unrestricted file upload vulnerability in the Documents & Files module. Due to a design flaw in how CSRF token validation and file extension verification interact within UploadHandlerFile.php, an authenticated user with upload permissions can bypass file extension restrictions by intentionally submitting an invalid CSRF token. This allows the upload of arbitrary file types, including PHP scripts, which may lead to Remote Code Execution on the server, resulting in full server compromise, data exfiltration, and lateral movement. This issue has been fixed in version 5.0.7.

MITRE

Affected Software

2 affected componentsFixes available
composer/admidio/admidio<=5.0.6
5.0.7
Admidio Admidio<5.0.7

Event History

Mar 16, 2026
Advisory Published
via GitHub·09:16 PM
Data Sourced
via GitHub·09:16 PM
DescriptionSeverityWeaknessAffected Software
Mar 19, 2026
CVE Published
via MITRE·11:08 PM
Data Sourced
via MITRE·11:08 PM
DescriptionSeverityWeakness
Mar 20, 2026
Data Sourced
via NVD·12:16 AM
RemedyDescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-32756?

CVE-2026-32756 is rated as a critical severity vulnerability due to its potential for unrestricted file upload.

2

How do I fix CVE-2026-32756?

To fix CVE-2026-32756, upgrade to Admidio version 5.0.7 or later.

3

What component is affected by CVE-2026-32756?

The vulnerability affects the Documents & Files module in Admidio.

4

Who is affected by CVE-2026-32756?

Authenticated users with upload permissions are affected by CVE-2026-32756.

5

What is the nature of the vulnerability in CVE-2026-32756?

CVE-2026-32756 is an unrestricted file upload vulnerability caused by design flaws in CSRF token validation and file extension verification.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203