Cacti through 1.2.30 builds the rrdtheme.php include path in lib/rrd.php directly from the graph_theme request parameter without validating it against the installed themes. graph_image.php (reachable with guest access) therefore includes include/themes/<graph_theme>/rrdtheme.php with attacker-controlled path segments. The non-default midwinter theme is requested with a trailing path segment (midwinter/.) so that only an unpatched install, which concatenates the value verbatim, resolves and includes it. Fixed in 1.2.31 by cacti_validate_theme(), which applies basename() and an allowlist of installed themes.
id: CVE-2026-39938
info:
name: Cacti <= 1.2.30 - Unauthenticated Local File Inclusion via graph_theme
author: DhiyaneshDk
severity: high
description: |
Cacti through 1.2.30 builds the rrdtheme.php include path in lib/rrd.php directly from the graph_theme request parameter without validating it against the installed themes. graph_image.php (reachable with guest access) therefore includes include/themes/<graph_theme>/rrdtheme.php with attacker-controlled path segments. The non-default midwinter theme is requested with a trailing path segment (midwinter/.) so that only an unpatched install, which concatenates the value verbatim, resolves and includes it. Fixed in 1.2.31 by cacti_validate_theme(), which applies basename() and an allowlist of installed themes.
impact: |
Unauthenticated attackers (when guest graph access is enabled) can control the path of a PHP file included by the application, leading to local file inclusion.
remediation: |
Upgrade to Cacti 1.2.31 or later.
reference:
- https://github.com/Cacti/cacti/security/advisories/GHSA-rm7p-qcqm-x5m6
- https://github.com/Cacti/cacti/commit/9871f0cef9af285398d558c9b3188d5977e01a04
- https://nvd.nist.gov/vuln/detail/CVE-2026-39938
classification:
cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
cvss-score: 7.5
cve-id: CVE-2026-39938
epss-score: 0.02714
epss-percentile: 0.86761
cwe-id: CWE-98
metadata:
verified: true
max-request: 1
vendor: cacti
product: cacti
shodan-query: http.title:"Login to Cacti"
fofa-query: title="Login to Cacti"
tags: cve,cve2026,cacti,lfi,unauth,vuln,vkev
http:
- method: GET
path:
- "{{BaseURL}}/graph_image.php?local_graph_id=1&rra_id=0&show_source=1&graph_theme=midwinter/."
matchers:
- type: dsl
dsl:
- 'status_code == 200'
- 'contains(body, "--color BACK#F5F7F9")'
condition: and
# digest: 4a0a0047304502207e7bf7129bc7281e2c8486c89e7fa5bb5d8b3e0a497d5abed3d14429dada0068022100ff3a26ad999c205afdf0ecaa6904404b4de6b0d531b6a73308f74911acd7e1fe:922c64590222798bb761d5b6d8e72950
# Visit https://trap.biu.life/ to view exploit trends for this vulnerability.