REAL THREATS
Unauthenticated Network Services (Critical)
• dnsmasq-web REST API (findings 0,1,13,14,16,17,18,19): The web service (dnsmasq-web) binds to all interfaces (:867) by default with no authentication mechanism. This exposes DHCP lease management and client data to unauthenticated network access, allowing attackers to view/modify network configurations and potentially disrupt DHCP services.
Supply Chain & Integrity Issues (Critical/High)
• Binary download without verification (2,3,15): The dnsmasq-web binary is downloaded from GitHub without checksum verification, making it vulnerable to MITM attacks or repository compromise.
• SQLite database initialization without integrity verification (9): Database schema is applied without validation, potentially allowing SQL injection during initialization.
Data Exposure & Integrity (High)
• Unencrypted database at rest (6,30,36): The SQLite DHCP lease database stores sensitive network topology data (MAC addresses, IPs, hostnames) without encryption, exposing it if the filesystem is compromised.
• Unbounded database growth (7): The requests table grows indefinitely without cleanup, leading to disk exhaustion.
• Overly permissive database file permissions (8): Database files have world-readable permissions (0660), potentially exposing sensitive data to other users on the system.
Input Validation & Error Handling (High)
• Unvalidated access to ansible_facts (5,10): DHCP and DNS configuration tasks access ansible_facts[item]['ipv4'] and ansible_facts['default_ipv4']['interface'] without validation, causing failures if interfaces are missing or misconfigured.
• DNS hosts file accepts unvalidated input (11): The DNS hosts file content is copied directly without validation, potentially allowing injection of malicious DNS records.
ATTACK CHAINS
1. Network Reconnaissance → DHCP/DNS Manipulation: An attacker scans the network, discovers the exposed dnsmasq-web API (port 867), and uses the unauthenticated REST endpoints to:
- View all DHCP leases and client information (MAC addresses, IPs, hostnames)
- Modify DHCP reservations to redirect traffic or perform MITM attacks
- Disrupt DHCP services by deleting/modifying configurations
2. Supply Chain Compromise → Persistent Backdoor: If the GitHub repository or download is compromised, an attacker could replace the dnsmasq-web binary with a malicious version that:
- Provides backdoor access to the DHCP/DNS server
- Exfiltrates network topology data from the unencrypted SQLite database
- Manipulates DNS responses for phishing attacks
3. Privilege Escalation via File Permissions: A low-privileged user on the system can read the world-readable SQLite database (0660 permissions) to gather network intelligence, then use that information to:
- Target specific devices on the network
- Potentially modify DHCP configurations if they gain dnsmasq group access
VERDICT
Immediate fixes required:
1. Implement authentication for the dnsmasq-web REST API (critical)
2. Add integrity verification for downloaded binaries using checksums (critical)
3. Restrict network binding to localhost or specific interfaces (high)
4. Encrypt the SQLite database or restrict access more aggressively (high)
5. Implement input validation for ansible_facts access and host file content (high)
6. Add database cleanup for the unbounded requests table (high)
The collection has serious security flaws that would expose network infrastructure to compromise. The unauthenticated web API combined with network exposure is particularly dangerous in production environments.