fix(setup): add -r to read -s PASSWORD to prevent backslash corruption#43
Open
amathxbt wants to merge 1 commit into
Open
fix(setup): add -r to read -s PASSWORD to prevent backslash corruption#43amathxbt wants to merge 1 commit into
amathxbt wants to merge 1 commit into
Conversation
…ling bash read without -r interprets backslashes as escape sequences. A password containing a backslash (e.g. P@ss\\word1) is silently rewritten before being passed to htpasswd, so the hash stored in middleware.yaml does not match the password the operator actually typed. Add -r so that read treats the input as raw bytes, matching the exact password the user intends to set.
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.
Bug
setup.shreads the monitoring-stack admin password with:read -s PASSWORDIn bash,
readwithout-rtreats backslashes as escape characters. Any operator password containing a backslash (e.g.P@ss\\word1, a common pattern in auto-generated strong passwords) is silently mangled before being passed tohtpasswd.Impact: The hash written to
middleware.yamldoes not correspond to the password the operator typed. The operator is locked out of the monitoring dashboard immediately after setup, with no error message — the failure only appears when attempting to log in.Fix
Add
-rto thereadinvocation:The
-rflag disables backslash escaping so the raw bytes of the password are used, matching the hash generated byhtpasswd.