Skip to content

fix(api): guard config, logs and dumps on public hosts - #911

Merged
frahlg merged 3 commits into
masterfrom
agent/protect-sensitive-reads
Aug 14, 2026
Merged

frahlg merged 3 commits into
masterfrom
agent/protect-sensitive-reads

Conversation

@frahlg

@frahlg frahlg commented Aug 13, 2026 •

Copy link
Copy Markdown
Member

Summary

FTW_API_TOKEN and the local-address check already stop writes, backups and CalDAV passwords on a public hostname. They did not stop GET requests that reveal:

  • config, site layout and driver hosts
  • logs, support dumps, reports and driver source
  • host, storage and research diagnostics
  • app-link devices and hardware identity such as serial, MAC and endpoint
  • Home Assistant, CalDAV and notification connection details
  • notification history
  • local repository, component and snapshot paths

This applies the same gate to those reads. Same-origin LAN use and private-address curl still work. A public hostname needs the bearer token. Cross-site GET is blocked and protected answers set Cache-Control: no-store.

Live dashboard reads such as status, energy, prices and plan stay open on purpose. LAN access still has no login; that is separate work.

Base

Rebased onto the #909 merge commit on master; this PR now contains only the protected-read change.

Checks

  • go test ./internal/api/
  • notification CI failure test repeated 20 times
  • make verify
  • pre-push make verify-all, including Linux arm64/amd64 and Windows amd64 builds
  • Settings still loads config from http://<box>:8080 on the LAN
  • A public hostname refuses protected reads without a token
  • A public hostname serves protected reads with the bearer token

Out of scope

  • Login on the LAN
  • Closing live dashboard reads
  • Clickjacking headers, which are in the parent PR

frahlg added 2 commits August 14, 2026 07:27
Treat those GETs like backups and CalDAV credentials: same-origin
on the LAN still works; a public hostname needs FTW_API_TOKEN.
Status and energy reads stay compatible.
@frahlg
frahlg force-pushed the agent/protect-sensitive-reads branch from fe7765c to f3cc280 Compare August 14, 2026 05:28
@frahlg
frahlg changed the base branch from agent/http-security-headers to master August 14, 2026 05:28
@frahlg frahlg mentioned this pull request Aug 14, 2026
1 of 5 tasks
@frahlg
frahlg merged commit e6698eb into master Aug 14, 2026
14 checks passed
@frahlg
frahlg deleted the agent/protect-sensitive-reads branch August 17, 2026 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant