GHSA-88G4-74F3-63X9

GHSA-88G4-74F3-63X9 is a medium-severity path traversal vulnerability in thorsten/phpmyfaq (composer), affecting versions >= 4.0.0-alpha, <= 4.1.4. It is fixed in 4.1.5.

Does this CVE actually affect you?

Kodem shows which CVEs are reachable and running in your applications, so you fix what's exploitable, not just what's listed.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Runtime intelligence, not another scanner.

Summary

phpMyFAQ has Potential Authenticated Path Traversal in PDF Export

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:

$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:

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

The resulting path is later processed by:

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

Impact

Input manipulates file paths to reach files outside the intended directory, such as configuration or credential files. Typical impact: unauthorized file read or write outside the intended directory.

GHSA-88G4-74F3-63X9 has a CVSS score of 4.9 (Medium). The vector is network-reachable, high privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (4.1.5); upgrading removes the vulnerable code path.

Affected versions

thorsten/phpmyfaq (>= 4.0.0-alpha, <= 4.1.4) phpmyfaq/phpmyfaq (>= 4.0.0-alpha, <= 4.1.4)

Security releases

thorsten/phpmyfaq → 4.1.5 (composer) phpmyfaq/phpmyfaq → 4.1.5 (composer)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

Already deployed Kodem?

See it in your environmentNew to Kodem? Get a demo →

Remediation advice

Upgrade the following packages to resolve this vulnerability:

thorsten/phpmyfaq to 4.1.5 or later; phpmyfaq/phpmyfaq to 4.1.5 or later

Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.

Frequently Asked Questions

  1. What is GHSA-88G4-74F3-63X9? GHSA-88G4-74F3-63X9 is a medium-severity path traversal vulnerability in thorsten/phpmyfaq (composer), affecting versions >= 4.0.0-alpha, <= 4.1.4. It is fixed in 4.1.5. Input manipulates file paths to reach files outside the intended directory, such as configuration or credential files.
  2. How severe is GHSA-88G4-74F3-63X9? GHSA-88G4-74F3-63X9 has a CVSS score of 4.9 (Medium). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
  3. Which packages are affected by GHSA-88G4-74F3-63X9?
    • thorsten/phpmyfaq (composer) (versions >= 4.0.0-alpha, <= 4.1.4)
    • phpmyfaq/phpmyfaq (composer) (versions >= 4.0.0-alpha, <= 4.1.4)
  4. Is there a fix for GHSA-88G4-74F3-63X9? Yes. GHSA-88G4-74F3-63X9 is fixed in 4.1.5. Upgrade to this version or later.
  5. Is GHSA-88G4-74F3-63X9 exploitable, and should I be worried? Whether GHSA-88G4-74F3-63X9 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  6. What actually determines whether GHSA-88G4-74F3-63X9 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  7. How do I fix GHSA-88G4-74F3-63X9?
    • Upgrade thorsten/phpmyfaq to 4.1.5 or later
    • Upgrade phpmyfaq/phpmyfaq to 4.1.5 or later

Stop the waste.
Protect your environment with Kodem.