Description
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.
Problem types
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Product status
Any version before 4.1.5
4.1.5 (semver)
Credits
DomainXTech
References
github.com/...pMyFAQ/security/advisories/GHSA-88g4-74f3-63x9 (GitHub Security Advisory (GHSA-88g4-74f3-63x9))
www.vulncheck.com/...df-export-via-concatenatepaths-function (VulnCheck Advisory: phpMyFAQ - Authenticated Path Traversal in PDF Export via concatenatePaths Function)