Skip to content

Shell-escape build command args in --print-commands-only output.#2502

Open
fnando wants to merge 2 commits intomainfrom
escape-args-print-commands-only
Open

Shell-escape build command args in --print-commands-only output.#2502
fnando wants to merge 2 commits intomainfrom
escape-args-print-commands-only

Conversation

@fnando
Copy link
Copy Markdown
Member

@fnando fnando commented Apr 20, 2026

What

Shell-escape build command args in --print-commands-only output.

Why

Close #2490

Known limitations

N/A

@fnando fnando self-assigned this Apr 20, 2026
Copilot AI review requested due to automatic review settings April 20, 2026 22:59
@fnando fnando requested a review from a team as a code owner April 20, 2026 22:59
@github-project-automation github-project-automation bot moved this to Backlog (Not Ready) in DevX Apr 20, 2026
@fnando fnando moved this from Backlog (Not Ready) to Needs Review in DevX Apr 20, 2026
@fnando fnando requested a review from mootz12 April 20, 2026 23:00
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 addresses a command-injection risk in stellar contract build --print-commands-only by ensuring the printed Cargo invocation is shell-safe when it contains user-controlled paths (e.g., --manifest-path).

Changes:

  • Refactors command string building into a serialize_command() helper.
  • Shell-escapes all serialized command arguments (not just environment variable values) before printing.
  • Adds a unit test to validate escaping behavior for metacharacter-containing args.

Comment thread cmd/soroban-cli/src/commands/contract/build.rs Outdated
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.

Printed Build Commands Allow Manifest Path Shell Injection

2 participants