Summary
Pi-hole FTL accepts advanced webserver options that can enable Lua file execution, while Teleporter can write archive content to disk without validating its contents. An authenticated administrator who can use these features may cause Lua code to run as the pihole operating-system user when FTL restarts.
Affected context
The issue affects Pi-hole FTL deployments in which the API accepts unfiltered lua_* options through webserver.advancedOpts and Teleporter writes DHCP lease archive content without content validation. The risky behavior involves the interaction between those file-writing and configuration paths and FTL's handling of Lua options.
Exploit preconditions
- Attack surface: Pi-hole's configuration and Teleporter API endpoints
- Required access: An authenticated administrator able to change configuration and submit a Teleporter archive
- Trigger point: FTL restarts after an advanced-options configuration change
- Why exploitation is possible: Archive content can be written to disk without validation, and an accepted Lua execution option can direct CivetWeb to process that file
Why this happens
The issue combines insufficient validation of archive-derived file content with inadequate control over security-sensitive webserver configuration. Unfiltered lua_* options can enable execution of Lua files, while the Teleporter path writes attacker-controlled content to disk. This maps primarily to CWE-15: External Control of System or Configuration Setting and is also associated with CWE-20: Improper Input Validation.
Potential impact
- Arbitrary commands could run with the privileges of the
piholeoperating-system user. - An attacker may be able to alter application files or data accessible to that account.
- The execution may persist across restarts while the relevant file and configuration remain in place.
- The compromised service could be used to affect other systems or network resources available to its account.
General mitigation guidance
Defensive patterns include restricting security-sensitive configuration to explicitly permitted options and disabling file-based Lua execution unless it is required. Treat archive contents as untrusted: validate expected paths, file types, and content before writing, and constrain writes to intended locations. Limit who can access administrative APIs, apply least privilege to the FTL process, and avoid configurations that permit uploaded or externally controlled files to become executable.
How teams detect issues like this
- Review configuration handling for paths that accept or persist
lua_*options without an explicit allowlist. - Use static analysis and code review to identify archive extraction or file-writing logic that lacks path and content validation.
- Monitor administrative API changes, FTL restarts, and unexpected files or modifications in locations accessible to the service.
- Enforce policy checks that restrict executable scripting options and limit archive writes to approved paths.

