CVE-2026-57961
phpMyFAQ - Authenticated Path Traversal in PDF Export via concatenatePaths Function
phpMyFAQ before 4.1.5 contains a potential authenticated path traversal vulnerability in the concatenatePaths() function within src/phpMyFAQ/Export/Pdf/Wrapper.php. A user with FAQ editing privileges can store HTML containing crafted image paths that are processed during PDF generation. The path resolution logic locates the substring "content" within a user-controlled path using strpos(); when "content" is absent, strpos() returns false, which becomes 0 when cast to an integer, preserving the entire attacker-controlled path. This path is later passed to file_get_contents() without canonicalization or root-directory containment validation, which may allow reading of files outside the intended content directory.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- High
- User interaction
- None
What an attacker can affect
- Confidentiality
- Low
- Integrity
- None
- Availability
- None
Exploit likelihood
What each source reports
CVE List Score used
5.1
phpMyFAQ - Authenticated Path Traversal in PDF Export via concatenatePaths Function
phpMyFAQ before 4.1.5 contains a potential authenticated path traversal vulnerability in the concatenatePaths() function within src/phpMyFAQ/Export/Pdf/Wrapper.php. A user with FAQ editing privileges can store HTML containing crafted image paths that are processed during PDF generation. The path resolution logic locates the substring "content" within a user-controlled path using strpos(); when "content" is absent, strpos() returns false, which becomes 0 when cast to an integer, preserving the entire attacker-controlled path. This path is later passed to file_get_contents() without canonicalization or root-directory containment validation, which may allow reading of files outside the intended content directory.
- Record
CVE-2026-57961- CVSS 4.0
- 5.1 Medium
CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N - CVSS 3.1
- 2.7 Low
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:N/A:N - Weakness
- CWE-22
- Updated
- 2026-11-02
EUVDEUVD-2026-42891
5.1
phpMyFAQ before 4.1.5 contains a potential authenticated path traversal vulnerability in the concatenatePaths() function within src/phpMyFAQ/Export/Pdf/Wrapper.php. A user with FAQ editing privileges can store HTML containing crafted image paths that are processed during PDF generation. The path resolution logic locates the substring "content" within a user-controlled path using strpos(); when "content" is absent, strpos() returns false, which becomes 0 when cast to an integer, preserving the entire attacker-controlled path. This path is later passed to file_get_contents() without canonicalization or root-directory containment validation, which may allow reading of files outside the intended content directory.
- Record
EUVD-2026-42891- CVSS 4.0
- 5.1 Medium
CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-88g4-74f3-63x9
4.9
phpMyFAQ has Potential Authenticated Path Traversal in PDF Export
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:
$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:
-
A user with FAQ editing privileges creates or modifies a FAQ entry.
-
The FAQ content contains an HTML image tag with a crafted relative path that does not include the expected
contentdirectory reference. -
The HTML content is stored and later processed by the PDF export functionality.
-
When a user requests the PDF version of the FAQ, the application invokes
WriteHTML(), which eventually reachesWrapper::Image(). -
concatenatePaths()constructs a filesystem path without canonicalization or directory containment validation. -
The resulting path reaches
file_get_contents(), causing the application to attempt reading a file outside the intended content directory. -
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
- Record
GHSA-88g4-74f3-63x9- CVSS 3.1
- 4.9 Medium
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N - Weakness
- CWE-22
- Updated
- 2026-11-02
GitHub AdvisoriesGHSA-j3vx-7xgh-q759
5.1
phpMyFAQ before 4.1.5 contains a potential authenticated path traversal vulnerability in the...
phpMyFAQ before 4.1.5 contains a potential authenticated path traversal vulnerability in the concatenatePaths() function within src/phpMyFAQ/Export/Pdf/Wrapper.php. A user with FAQ editing privileges can store HTML containing crafted image paths that are processed during PDF generation. The path resolution logic locates the substring "content" within a user-controlled path using strpos(); when "content" is absent, strpos() returns false, which becomes 0 when cast to an integer, preserving the entire attacker-controlled path. This path is later passed to file_get_contents() without canonicalization or root-directory containment validation, which may allow reading of files outside the intended content directory.
- Record
GHSA-j3vx-7xgh-q759- CVSS 4.0
- 5.1 Medium
CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X - CVSS 3.1
- 2.7 Low
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:N/A:N - Weakness
- CWE-22
- Updated
- 2026-11-02
NVD
5.1
phpMyFAQ before 4.1.5 contains a potential authenticated path traversal vulnerability in the concatenatePaths() function within src/phpMyFAQ/Export/Pdf/Wrapper.php. A user with FAQ editing privileges can store HTML containing crafted image paths that are processed during PDF generation. The path resolution logic locates the substring "content" within a user-controlled path using strpos(); when "content" is absent, strpos() returns false, which becomes 0 when cast to an integer, preserving the entire attacker-controlled path. This path is later passed to file_get_contents() without canonicalization or root-directory containment validation, which may allow reading of files outside the intended content directory.
- Record
CVE-2026-57961- CVSS 4.0
- 5.1 Medium
CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X - CVSS 3.1
- 2.7 Low
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:N/A:N - Weakness
- CWE-22
- Updated
- 2026-11-02
OSV
5.1
phpMyFAQ - Authenticated Path Traversal in PDF Export via concatenatePaths Function
phpMyFAQ before 4.1.5 contains a potential authenticated path traversal vulnerability in the concatenatePaths() function within src/phpMyFAQ/Export/Pdf/Wrapper.php. A user with FAQ editing privileges can store HTML containing crafted image paths that are processed during PDF generation. The path resolution logic locates the substring "content" within a user-controlled path using strpos(); when "content" is absent, strpos() returns false, which becomes 0 when cast to an integer, preserving the entire attacker-controlled path. This path is later passed to file_get_contents() without canonicalization or root-directory containment validation, which may allow reading of files outside the intended content directory.
- Record
CVE-2026-57961- CVSS 4.0
- 5.1 Medium
CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N - Weakness
- CWE-22
- Updated
- 2026-11-07
OSVGHSA-88g4-74f3-63x9
4.9
phpMyFAQ has Potential Authenticated Path Traversal in PDF Export
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:
$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:
-
A user with FAQ editing privileges creates or modifies a FAQ entry.
-
The FAQ content contains an HTML image tag with a crafted relative path that does not include the expected
contentdirectory reference. -
The HTML content is stored and later processed by the PDF export functionality.
-
When a user requests the PDF version of the FAQ, the application invokes
WriteHTML(), which eventually reachesWrapper::Image(). -
concatenatePaths()constructs a filesystem path without canonicalization or directory containment validation. -
The resulting path reaches
file_get_contents(), causing the application to attempt reading a file outside the intended content directory. -
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
- Record
GHSA-88g4-74f3-63x9- CVSS 3.1
- 4.9 Medium
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N - Weakness
- CWE-22
- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
thorsten/phpmyfaqPackagist |
4.0.0-alpha to 4.1.4 | 4.1.5 |
phpmyfaq/phpmyfaqPackagist |
4.0.0-alpha to 4.1.4 | 4.1.5 |
thorsten/phpmyfaqPackagist |
4.0.0-alpha up to 4.1.5, plus listed versions 4.0.04.0.0-RC4.0.0-RC.24.0.0-RC.34.0.0-RC.4 Show 40 moreShow less4.0.0-RC.54.0.0-alpha.24.0.0-alpha.34.0.0-alpha.44.0.0-beta4.0.0-beta.24.0.14.0.104.0.114.0.124.0.134.0.144.0.154.0.164.0.184.0.194.0.24.0.34.0.44.0.54.0.64.0.74.0.84.0.94.1.04.1.0-RC4.1.0-RC.24.1.0-RC.44.1.0-RC.54.1.0-RC.64.1.0-RC.74.1.0-alpha4.1.0-alpha.24.1.0-alpha.34.1.0-beta4.1.0-beta.24.1.14.1.24.1.34.1.4 |
4.1.5 |
phpmyfaq/phpmyfaqPackagist |
4.0.0-alpha up to 4.1.5, plus listed versions 4.0.04.0.0-RC4.0.0-RC.24.0.0-RC.34.0.0-RC.4 Show 40 moreShow less4.0.0-RC.54.0.0-alpha.24.0.0-alpha.34.0.0-alpha.44.0.0-beta4.0.0-beta.24.0.14.0.104.0.114.0.124.0.134.0.144.0.154.0.164.0.184.0.194.0.24.0.34.0.44.0.54.0.64.0.74.0.84.0.94.1.04.1.0-RC4.1.0-RC.24.1.0-RC.44.1.0-RC.54.1.0-RC.64.1.0-RC.74.1.0-alpha4.1.0-alpha.24.1.0-alpha.34.1.0-beta4.1.0-beta.24.1.14.1.24.1.34.1.4 |
4.1.5 |
History
| Recorded | Changed | Sources |
|---|---|---|
| facts | OSV | |
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2026-57961 is a medium vulnerability (CVSS 5.1) in Phpmyfaq, published July 10, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.40%, the 34th percentile. Fixed in thorsten/phpmyfaq 4.1.5.
References
github.com/thorsten/phpMyFAQ/security/advisories/GHSA-88g4-74f3-63x9
vulncheck.com/advisories/phpmyfaq-authenticated-path-traversal-in-pdf-export-via-concatenatepaths-function
github.com/thorsten/phpMyFAQ/commit/91ce64405479933d7d62c751fa79c2f5c6fda591
github.com/thorsten/phpMyFAQ/commit/b709ebe69405385785c2a74ae940c3e8d4cd0a8b
github.com/advisories/GHSA-88g4-74f3-63x9
nvd.nist.gov/vuln/detail/CVE-2026-57961
github.com/advisories/GHSA-j3vx-7xgh-q759
github.com/CVEProject/cvelistV5/tree/main/cves/2026/57xxx/CVE-2026-57961.json
github.com/thorsten/phpMyFAQ