Repository navigation
Keep passwords, meter keys and tokens out of the debug log - #1328
Merged
Merged
Conversation
The debug log, which can be read over telnet, contained secrets: - a failed web login logged the submitted Basic credential, which is only base64 encoded, so a mistyped or guessed password was readable - /save at debug level logged every form value, including the WiFi, MQTT and web passwords, meter keys and tokens - the configuration dump at boot printed the WiFi, MQTT and web passwords and the ENTSO-E and ZmartCharge tokens Log the failed login without the credential and show these values as ***. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Masking the secret fields still logged the rest of the configuration on every save, and any field added later would be logged in clear until someone remembered to add it to the list. Drop the argument dump. Co-Authored-By: Claude Opus 5.5 <[email protected]>
🔧 PR Build ArtifactsVersion: All environments built successfully. Download the zip files:
|
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.
Why
The debug log can be read over telnet (RemoteDebug) and the serial port, and it contained secrets:
Authorizationvalue. That is only base64, so a mistyped or guessed password was readable (checkSecurity())./saveat debug level: logged every form value. That includes the WiFi, MQTT and web passwords, the meter encryption and authentication keys, and the ENTSO-E and ZmartCharge tokens.AmsConfiguration::print()): printed the WiFi, MQTT and web passwords and both tokens.Changes
Unsuccessful login./saveargument dump is removed completely. Masking only some fields would still log the rest of the configuration on every save, and any secret field added later would be logged in clear.***for the WiFi, MQTT and web passwords and the ENTSO-E and ZmartCharge tokens when they are set, and empty when they are not, so you can still see whether they are configured.Verification
pio runfor esp8266dev, esp32dev and esp32s2dev.pio test -e native_configpasses.🤖 Generated with Claude Code