Skip to content

v1.7.0

Choose a tag to compare

@saihgupr saihgupr released this 20 Nov 17:16
· 5 commits to develop since this release
ec2cfdd

Security hardening for standalone Docker

This release hardens the standalone Docker deployment. The Home Assistant add-on behind Ingress keeps using Home Assistant authentication.

API authentication

  • /api/* now asks for HTTP Basic auth in standalone Docker mode. Static files and the / healthcheck stay open.
  • Auth is on by default in Docker. If you do not set a password, one is generated on first start, written to /data/api-password (mode 0600), and printed in the container logs as [auth] API password: ....
  • HAVC_USERNAME and HAVC_PASSWORD let you choose your own credentials.
  • HAVC_API_AUTH=off disables auth when an authenticating reverse proxy already protects the container.
  • Add-on users get api_auth (default false) and api_auth_password for the case where port 54001 is published directly.

Input and browser hardening

  • Every client-supplied path and commit hash is validated. Traversal attempts and invalid hashes return 400.
  • CORS uses an exact origin allowlist from HAVC_ALLOWED_ORIGINS. No CORS headers are sent when the list is empty.
  • /api/health and /api/debug no longer echo request headers. /api/debug only responds when HAVC_DEBUG=1.
  • HOST defaults to 127.0.0.1 for bare-metal runs. The Docker image sets HOST=0.0.0.0.

Scope

The add-on behind Ingress was not exposed as long as port 54001 was not published. The standalone Docker deployment was the one that needed this hardening. Details are in advisory GHSA-vm55-p93v-fr5f.

Also in this release

  • The watcher now ignores files HAVC can never commit, which cuts idle CPU on large config folders.
  • A stale .git/index.lock is cleared on startup when it is older than ten minutes.
  • Startup and watcher retries share one initialization run, so they no longer race for the git lock.

Upgrading

Docker users will see a login prompt after upgrading. Use havc and the password from the container logs or /data/api-password, or set HAVC_USERNAME and HAVC_PASSWORD before starting the new image. Add-on users do not need to change anything.