CVE-2021-32706

7.6 HIGH

📋 TL;DR

CVE-2021-32706 is a code injection vulnerability in Pi-hole's web interface that allows attackers to execute arbitrary code, list directories, and overwrite sensitive files. The vulnerability exists in the domain validation filter where an unescaped period allows malicious character injection. All Pi-hole instances with web interface versions before 5.5.1 are affected.

💻 Affected Systems

Products:
  • Pi-hole AdminLTE Web Interface
Versions: All versions before 5.5.1
Operating Systems: All operating systems running Pi-hole
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects Pi-hole installations with the web interface enabled and accessible.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full system compromise with root-level code execution, allowing complete control over the Pi-hole server and potentially the entire network it manages.

🟠

Likely Case

Remote code execution leading to DNS manipulation, data exfiltration, or installation of persistent backdoors on the Pi-hole server.

🟢

If Mitigated

Limited impact if web interface is not exposed to untrusted networks and proper network segmentation is in place.

🌐 Internet-Facing: HIGH - Web interface exposed to internet allows remote exploitation without authentication.
🏢 Internal Only: MEDIUM - Internal attackers or compromised internal systems could exploit this vulnerability.

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Exploitation requires access to the web interface but no authentication. Public proof-of-concept code exists in security advisories.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 5.5.1

Vendor Advisory: https://github.com/pi-hole/AdminLTE/security/advisories/GHSA-5cm9-6p3m-v259

Restart Required: No

Instructions:

1. Update Pi-hole using: pihole -up
2. Alternatively, manually update AdminLTE: cd /etc/.pihole && git pull origin master
3. Clear browser cache to ensure new interface loads

🔧 Temporary Workarounds

Disable Web Interface

linux

Temporarily disable the Pi-hole web interface to prevent exploitation

sudo systemctl disable lighttpd
sudo systemctl stop lighttpd

Restrict Network Access

linux

Configure firewall to only allow trusted IPs to access the web interface

sudo ufw allow from 192.168.1.0/24 to any port 80
sudo ufw allow from 192.168.1.0/24 to any port 443

🧯 If You Can't Patch

  • Implement strict network segmentation to isolate Pi-hole from untrusted networks
  • Deploy a web application firewall (WAF) with input validation rules to block exploitation attempts

🔍 How to Verify

Check if Vulnerable:

Check AdminLTE version: cat /etc/pihole/versions | grep AdminLTE

Check Version:

cat /etc/pihole/versions | grep AdminLTE

Verify Fix Applied:

Verify version is 5.5.1 or higher: cat /etc/pihole/versions | grep AdminLTE | grep -E '5\.5\.1|5\.([6-9]|[1-9][0-9]+)|[6-9]|([1-9][0-9]+)'

📡 Detection & Monitoring

Log Indicators:

  • Unusual POST requests to /admin/scripts/pi-hole/php/* endpoints
  • Suspicious characters in domain validation requests
  • Lighttpd access logs showing exploitation patterns

Network Indicators:

  • Unusual outbound connections from Pi-hole server
  • DNS query patterns indicating compromise

SIEM Query:

source="lighttpd" AND (uri_path="/admin/scripts/pi-hole/php/*" AND request_method="POST" AND (query_string="*[malicious_pattern]*" OR post_data="*[malicious_pattern]*"))

🔗 References

📤 Share & Export