SQL injection in Pi-hole - #VU166837
Published: November 18, 2026
Vulnerability details
The vulnerability allows a remote privileged user to execute arbitrary SQL statements and operating system commands as the pihole user.
The vulnerability exists due to improper escaping in Pi-hole Core's gravity.sh when substituting files.gravity into an ATTACH DATABASE statement in gravity_copy.sql. A remote privileged user can configure files.gravity through the API with a single quote (') and appended SQL statements invoking edit() and thereby system() to execute arbitrary commands.