Prevent STELLAR_SIGN_WITH_KEY from showing up on stellar env.#2408
Merged
Conversation
mootz12
approved these changes
Feb 20, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses a security concern by preventing STELLAR_SIGN_WITH_KEY from being displayed when running the stellar env command, since this environment variable can contain secret keys. The fix follows the same pattern already established for STELLAR_SECRET_KEY.
Changes:
- Removed
SIGN_WITH_KEYfrom the public environment variables list to prevent it from being displayed bystellar env - Manually added
SIGN_WITH_KEYto the backwards compatibility mapping (SOROBAN_* to STELLAR_*) to maintain functionality - Added comprehensive test coverage for both
STELLAR_SECRET_KEYandSTELLAR_SIGN_WITH_KEYto verify they are properly excluded from the env command output
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| cmd/soroban-cli/src/env_vars.rs | Removed SIGN_WITH_KEY from the unprefixed environment variables list that gets displayed |
| cmd/soroban-cli/src/cli.rs | Added SIGN_WITH_KEY to the manual list for backwards compatibility mapping while preventing display |
| cmd/crates/soroban-test/tests/it/config.rs | Added PredicateBooleanExt import and two test cases to verify SECRET_KEY and SIGN_WITH_KEY are not displayed in env output |
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.
What
Prevent STELLAR_SIGN_WITH_KEY from showing up on
stellar env.Before:
After:
Why
STELLAR_SIGN_WITH_KEYcan also contain a secret key.Known limitations
N/A