Fix security issues and add credential update flow - #236
Open
smcneece wants to merge 2 commits into
Open
Conversation
- Remove auth token from debug log statements (api.py, config_flow.py) - Add URL validation for pet avatar fetch to prevent SSRF - Remove unused make_api_call function and its imports across 11 files - Add "Change login credentials" option to the options flow gear menu - Add reconfigure flow via the three-dot menu (HA 2024.3+ standard) - Add translations for new credential update UI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed change
Fixes three security issues and adds credential management to the options flow.
Security fixes:
api.py,config_flow.py). The token appeared in three separate log statements. Anyone following the README's own troubleshooting steps (enabling debug logging) was silently leaking their live session token into HA's log files.pets/entity.py). Onlyhttps://URLs frompetlibro.comor*.petlibro.comare allowed. Falls back to the bundled default avatar if rejected. Prevents a compromised API from directing HA to make arbitrary outbound requests (SSRF).make_api_callfunction (api.py) and its unused import from 11 files. The function made unauthenticated POST requests to arbitrary URLs and was never called.New feature:
async_step_reconfigurefollowing the HA 2024.3+ standard pattern, accessible via the three-dot menu on the integration card.Type of change
Checklist
Additional notes
The token-in-logs issue is the most urgent. It only triggers when debug logging is enabled, but the README's own troubleshooting section instructs users to enable it, making credential exposure likely for anyone debugging the integration.