【中危】phpmyfaq 安全更新(GHSA-8c6h-7g6x-m5x4)
安全情报快照 · 风险级别:中危 · CVSS:6.5 · CVE-2026-49205 · GHSA-8c6h-7g6x-m5x4
先看结论
phpmyfaq存在安全风险,< 4.1.4 受影响,建议升级至 4.1.4。
影响范围
| 生态 | 组件 | 受影响版本 | 首个修复版本 |
|---|---|---|---|
| composer | thorsten/phpmyfaq |
< 4.1.4 | 4.1.4 |
| composer | phpmyfaq/phpmyfaq |
< 4.1.4 | 4.1.4 |
处置建议
优先将 thorsten/phpmyfaq 升级至 4.1.4 或更高版本;升级前请结合业务依赖完成兼容性验证。
上游技术详情(原文)
Missing Authorization in API CategoryController — CVE-2026-24421 fixed BackupController by adding userHasPermission(PermissionType::BACKUP). The same fix was NOT applied to 4 other write endpoints in the public API. All 4 only call hasValidToken() (shared API key) but never call userHasPermission(), allowing any API token holder to perform admin operations regardless of their user permissions.
Summary
CVE-2026-24421 fixed BackupController by adding: $this->userHasPermission(PermissionType::BACKUP);
The same fix was NOT applied to 4 other write endpoints in the public API. All 4 only call $this->hasValidToken() — which checks a shared API key header, NOT the individual user's role permissions.
Affected Endpoints
-
src/phpMyFAQ/Controller/Api/CategoryController.php → create() POST /api/v4.0/category
Missing: userHasPermission(PermissionType::CATEGORY_ADD)
Any API token holder can create categories regardless of user role. -
src/phpMyFAQ/Controller/Api/FaqController.php → create() POST /api/v4.0/faq
Missing: userHasPermission(PermissionType::FAQ_ADD)
Any API token holder can create FAQ entries regardless of user role. -
src/phpMyFAQ/Controller/Api/FaqController.php → update() PUT /api/v4.0/faq
Missing: userHasPermission(PermissionType::FAQ_EDIT)
Any API token holder can update any FAQ entry regardless of user role. -
src/phpMyFAQ/Controller/Api/QuestionController.php → create() POST /api/v4.0/question
Missing: permission check
Any API token holder can create questions regardless of user role.
Root Cause
All 4 methods only call:
$this->hasValidToken(); ← shared API key, not per-user
The fixed BackupController correctly calls:
$this->userHasPermission(PermissionType::BACKUP);
PermissionType::CATEGORY_ADD, FAQ_ADD, FAQ_EDIT all exist in src/phpMyFAQ/Enums/PermissionType.php — they just are not being used.
Fix
Add userHasPermission() before the logic in each method:
// CategoryController.create()
$this->userHasPermission(PermissionType::CATEGORY_ADD);
// FaqController.create()
$this->userHasPermission(PermissionType::FAQ_ADD);
// FaqController.update()
$this->userHasPermission(PermissionType::FAQ_EDIT);
Reporter
CONTACT
Santhoshini Ganta
Github:@santhoshinipayload
Email: santhoshinive75@gmail.com
LinkedIn: http://linkedin.com/in/santhoshini-g-1440621ba
来源与许可
- GitHub Advisory GHSA-8c6h-7g6x-m5x4
- https://github.com/thorsten/phpMyFAQ/security/advisories/GHSA-8c6h-7g6x-m5x4
- https://nvd.nist.gov/vuln/detail/CVE-2026-49205
- https://github.com/thorsten/phpMyFAQ/commit/d5c195b1ecf5dc30fb825d7eb50d22481c24cb07
本页自动同步 GitHub Advisory Database 的公开数据,并保留上游原文供核验;不宣称原创分析。数据许可:CC-BY-4.0。
评论
登录 后参与讨论。
还没有评论,来说两句。