config.webserver.api.app_password defaults to "" (roles/pihole/defaults/main.yml:312). So with no application password, app_pwhash is not empty: it is the double SHA-256 of the empty string.
The comment above that line (841-842) also says the double-hash format "has not been tested". This behaviour comes from the upstream role the template derives from; #372 carried it over unchanged.
Possible impact (not verified)
If pihole-FTL treats any non-empty app_pwhash as "an application password is set", then a host that sets no app password may still have one, whose plaintext is the empty string. That would allow an app-password API session past 2FA.
If FTL expects another hash format for app_pwhash, the value is ignored or rejected, and a configured app password does not work.
Neither has been checked against pihole-FTL itself. The molecule scenario stubs the installer and runs no FTL.
Proposed work
Check in the pihole-FTL source or docs how webserver.api.app_pwhash is read: what an empty value means, and which hash formats are accepted.
Render app_pwhash = "" when app_password is empty.
Render a non-empty password in the format FTL expects, and drop the "untested" comment.
Assert both cases in the scenario's verify.yml: empty password gives an empty app_pwhash; a set password gives the expected hash.
Changelog fragment: bugfixes if FTL accepted the empty-string hash as a password, minor_changes otherwise.
Acceptance criteria
With the default app_password: "", the rendered pihole.toml has app_pwhash = "".
A non-empty app_password renders in the format pihole-FTL accepts, with the source of that format cited in the PR.
Assisted-by: Claude Code:claude-opus-5-5
## Problem
`roles/pihole/templates/pihole.toml.j2:843` always renders:
```jinja
app_pwhash = "{{ __pihole_effective.config.webserver.api.app_password | hash('sha256') | hash('sha256') }}"
```
`config.webserver.api.app_password` defaults to `""` (`roles/pihole/defaults/main.yml:312`). So with no application password, `app_pwhash` is not empty: it is the double SHA-256 of the empty string.
The comment above that line (841-842) also says the double-hash format "has not been tested". This behaviour comes from the upstream role the template derives from; #372 carried it over unchanged.
## Possible impact (not verified)
- If pihole-FTL treats any non-empty `app_pwhash` as "an application password is set", then a host that sets no app password may still have one, whose plaintext is the empty string. That would allow an app-password API session past 2FA.
- If FTL expects another hash format for `app_pwhash`, the value is ignored or rejected, and a configured app password does not work.
Neither has been checked against pihole-FTL itself. The molecule scenario stubs the installer and runs no FTL.
## Proposed work
- [ ] Check in the pihole-FTL source or docs how `webserver.api.app_pwhash` is read: what an empty value means, and which hash formats are accepted.
- [ ] Render `app_pwhash = ""` when `app_password` is empty.
- [ ] Render a non-empty password in the format FTL expects, and drop the "untested" comment.
- [ ] Assert both cases in the scenario's `verify.yml`: empty password gives an empty `app_pwhash`; a set password gives the expected hash.
- [ ] Changelog fragment: `bugfixes` if FTL accepted the empty-string hash as a password, `minor_changes` otherwise.
## Acceptance criteria
- With the default `app_password: ""`, the rendered `pihole.toml` has `app_pwhash = ""`.
- A non-empty `app_password` renders in the format pihole-FTL accepts, with the source of that format cited in the PR.
Assisted-by: Claude Code:claude-opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Problem
roles/pihole/templates/pihole.toml.j2:843always renders:config.webserver.api.app_passworddefaults to""(roles/pihole/defaults/main.yml:312). So with no application password,app_pwhashis not empty: it is the double SHA-256 of the empty string.The comment above that line (841-842) also says the double-hash format "has not been tested". This behaviour comes from the upstream role the template derives from; #372 carried it over unchanged.
Possible impact (not verified)
app_pwhashas "an application password is set", then a host that sets no app password may still have one, whose plaintext is the empty string. That would allow an app-password API session past 2FA.app_pwhash, the value is ignored or rejected, and a configured app password does not work.Neither has been checked against pihole-FTL itself. The molecule scenario stubs the installer and runs no FTL.
Proposed work
webserver.api.app_pwhashis read: what an empty value means, and which hash formats are accepted.app_pwhash = ""whenapp_passwordis empty.verify.yml: empty password gives an emptyapp_pwhash; a set password gives the expected hash.bugfixesif FTL accepted the empty-string hash as a password,minor_changesotherwise.Acceptance criteria
app_password: "", the renderedpihole.tomlhasapp_pwhash = "".app_passwordrenders in the format pihole-FTL accepts, with the source of that format cited in the PR.Assisted-by: Claude Code:claude-opus-5-5