+ "details": "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.\n\n## Summary\n\nCVE-2026-24421 fixed BackupController by adding: $this->userHasPermission(PermissionType::BACKUP);\n\nThe 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.\n\n## Affected Endpoints\n\n1. src/phpMyFAQ/Controller/Api/CategoryController.php → create() POST /api/v4.0/category\nMissing: userHasPermission(PermissionType::CATEGORY_ADD)\nAny API token holder can create categories regardless of user role.\n\n2. src/phpMyFAQ/Controller/Api/FaqController.php → create() POST /api/v4.0/faq\n Missing: userHasPermission(PermissionType::FAQ_ADD)\n Any API token holder can create FAQ entries regardless of user role.\n\n3. src/phpMyFAQ/Controller/Api/FaqController.php → update() PUT /api/v4.0/faq\n Missing: userHasPermission(PermissionType::FAQ_EDIT)\n Any API token holder can update any FAQ entry regardless of user role.\n\n4. src/phpMyFAQ/Controller/Api/QuestionController.php → create() POST /api/v4.0/question\n Missing: permission check\n Any API token holder can create questions regardless of user role.\n\n## Root Cause\n\nAll 4 methods only call:\n $this->hasValidToken(); ← shared API key, not per-user\n\nThe fixed BackupController correctly calls:\n $this->userHasPermission(PermissionType::BACKUP); \n\nPermissionType::CATEGORY_ADD, FAQ_ADD, FAQ_EDIT all exist in src/phpMyFAQ/Enums/PermissionType.php — they just are not being used.\n\n## Fix\n\nAdd userHasPermission() before the logic in each method:\n\n // CategoryController.create()\n $this->userHasPermission(PermissionType::CATEGORY_ADD);\n\n // FaqController.create()\n $this->userHasPermission(PermissionType::FAQ_ADD);\n\n // FaqController.update()\n $this->userHasPermission(PermissionType::FAQ_EDIT);\n\n## Reporter\n\nCONTACT\nSanthoshini Ganta\nGithub:@santhoshinipayload\nEmail: santhoshinive75@gmail.com\nLinkedIn: http://linkedin.com/in/santhoshini-g-1440621ba",
0 commit comments