Skip to content

fix: remove hardcoded base64 credential and mask it in --help-env output#112

Open
SoundMatt wants to merge 1 commit into
COVESA:mainfrom
SoundMatt:fix/hardcoded-credential
Open

fix: remove hardcoded base64 credential and mask it in --help-env output#112
SoundMatt wants to merge 1 commit into
COVESA:mainfrom
SoundMatt:fix/hardcoded-credential

Conversation

@SoundMatt
Copy link
Copy Markdown

Problem

DEFAULT_AUTH_REASONER_SERVER_BASE64 decodes to root:admin and is used as a fallback default credential. The --help-env flag prints its value verbatim via Helper::getEnvVariable, leaking the credential into logs, terminal history, and process listings.

Root cause

Base64 is encoding, not encryption. Shipping a default credential in source code means any system that has never had AUTH_REASONER_SERVER_BASE64 explicitly set is silently authenticated with a well-known password. Printing the resolved value in help output makes the leak observable to anyone who can run the binary or read its stdout.

Fix

Remove DEFAULT_AUTH_REASONER_SERVER_BASE64 entirely and pass std::nullopt to loadSystemConfig, so the env var must be explicitly provided by the operator. In the --help-env output, replace the value with <set> or <not set> so the presence of the credential is communicated without exposing its contents.

DEFAULT_AUTH_REASONER_SERVER_BASE64 decoded to 'root:admin' and was
printed verbatim by --help-env, leaking credentials into logs and
process listings. Remove the constant entirely; require the operator to
supply AUTH_REASONER_SERVER_BASE64 explicitly via the environment. In
the help output, show '<set>' or '<not set>' instead of the value.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Signed-off-by: Matt Jones <47545907+SoundMatt@users.noreply.github.com>
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