Mittel

phpMyFAQ has Potential Authenticated Path Traversal in PDF Export

  • Veröffentlicht: 25.08.2026
  • Aktualisiert: 11.10.2026 10:22

Summary

There is an authenticated path traversal condition in the PDF export functionality, specifically within the PDF image resolution logic.

The issue may allow a privileged FAQ editor to cause the application to attempt reading files outside the intended content directory during PDF generation.


Affected Component

File: src/phpMyFAQ/Export/Pdf/Wrapper.php

Function: concatenatePaths()


Root Cause

The path resolution logic relies on locating the substring "content" within a user-controlled path:

php
$pos = strpos($trimmedFile, 'content');
$relativePath = substr($trimmedFile, (int) $pos);

If "content" is not present, strpos() returns false, which becomes 0 when cast to an integer.

As a result, the entire attacker-controlled path is preserved.

Example:

php
$trimmedFile = "../../../etc/passwd";
$pos = false;
$relativePath = "../../../etc/passwd";

The resulting path is later processed by:

php
file_get_contents($resolvedPath);

without canonicalization or a root-directory containment check.


Observed Data Flow

FAQ Content
    ->
PDF Export
    ->
WriteHTML()
    ->
Wrapper::Image()
    ->
concatenatePaths()
    ->
file_get_contents()

Potential Impact

Based on code review, a user with FAQ editing privileges may be able to store HTML containing crafted image paths that are processed during PDF generation.

Potential consequences may include:

  • Path traversal outside the intended content directory
  • Local file read attempts during PDF export
  • Possible disclosure of readable files depending on file type, sanitization behavior, and PDF rendering constraints

Discovery Method

This issue was initially detected by an internally developed SAST tool during analysis of the phpMyFAQ source code.

The finding was then manually investigated and validated through code review.

While the original scanner output classified the issue as a generic path traversal/local file inclusion pattern, manual analysis identified the specific root cause in the path resolution logic of concatenatePaths().


Potential Exploitation Scenario

The following scenario is based on code review and intended to illustrate the potential impact:

  1. A user with FAQ editing privileges creates or modifies a FAQ entry.

  2. The FAQ content contains an HTML image tag with a crafted relative path that does not include the expected content directory reference.

  3. The HTML content is stored and later processed by the PDF export functionality.

  4. When a user requests the PDF version of the FAQ, the application invokes WriteHTML(), which eventually reaches Wrapper::Image().

  5. concatenatePaths() constructs a filesystem path without canonicalization or directory containment validation.

  6. The resulting path reaches file_get_contents(), causing the application to attempt reading a file outside the intended content directory.

  7. Depending on sanitization behavior, file permissions, image validation, and PDF rendering behavior, the contents of the targeted file may potentially be exposed to the PDF consumer.

Based on my current analysis, exploitation would require a user capable of editing FAQ content and is therefore not considered an anonymous or unauthenticated attack vector.


Suggested Remediation

Consider replacing substring-based path anchoring with:

  • realpath() canonicalization
  • Strict root-directory containment checks
  • Explicit allowlisting of permitted image locations

Betroffene Software

Klicken Sie auf eine Technologie, um alle zugehörigen Schwachstellen anzuzeigen.

PlattformPaketAnfällige VersionenBehoben in
Composer-Paket phpmyfaq/phpmyfaq >= 4.0.0-alpha, < 4.1.5 4.1.5
Composer-Paket thorsten/phpmyfaq >= 4.0.0-alpha, < 4.1.5 4.1.5

Verweise

CVSS-Wert 4.9/10
CVSS-Vektor
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N
Schwäche (CWE)
CWE-22
Plattform
Composer
Paket
phpmyfaq/phpmyfaq, thorsten/phpmyfaq
Veröffentlicht
25.08.2026
Aktualisiert
11.10.2026 10:22

Quellen und Lizenzen

OSV / GitHub Advisory Database - GHSA-88g4-74f3-63x9 - CC BY 4.0

Schwachstellenhistorie: phpmyfaq/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.

Alle (47) im Archiv
Einträge insgesamt
47
Erste → letzte
10.2022 09.2026
Ohne Fix
2
In Angriffen ausgenutzt
0

Verteilung nach Schweregrad

  • Kritisch 2
  • Hoch 18
  • Mittel 25
  • Niedrig 2

Veröffentlichungen pro Jahr

  1. 2022: 1
  2. 2023: 0
  3. 2024: 11
  4. 2025: 3
  5. 2026: 32
Schweregrad:
  1. Hoch · 8.1 CVE-2026-56737 >= 3.2.0, < 4.1.6 4.1.6
  2. phpMyFAQ has Potential Authenticated Path Traversal in PDF Export dieser Eintrag
    Mittel · 4.9 CVE-2026-57961 >= 4.0.0-alpha, < 4.1.5 4.1.5
  3. Hoch · 7.5 CVE-2026-35672 < 4.1.3 4.1.3
  4. Hoch · 8.8 CVE-2026-35671 < 4.1.3 4.1.3
  5. Hoch · 7.6 CVE-2026-46367 >= 4.1.1, < 4.1.2 4.1.2
  6. Hoch · 7.2 CVE-2024-28105 >= 3.2.5, < 3.2.6 3.2.6
  7. Hoch · 8.8 CVE-2024-28107 >= 3.2.5, < 3.2.6 3.2.6
  8. Hoch · 8.8 CVE-2024-27299 >= 3.2.5, < 3.2.6 3.2.6
Mehr anzeigen (1) 20 von 21 angezeigt

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.

Anwendung verbinden
DockRay Newsletter

Anwendungssicherheit in Ihrem Postfach

Wichtige Schwachstellen, konkrete Empfehlungen und praktische Tipps für Ihre Anwendungen. Wählen Sie Ihre Technologien und verfolgen Sie, was für Ihr Projekt relevant ist.

  • Eine tägliche Zusammenfassung neuer Schwachstellen, auch kritischer.
  • Benachrichtigungen über wichtige Updates.
  • Praktische Tipps zur Sicherheit und Überwachung von Anwendungen.

Leer lassen, um Meldungen zu allen Technologien zu erhalten.

Kostenlos anmelden. In jeder E-Mail mit einem Klick abmelden.