Skip to content

Stop echoing secrets in contract invoke usage output - #2810

Open
fnando wants to merge 1 commit into
mainfrom
conceal-secrets-in-contract-invoke-usage
Open

fnando wants to merge 1 commit into
mainfrom
conceal-secrets-in-contract-invoke-usage

Conversation

@fnando

@fnando fnando commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

What

stellar contract invoke/deploy built the clap command name from the full pre--- command line, so --help and any usage error echoed --source, --sign-with-key, --rpc-header, and --rpc-url secrets verbatim to stdout. The usage line is now built from the known command path alone: <program> contract invoke|deploy [OPTIONS] --, where <program> is the running binary and the subcommand is supplied by the caller.

Why

Secrets passed on the command line leaked into scrollback, CI logs, and pasted reports. The project already conceals these values from the environment and in account/contract-id lookups; this closes the same leak on the invoke/deploy help path.

No user-supplied argv token reaches the usage line, so it is secret-free by construction — rather than trying to classify and scrub each argv token, which is unwinnable across clap's --flag value, --flag=value, -sVALUE, -s=VALUE, and stacked -vsVALUE forms. Deriving the path from the caller (not argv) also renders correctly when global flags such as --quiet or --config-dir precede the subcommand.

@github-project-automation github-project-automation Bot moved this to Backlog (Not Ready) in DevX Oct 19, 2026
@fnando
fnando requested review from a team and leighmcculloch October 19, 2026 18:09
@fnando fnando self-assigned this Oct 19, 2026
@fnando fnando moved this from Backlog (Not Ready) to Needs Review in DevX Oct 19, 2026
@fnando
fnando requested a lite review from Copilot October 19, 2026 19:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Two moderate secret-redaction gaps remain for header values and malformed RPC URLs.

1 open issue
What changed in this PR

This pull request redacts secrets from contract invoke/deploy usage output.

Changes:

  • Conceals secret-shaped arguments and URL passwords.
  • Adds unit coverage for redaction behavior.
File Summary
cmd/​soroban-cli/​src/​commands/​contract/​arg_parsing.rs Implements command-line concealment and tests.

Review effort: Lite

Comment thread cmd/soroban-cli/src/commands/contract/arg_parsing.rs Outdated

@leighmcculloch leighmcculloch left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few comments, but none are critically blocking, mostly highlighting that I think this is becoming a bit whack-a-mole.

Comment thread cmd/soroban-cli/src/commands/contract/arg_parsing.rs Outdated
Comment thread cmd/soroban-cli/src/commands/contract/arg_parsing.rs
Comment thread cmd/soroban-cli/src/commands/contract/arg_parsing.rs Outdated
Comment thread cmd/soroban-cli/src/commands/contract/arg_parsing.rs Outdated
@fnando
fnando force-pushed the conceal-secrets-in-contract-invoke-usage branch 3 times, most recently from b731f8d to 5a57d5b Compare October 19, 2026 23:14
@fnando
fnando requested a lite review from Copilot October 19, 2026 23:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Correct global-option handling and add the required integration regression coverage.

1 open issue
1 resolved since last review

Review effort: Lite

Comment thread cmd/soroban-cli/src/commands/contract/arg_parsing.rs Outdated
@fnando
fnando force-pushed the conceal-secrets-in-contract-invoke-usage branch from 5a57d5b to 65e0fcf Compare October 20, 2026 00:33
@fnando
fnando requested a lite review from Copilot October 20, 2026 00:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No unresolved review issues were identified.

No open issues 🎉

1 resolved since last review

Review effort: Lite

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Needs Review

Development

Successfully merging this pull request may close these issues.

3 participants