Pi-hole debug script follows symlinks, allowing file disclosure and overwrite
Key facts
- Attack vector
- Local
- Privileges required
- Low
- User interaction
- Required
- Attack complexity
- Low
- Impact type
- —
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · GHSA-jvg9-fm8x-2jqq. Fix status from GitHub.
Summary
piholeDebug.sh runs as root when an administrator runs pihole -d and follows symlinks in /etc/pihole and /var/log/pihole. An attacker with code execution as the pihole user can replace files there with symlinks, so root copies the target, such as /etc/shadow, into the debug log that pihole can read. A symlink at /var/log/pihole/pihole_debug.log also makes root truncate, overwrite and re-own an arbitrary file. Exploitation requires an administrator to run pihole -d, and the CVSS 3.1 base score is 7.3 (HIGH).
Written with Claude Haiku 5.5 from the sources below · 2026-11-12
Description from the GitHub advisory
### Summary `/etc/pihole` and `/var/log/pihole` are owned by the `pihole` user (`pihole-FTL-prestart.sh:5` runs `chown -R pihole:pihole` on both), so that account can replace any file in them with a symlink. When an administrator runs `sudo pihole -d`, `piholeDebug.sh` runs as root and reads and writes files in those directories by path, with no symlink handling anywhere in the script. A planted symlink is followed, both on read and on write. This is the same root cause as GHSA-xch2-4qxw-g5vj (`updatecheck.sh`) and GHSA-wp3p-45h3-2v82 (installer), in a script neither of those fixes touched. ### Details Verified on v6.5 (commit `f503a65`); unchanged on `development` at `4b33f6e4`. **Read direction (information disclosure).** `list_files_in_dir()` enumerates each Pi-hole directory with a plain glob and only tests `-d` (`piholeDebug.sh:889-937`). Files matching `REQUIRED_FILES` are read as root with `head`/`tail` (`head_tail_log`, `:962`) or `sed` (`make_array_from_file`, `:805`), all of which follow symlinks. `analyze_pihole_log()` (`:1209`) reads `pihole.log` the same way. Affected paths include `/var/log/pihole/FTL.log`, `/var/log/pihole/webserver.log`, `/var/log/pihole/pihole.log` and `/etc/pihole/pihole.toml`. The content of the symlink target ends up in `/var/log/pihole/pihole_debug.log`, which is then made `root:pihole 0640` and so is readable by the `pihole` user. If the administrator agrees to the upload, the same content is also sent to tricorder.pi-hole.net. **Write direction (arbitrary file clobber / re-own).** `copy_to_debug_log()` writes the log with `cat /proc/$$/fd/3 > "${PIHOLE_DEBUG_LOG}"` (`:162`), and `upload_to_tricorder()` then runs `chmod 640` and `chown root:pihole` on the same path (`:1245-1246`), before the upload prompt, so regardless of the answer. All three follow a symlink at `/var/log/pihole/pihole_debug.log`, so root truncates an arbitrary file, overwrites it with the debug output, and makes it `root:pihole 0640`. ### Preconditions - The attacker already runs code as the `pihole` user (e.g. after a compromise of `pihole-FTL`). Same threat model as GHSA-xch2-4qxw-g5vj and GHSA-mff6-cjc4-5wq9. - An administrator runs `pihole -d` (the standard support flow). `pihole -d` requires root and is not reachable from FTL or the web interface. - `fs.protected_symlinks` does not help: `/var/log/pihole` and `/etc/pihole` are not sticky world-writable directories. ### Impact Read: disclosure of any root-readable file whose first/last lines are of interest (e.g. `/etc/shadow` password hashes) to the `pihole` user. Write: root truncates, overwrites and re-owns an arbitrary file, causing loss of integrity and availability (e.g. a system configuration file) and making it readable by `pihole`. ### Remediation (proposed) Read files under `/etc/pihole` and `/var/log/pihole` as the `pihole` user (`setpriv`, as `pihole-FTL-prestart.sh` and `updatecheck.sh` already do), write the debug log as that user, and upload from the script's own root-owned file descriptor rather than by path. A symlink then only reaches files the `pihole` user could already access.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| — | pi-hole | <= 6.5 | 6.6 | Patch available | GHSA-jvg9-fm8x-2jqq |
- pi-hole Vendor— Affected <= 6.5 Fixed in 6.6 Patch available GHSA-jvg9-fm8x-2jqq
Remediation
Upgrade pi-hole to 6.6, which fixes this issue. Versions up to and including 6.5 are affected.
Written with Claude Haiku 5.5 from the sources below · 2026-11-12
- Fix · GHSA-jvg9-fm8x-2jqq pi-hole Fixed in 6.6 Advisory →
Timeline
- 2026-11-12 Threatist record created from GHSA-jvg9-fm8x-2jqq
References
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences