Skip to content

Sanitize user data.#2554

Merged
fnando merged 2 commits into
mainfrom
sanitize-user-data
May 5, 2026
Merged

Sanitize user data.#2554
fnando merged 2 commits into
mainfrom
sanitize-user-data

Conversation

@fnando

@fnando fnando commented May 5, 2026

Copy link
Copy Markdown
Member

What

Sanitize more user data that's printed to the screen.

Why

Close https://hackerone.com/reports/3714798

Known limitations

N/A

@fnando fnando requested review from leighmcculloch and mootz12 May 5, 2026 17:51
@fnando fnando self-assigned this May 5, 2026
@fnando fnando requested a review from a team as a code owner May 5, 2026 17:51
Copilot AI review requested due to automatic review settings May 5, 2026 17:51
@fnando fnando added this to DevX May 5, 2026
@github-project-automation github-project-automation Bot moved this to Backlog (Not Ready) in DevX May 5, 2026
@fnando fnando moved this from Backlog (Not Ready) to Needs Review in DevX May 5, 2026

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.

Pull request overview

This PR expands terminal-escape/control-byte sanitization for user/RPC/spec-derived strings printed by stellar (notably decoded contract events and spec verification/errors), aiming to close the referenced HackerOne report.

Changes:

  • Add sanitized formatting for decoded contract events and regression tests ensuring attacker control bytes don’t reach terminal output.
  • Sanitize additional spec warning/error strings in soroban-spec-tools, with tests to prevent regressions.
  • Sanitize WASM export function names printed during contract build summary.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
cmd/soroban-cli/src/log/event.rs Adds a helper to format decoded events using sanitize(...) and includes a regression test.
cmd/soroban-cli/src/commands/events.rs Sanitizes decoded event name/topics/param names in pretty event output and adds a regression test via a buffer writer.
cmd/soroban-cli/src/commands/contract/info/interface.rs Adds a security-focused comment explaining why Rust output is currently safe and when to sanitize in the future.
cmd/soroban-cli/src/commands/contract/build.rs Sanitizes printed WASM export names to avoid control-byte injection in build summaries.
cmd/crates/soroban-spec-tools/src/verify.rs Sanitizes Display strings for SpecWarning variants and adds regression tests.
cmd/crates/soroban-spec-tools/src/test_utils.rs Introduces a shared test helper to assert output contains no control bytes (except \\n/\\t).
cmd/crates/soroban-spec-tools/src/lib.rs Sanitizes several error payload strings (e.g., missing entry/key/enum-case paths) and adds regression tests.
cmd/crates/soroban-spec-tools/src/event.rs Sanitizes parameter names included in event decode errors.

Comment thread cmd/soroban-cli/src/log/event.rs
Comment thread cmd/soroban-cli/src/commands/events.rs
Comment thread cmd/crates/soroban-spec-tools/src/lib.rs
Comment thread cmd/soroban-cli/src/commands/contract/build.rs
@fnando fnando force-pushed the sanitize-user-data branch from 8c40858 to f401503 Compare May 5, 2026 20:10
@fnando fnando merged commit 12d7ba8 into main May 5, 2026
211 checks passed
@fnando fnando deleted the sanitize-user-data branch May 5, 2026 20:34
@github-project-automation github-project-automation Bot moved this from Needs Review to Done in DevX May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants