Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessAuthenticate to Pi-hole admin API
-
DeliveryPATCH /api/config with quoted SQL in files.gravity
-
ExploitPOST /api/action/gravity to trigger rebuild
-
Executiongravity.sh splices payload into ATTACH DATABASE literal
-
Impactsqlite3 edit() calls system(), command runs as pihole
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Parameterized queries, prepared statements
MITRE ATT&CK
2 techniques across 2 tactics: Initial Access, Persistence The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Requires an authenticated Pi-hole admin account able to write configuration via the API (PR:H); the files.gravity setting carries FLAG_RESTART_FTL but not FLAG_API_READ_ONLY, so it is writable through PATCH /api/config. The affected stack is specifically Pi-hole FTL v6.8 together with Pi-hole Core <= v6.5, where FTL's validate_filepath was loosened to accept all printable ASCII (0x20-0x7E), allowing the single-quote character. Exploitation requires two steps: set a single-quoted SQL payload in files.gravity, then trigger a gravity rebuild (POST /api/action/gravity) so gravity.sh splices the value into the ATTACH DATABASE literal and pipes it to pihole-FTL sqlite3 -ni (which lacks -safe, leaving edit()/system() available). Limiting factors: valid admin credentials are mandatory; the injected command cannot contain a forward slash (the filesystem treats it as a path separator in the stored value); and the command executes as the unprivileged pihole user (uid 1000), not root, in both Docker and bare-metal deployments. |
| Impact | The real-world risk is moderate-to-serious but gated by a meaningful precondition. The CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:H/UI:N, VC:H/VI:H/VA:H, score 8.6) correctly captures that this is a network-reachable, low-complexity path to full OS command execution - but the PR:H metric is the decisive signal: the attacker must already hold Pi-hole admin credentials capable of writing configuration through the API. This is therefore a privilege-escalation/authorization-boundary bug (admin of a DNS appliance → arbitrary OS commands as the pihole user) rather than a pre-auth internet worm. The vuln.today Decision label is 'this_week' (not act_now/emergency), which aligns with that reading. No CISA KEV entry is present, so there is no confirmation of active exploitation, and no EPSS score was supplied to gauge exploitation probability - both of those signals are simply absent from the input, not low. A detailed, vendor-authored proof of concept is published in the GHSA advisory, so working exploitation is clearly feasible and documented. Note two scope caveats that temper raw severity: commands run as the unprivileged pihole user (not root), and the injected command cannot contain a forward slash, constraining payloads. Net: prioritize patching (especially on any Pi-hole whose admin interface is exposed or shares credentials with less-trusted users), but this is not a mass-exploitable unauthenticated RCE. |
| Exploit ScenarioDerived | An attacker who has obtained Pi-hole admin API access (reused/weak credentials, or a malicious/over-trusted admin) sends a single PATCH /api/config request setting files.gravity to a path containing a single quote plus injected SQL, then triggers a gravity rebuild. Because the value is spliced unescaped into an ATTACH DATABASE literal and piped to pihole-FTL sqlite3, the injected SELECT edit(...) statement invokes system() and runs an arbitrary OS command as the pihole user. A step-by-step proof of concept against pihole/pihole:2026.10.0 (FTL v6.8, Core v6.5) default config is published in the GHSA advisory; attack complexity is low (AC:L) and the vector is network-based (AV:N), though admin authentication (PR:H) is required. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Dec 06, 2026
Authenticated Pi-hole administrators can turn configuration-write access into OS command execution as the unprivileged pihole user by storing a single-quoted SQL payload in files.gravity through PATCH /api/config and then triggering a gravity rebuild. The chain combines a regression in Pi-hole FTL 6.8's validate_filepath(), which was widened to accept every byte from 0x20 to 0x7E, with unescaped string substitution in Pi-hole Core (<= 6.5) gravity.sh, so both FTL 6.9 and Core 6.6 must be deployed together to close the vector. A public proof-of-concept procedure is documented in the upstream advisory; it is not independently verified here as working exploit code, and exploitation remains gated by valid admin credentials, a forward-slash-free payload, and execution context limited to uid 1000 rather than root.
RemediationAI
Upgrade both components in the same maintenance window: Pi-hole FTL to 6.9 (https://github.com/pi-hole/FTL/releases/tag/v6.9) and Pi-hole Core to 6.6 (https://github.com/pi-hole/pi-hole/releases/tag/v6.6). Applying only one is insufficient - Core 6.6 doubles single quotes in files.gravity before gravity.sh substitutes it into gravity_copy.sql (commit 63a1e2f31fea48f8fc3b21fdf98f44390fbba9a7), while FTL 6.9 binds the path as the parameter of ATTACH DATABASE ? AS disk in Teleporter export/import (commit 8687f0af86e0bc1e0f825a39a929f07a83f8bdac). FTL 6.9 deliberately keeps validate_filepath() accepting all printable ASCII because the paths are now safe at their points of use, so do not expect the validator itself to revert. If a coordinated upgrade is not immediately possible, compensating controls are limited: restrict network reach of the Pi-hole web/API interface to trusted management hosts and cut the number of accounts holding write access to configuration, since the flaw requires an authenticated admin able to call PATCH /api/config - this trades off remote administration convenience but removes the precondition; also verify that files.gravity holds its default value and reset it if it does not. No vendor-released patch substitutes for updating both packages, and per the advisory the injected command cannot contain a forward slash, but that constraint should not be relied on as a mitigation.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 2 packages in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The root cause class is CWE-89 (SQL injection) with CWE-78 (OS command injection) as the outcome. FTL v6.8 changed validate_filepath() (src/config/validator.c:319-347) from a 67-character allowlist to accepting all printable ASCII, and files.gravity is bound to that validator (src/config/config.c:1365) while carrying FLAG_RESTART_FTL but not FLAG_API_READ_ONLY, making it writable via PATCH /api/config. gravity.sh reads files.gravity at line 47 and, when the value differs from the default, substitutes it raw into gravity_copy.sql at line 472, whose template contains ATTACH DATABASE '/etc/pihole/gravity.db' AS OLD; a single quote therefore closes the SQL literal and injects arbitrary statements. The rendered SQL is piped to pihole-FTL sqlite3 -ni at gravity.sh:475, which maps to -batch -init /dev/null (src/args.c:853) without -safe; because the build does not define SQLITE_NOHAVE_SYSTEM, the shell registers edit() (src/database/shell.c:28132), which calls system() with a caller-chosen editor string. gravity.sh drops privileges via exec sudo -u pihole at line 18, so injected commands run as pihole in both Docker and bare-metal. The same formatted-SQL attach pattern existed in FTL's Teleporter export/import (src/zip/teleporter.c), where files.gravity and files.database were spliced into ATTACH DATABASE via snprintf; the fix binds the path as a parameter instead. Note that CVSS metrics here describe severity, not trigger mechanics: the trigger details above come from the vendor advisory, and the AC:L/PR:H/UI:N profile reflects a two-step API-then-gravity action by an account already holding admin rights.
Know when the next one hits your stack
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Admin config-write access is required so PR:H; the network API and documented single-request trigger give AV:N/AC:L; OS command execution as pihole yields C:H/I:H/A:H.
Primary rating from Vendor (vulncheck).
CVSS VectorVendor: vulncheck
Lifecycle Timeline
2DescriptionCVE.org
Pi-hole FTL 6.8 with Pi-hole Core before 6.6 contains an SQL injection vulnerability that allows authenticated admins to execute OS commands as the pihole user via the files.gravity setting. Attackers can set a single-quoted payload through PATCH /api/config and trigger gravity, injecting SQL that calls the sqlite3 edit() function to run system commands.
Technical POC Analysis
CWE-89 SQL injection, with CWE-78 as the downstream consequence (the advisory lists both).
Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.
Executive ViewAI
CVE-2026-145797 is a high-severity vulnerability in Pi-hole versions FTL 6.8 and Core <=6.5 that allows an authenticated administrator to escalate their privileges to execute operating system commands as the unprivileged 'pihole' user. While exploitation requires valid administrative credentials and is limited to non-root access, the flaw enables lateral movement and potential data compromise within the Pi-hole environment, which could affect network integrity and monitoring capabilities. Leadership should prioritize remediation because administrative accounts are often shared or weakly protected, and the absence of a patch increases risk until updates are applied.
Apply vendor patch.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
SQL injection exploits the way applications construct database queries by mixing user input directly into SQL statements.
EUVD-2026-145941
GHSA-fcvh-hp79-62x6
NVD
CVE.org
Exploit-DB