Skip to content

Release 0.7.1: harden weigh-in photo paths, HACS install docs - #13

Merged
ttiot merged 3 commits into
mainfrom
release/v0.7.1
Oct 21, 2026
Merged

ttiot merged 3 commits into
mainfrom
release/v0.7.1

Conversation

@ttiot

@ttiot ttiot commented Oct 21, 2026

Copy link
Copy Markdown
Owner

Summary

Addresses the HACS default-catalog review on hacs/default#11574.

  • Security: the weigh-in photo decoder treated any string naming an existing file as a path to copy into the photo store. The weigh_in / batch/import websocket commands and the record_weight / import_batch actions are open to every logged-in user, and batch/export with include_photos handed the copy back, so a non-admin could read /config/secrets.yaml or anything under .storage.
    • _photo_bytes (coordinator) now only decodes inline data (data URL or base64) and never touches the filesystem.
    • record_weight keeps accepting a local file path, resolved in services.py only: it must pass hass.config.is_allowed_path (allowlist_external_dirs, the camera.snapshot rule), is read off the event loop and handed down as a data URL; anything else raises HomeAssistantError. The websocket commands and import_batch never interpret a photo as a path.
    • Tests: allowed path, refused path, missing file, the shared decoder, and the websocket commands ignoring even an allowlisted path.
  • Docs: README install section leads with the HACS default catalog (search + My Home Assistant button), custom repository as fallback; services.yaml, README and CHANGELOG document the path rule.
  • Release 0.7.1: manifest, pyproject and CHANGELOG bumped.

Test plan

  • ruff check / ruff format --check / mypy clean
  • pytest green (173 tests), coverage gate ≥ 85 % on regulation/ and program/
  • Validate, hassfest and HACS workflows green on this PR

Michaux Julien added 3 commits October 21, 2026 09:25
- The photo decoder treated any string naming an existing file as a path to
  copy into the photo store. The weigh_in / batch/import websocket commands
  and the record_weight / import_batch actions are open to every logged-in
  user, and batch/export with include_photos handed the copy back, so a
  non-admin could read /config/secrets.yaml or anything under .storage.
- _photo_bytes now only decodes inline data (data URL or base64); an empty
  payload yields no photo instead of an empty file.
- record_weight keeps accepting a local file path, resolved in services.py
  only: hass.config.is_allowed_path must accept it (allowlist_external_dirs,
  the camera.snapshot rule), the file is read off the event loop and passed
  down as a data URL. Anything else raises HomeAssistantError.
- Tests cover the allowed path, the refused path, the shared decoder and the
  websocket commands ignoring even an allowlisted path; services.yaml, README
  and CHANGELOG document the rule. Reported in the HACS default-catalog review.
- Once Curing Chamber is in the default catalog users find it by searching
  HACS, so the steps start there (with a My Home Assistant button) and the
  custom-repository route becomes the fallback, in both languages.
- Bump manifest.json and pyproject.toml to 0.7.1.
- CHANGELOG: move the Unreleased entries under 0.7.1 and update the compare
  links.
@ttiot
ttiot merged commit afb7a1b into main Oct 21, 2026
3 checks passed
@ttiot
ttiot deleted the release/v0.7.1 branch October 21, 2026 07:27
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