Redact archive URL password in snapshot download output#2598
Conversation
|
Claude encountered an error after 4m 30s —— View job Claude PR ReviewTodos
|
There was a problem hiding this comment.
Pull request overview
This PR prevents accidental credential disclosure by ensuring stellar snapshot create no longer prints archive URLs containing HTTP basic-auth passwords verbatim to stderr during snapshot downloads. It reuses the existing redact_url helper already used in other commands to keep URL display consistent across the CLI.
Changes:
- Redact archive URL passwords in snapshot download progress output (“Downloading history”, “Downloaded history”, “Downloading ledger headers”).
- Add an integration test verifying the password is not present in
snapshot createstderr output.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| cmd/soroban-cli/src/commands/snapshot/create.rs | Routes history and ledger-header download URL display through redact_url to avoid leaking basic-auth passwords. |
| cmd/crates/soroban-test/tests/it/integration/snapshot.rs | Adds an integration test ensuring a credentialed --archive-url does not leak the password to stderr and shows the redaction marker. |
8e8f8e2 to
ce39041
Compare
|
Claude finished @fnando's task in 3m 34s —— View job Claude PR ReviewTodos
SummarySolid, well-scoped fix that closes a clear credential‑leak path and matches the redaction pattern already used by Findings1. Minor — inconsistent error handling on
|
|
Claude finished @fnando's task in 1m 22s —— View job Claude PR ReviewTodos
Re-review after syncThis synchronize event is the Status of prior findings1. 2. Test coverage only exercises the first of three redacted print sites — author confirmed in this reply that this is intentional and that broader coverage is deferred until a mock-archive harness exists. The redaction logic itself is unit-tested in 3. Spot-check on current HEADConfirmed at
And the redact helper at VerdictLGTM. The fix is correct, scoped, consistent with the established |

What
stellar snapshot createprinted the user/environment-supplied archive URL (--archive-url/STELLAR_ARCHIVE_URL) verbatim to stderr while downloading. When that URL carried HTTP basic-auth credentials (https://user:password@host/), the password was written to stderr in cleartext at three sites incommands/snapshot/create.rs: "Downloading history", "Downloaded history", and "Downloading ledger headers". These now pass the URL through the existingredact_urlhelper, matching hownetwork info,network ls, anddoctoralready handle credentialed URLs.Why
stderr from a CLI is routinely captured in CI/CD logs, terminal recordings, and screen shares, so a private archive credential printed there is exposed to anyone who can read those. This is the same class of leak the
redact_urlwork was written to prevent for RPC URLs; the snapshot command was the one display path that wasn't covered. Default flows (mainnet/testnet/futurenet) use hardcoded credential-free Stellar archives and are unaffected; this matters for operators pointing the command at a private, credentialed history archive.Known limitations
N/A — a codebase-wide sweep of other print/log/error sites (RPC, signer, deploy links, container, error enums,
Debugimpls) confirmed every other credentialed-URL display path already redacts, so no further sites needed changing.