Repository navigation
Conversation
fnando
requested review from
a team and
leighmcculloch
and
a lite review from Copilot
December 1, 2026 00:35
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
A moderate active issue remains because an unescaped dependency URI can inject terminal control sequences into the CLI’s repository-mismatch error output.
1 open issue
What changed in this PR
This PR hardens stellar contract info build output by escaping control characters from author-controlled attestation fields before displaying them in the terminal. Resolved dependency URIs remain unsanitized when displayed in repository-mismatch errors.
Changes:
- Added a reusable Serde deserializer that escapes control characters in six displayed attestation fields.
- Applied escaping to workflow metadata, runner environment, commit, and invocation URL fields.
- Added unit coverage for control-character sanitization across all six fields.
| File | Description |
|---|---|
| cmd/soroban-cli/src/commands/contract/info/build.rs | Escapes control characters in displayed attestation metadata, adds regression coverage, and retains an unsanitized resolved dependency URI on the repository-mismatch error path. |
Review effort: Lite
fnando
force-pushed
the
fix/info-build-escape-attestation-output
branch
from
December 1, 2026 21:57
a170b72 to
c066245
Compare
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
stellar contract info buildnow escapes control characters in the attestation details it prints: the workflow repository, ref and path, the git commit, the runner environment and the run URL. A new unit test covers all six fields.Why
These values come from the attestation published under the repository named in the contract's
source_repometadata, and they were printed to the terminal unchanged. An attestation could include escape sequences that move the cursor, erase or rewrite earlier lines of output (such as theSource Repoline or the warning), or disguise link targets. After this change they show up as visible text like\x1binstead. Thesource_repovalue read from the wasm metadata was already escaped.Known limitations
The subject digest and the resolved dependency URI are compared in their raw form; the dependency URI is escaped only when it is shown in a repository-mismatch error.