Conversation
maghuro
requested review from
ExtremeFiretop and
Martinski4GitHub
as code owners
September 23, 2026 22:55
Contributor
Author
|
Superseded by a broader follow-up PR. While validating this fix, I found that the stored router credential is also kept persistently in the WebUI-readable MerlinAU configuration. The replacement PR keeps the first-colon password parsing fix from this PR and adds protected server-side credential storage, so both related changes can be reviewed and merged together. Closing this PR to avoid splitting the same credential-handling path across two dependent changes. |
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.
Summary
Preserve the complete router password when decoding stored Base64 credentials.
Problem
MerlinAU stores router credentials in the form:
and then Base64-encodes the complete string.
The WebUI currently decodes the value and retrieves the password using:
This only keeps the text between the first and second colon.
A valid password such as:
is therefore restored as:
If the settings are subsequently saved, the password may be silently replaced by the truncated value.
The shell-side credential editor also extracts the password by running a sed substitution using the current router username rather than parsing the stored credential delimiter directly.
Fix
The WebUI now locates the first colon and keeps everything after it.
The shell implementation uses shell parameter expansion to remove everything through the first colon.
Both therefore treat the first colon as the username/password separator and preserve any additional colons as part of the password.
Examples
Stored decoded credential:
Password:
Stored decoded credential:
Password:
Stored decoded credential:
Password:
Stored decoded credential:
Password:
Stored decoded credential:
Password:
Validation
Both the WebUI and CLI password validators permit colon characters.
The existing credential writers already build the stored value as username followed by a single separator colon followed by the complete password.
The change therefore parses the existing storage format without changing that format.
Scope
This PR changes only credential decoding in MerlinAU.asp and MerlinAU.sh.
It does not change credential encoding, Base64 storage, password validation, login requests, or the configuration format.