Skip to content

fix(api): refuse file:// feeds outside the allowed paths - #32

Merged
timmaurice merged 3 commits into
masterfrom
fix/file-url-allowlist
Nov 13, 2026
Merged

timmaurice merged 3 commits into
masterfrom
fix/file-url-allowlist

Conversation

@timmaurice

Copy link
Copy Markdown
Owner

Summary

_async_read_file read any file:// path the host user could read. It now asks
hass.config.is_allowed_path() first and raises FeedparserApiError with a hint
to allowlist_external_dirs, so only the config directory and explicitly
allowed folders can be used as a feed source.

Behaviour change: file:// feeds outside Home Assistant's allowlist_external_dirs are now refused with an error that says how to allow the folder. Existing setups that read local files from elsewhere need that config entry. The README does not mention this yet.

Tests

New test test_local_feed_outside_allowed_dirs_is_refused (fails without the fix). pytest 266 passed locally (socket-bound HTTP tests excluded as on master). black clean.

No Docker or e2e run for this change. Board card c015.

_async_read_file read any file:// path the host user could read. It now asks
hass.config.is_allowed_path() first and raises FeedparserApiError with a hint
to allowlist_external_dirs, so only the config directory and explicitly
allowed folders can be used as a feed source.
@timmaurice
timmaurice merged commit ed28b99 into master Nov 13, 2026
9 checks passed
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