English version →
Webアプリケーション
CVE-2026-46359 high CVSS 7.5

thorsten/phpmyfaq に SQLインジェクション (CVE-2026-46359)

概要

thorsten/phpmyfaq に SQLインジェクション (CVE-2026-46359) が存在。悪用されるとシステム全体を乗っ取られる可能性があります。sprintf 経由で攻撃可能。対策: 4.1.2 以上に更新。

原文の説明

取得元が公開している説明をそのまま載せています (多くは英語)。

Summary

CurrentUser::setTokenData() in phpmyfaq/src/phpMyFAQ/User/CurrentUser.php at lines 515-534 builds a SQL UPDATE statement with sprintf and interpolates OAuth token fields (refresh_token, access_token, code_verifier, and json_encode($token['jwt'])) without calling $db->escape(). Sibling methods setAuthSource() and setRememberMe() in the same file do call $db->escape() on user-controlled values, so the omission is local to this method. An attacker (Bob) whose Azure AD display name contains a single quote (for example O'Brien, or a deliberate SQL payload) breaks out of the string literal and injects arbitrary SQL against the phpMyFAQ database.

Details

Vulnerable code (phpmyfaq/src/phpMyFAQ/User/CurrentUser.php, lines 513-534):

public function setTokenData(#[\SensitiveParameter] array $token): bool
{
    $update = sprintf(
        "
        UPDATE
            %sfaquser
        SET
            refresh_token = '%s',
            access_token = '%s',
            code_verifier = '%s',
            jwt = '%s'
        WHERE
            user_id = %d",
        Database::getTablePrefix(),
        $token['refresh_token'],
        $token['access_token'],
        $token['code_verifier'],
        json_encode($token['jwt'], JSON_THROW_ON_ERROR),
        $this->getUserId(),
    );

    return (bool) $this->configuration->getDb()->query($update);
}

json_encode() does NOT escape single quotes. A JWT claim such as `{"preferred_username": "…

出典: NIST National Vulnerability Database NVD GitHub Advisory

AI要約

外部の AI が作成した要約です。誤りを含むことがあります。重要な判断の前に、下の原文と参照URLを確認してください。

phpMyFAQのバージョン4.1.2未満にSQLインジェクションの脆弱性が存在します。この脆弱性は、CurrentUser::setTokenData関数を介して、認証された攻撃者がOAuthトークンクレームを悪用して任意のSQLを実行できる点にあります。悪用には、文字列リテラルを破るためにSQLメタ文字を含むAzure ADアカウントが必要です。

❓ 何が問題か

phpMyFAQのCurrentUser::setTokenDataにおけるSQLインジェクション脆弱性です。

📍 影響範囲

phpMyFAQのバージョン4.1.2未満。

🔥 重要度

攻撃者が任意のSQLを実行可能になるため、システム全体が危険にさらされます。

🔧 修正方法

脆弱性はバージョン4.1.2で修正されているため、ソフトウェアをこのバージョンにアップデートします。

🛡️ 暫定回避

情報なし

🔍 検知方法

Azure ADアカウントやJWTクレーム内にSQLメタ文字が含まれるアカウントを確認してください。

影響パッケージ

composer thorsten/phpmyfaq
[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.1.2"}]}]
composer phpmyfaq/phpmyfaq
[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.1.2"}]}]
Packagist thorsten/phpmyfaq
[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.1.2"}]}]
Packagist phpmyfaq/phpmyfaq
[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.1.2"}]}]

参照URL

当サイトでは、アクセス解析と広告の効果測定のために Cookie を使います。株式会社Game のサイト共通の設定です。 詳しく