GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add depth limit to xdr encoding and decoding by mootz12 · Pull Request #2675 · stellar/stellar-cli

Conversation

@mootz12

@mootz12 mootz12 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

What

Adds a depth limit to all XDR encoding and decoding sites.

Why

This also prevents stack overflow crashes if intentionally deep XDR structs are encountered.

Known limitations

None

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mootz12
chore: add depth limit to xdr encoding and decoding
5a6e75b
@mootz12
mootz12 requested review from fnando and a balanced review from Copilot August 7, 2026 20:00
@mootz12
mootz12 requested a review from a team as a code owner August 7, 2026 20:00
@github-project-automation github-project-automation Bot added this to DevX Aug 7, 2026
@github-project-automation github-project-automation Bot moved this to Backlog (Not Ready) in DevX Aug 7, 2026
Copilot started reviewing on behalf of mootz12 August 7, 2026 20:00
View session
Copilot AI reviewed Aug 7, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Pull request overview

Adds a 500-level depth limit to XDR encoding and decoding to prevent stack-overflow crashes.

Changes:

  • Replaces unlimited XDR operations across CLI commands.
  • Applies matching limits to supporting crates.
  • Updates related test fixture encoding.

Reviewed changes

Copilot reviewed 32 out of 32 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
cmd/soroban-cli/src/utils.rs Defines the shared limit and applies it to utility XDR operations.
cmd/soroban-cli/src/signer/mod.rs Limits signer XDR encoding.
cmd/soroban-cli/src/log/event.rs Limits diagnostic-event encoding.
cmd/soroban-cli/src/key.rs Limits key XDR decoding.
cmd/soroban-cli/src/config/data.rs Limits cached-data encoding.
cmd/soroban-cli/src/commands/tx/xdr.rs Limits transaction input decoding.
cmd/soroban-cli/src/commands/tx/update/sequence_number/next.rs Limits updated transaction output.
cmd/soroban-cli/src/commands/tx/simulate.rs Limits simulated transaction output.
cmd/soroban-cli/src/commands/tx/sign.rs Limits signed transaction output.
cmd/soroban-cli/src/commands/tx/op/add/mod.rs Limits operation transaction output.
cmd/soroban-cli/src/commands/tx/fetch/result.rs Limits fetched result encoding.
cmd/soroban-cli/src/commands/tx/fetch/meta.rs Limits fetched metadata encoding.
cmd/soroban-cli/src/commands/tx/fetch/envelope.rs Limits fetched envelope encoding.
cmd/soroban-cli/src/commands/tx/edit.rs Limits transaction JSON/XDR conversion.
cmd/soroban-cli/src/commands/tx/args.rs Limits transaction output encoding.
cmd/soroban-cli/src/commands/snapshot/create.rs Limits archive XDR decoding.
cmd/soroban-cli/src/commands/network/settings.rs Limits settings XDR output.
cmd/soroban-cli/src/commands/ledger/entry/fetch/contract_data.rs Limits contract-key decoding.
cmd/soroban-cli/src/commands/events.rs Limits event value and topic decoding.
cmd/soroban-cli/src/commands/contract/upload.rs Limits upload-related XDR operations.
cmd/soroban-cli/src/commands/contract/restore.rs Limits restore transaction output.
cmd/soroban-cli/src/commands/contract/read.rs Limits contract-data output encoding.
cmd/soroban-cli/src/commands/contract/invoke.rs Limits invoke transaction output.
cmd/soroban-cli/src/commands/contract/id/wasm.rs Limits contract-ID preimage encoding.
cmd/soroban-cli/src/commands/contract/extend.rs Limits extend transaction output.
cmd/soroban-cli/src/commands/contract/deploy/wasm.rs Limits WASM deployment output.
cmd/soroban-cli/src/commands/contract/deploy/asset.rs Limits asset deployment output.
cmd/soroban-cli/src/commands/contract/build.rs Limits contract metadata and specification encoding.
cmd/soroban-cli/src/assembled.rs Limits simulation and assembly XDR operations.
cmd/crates/stellar-ledger/src/lib.rs Limits Ledger signing payload encoding.
cmd/crates/soroban-spec-typescript/src/lib.rs Limits TypeScript specification encoding.
cmd/crates/soroban-spec-tools/src/contract.rs Limits specification JSON encoding.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread cmd/soroban-cli/src/commands/tx/fetch/result.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread cmd/soroban-cli/src/commands/tx/fetch/meta.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread cmd/soroban-cli/src/commands/tx/fetch/envelope.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread cmd/soroban-cli/src/log/event.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread cmd/crates/soroban-spec-typescript/src/lib.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread cmd/soroban-cli/src/commands/tx/xdr.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

leighmcculloch
leighmcculloch approved these changes Aug 8, 2026
View reviewed changes

@leighmcculloch leighmcculloch left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

This seems fine, and also relatively low risk making this change in the cli since if a problem does arise where we have set it too low then we can quickly ship a new release and the release channels are all very accessible.

See inline comments as there are some places that I think we won't see the intended affect because the rpc client crate already decodes them without a depth limit (iirc we have not added depth limits there).

Something else I wonder about is will the depth limit actually prevent stack overflow in some of the cases like claimable balances. But in any case this is an improvement.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread cmd/soroban-cli/src/log/event.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread cmd/soroban-cli/src/commands/tx/fetch/meta.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread cmd/soroban-cli/src/commands/tx/fetch/envelope.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread cmd/soroban-cli/src/commands/tx/fetch/result.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

@mootz12
mootz12 merged commit 965aa47 into main Aug 10, 2026
230 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@mootz12
mootz12 deleted the limit-xdr-depth branch August 10, 2026 13:05
@github-project-automation github-project-automation Bot moved this from Backlog (Not Ready) to Done in DevX Aug 10, 2026
@ErenTopaal ErenTopaal mentioned this pull request Nov 19, 2026
Question: stellar tx hash decodes with depth 500, below the 1000 stellar-core accepts from protocol 28 #2895
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@leighmcculloch leighmcculloch leighmcculloch approved these changes
Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@fnando fnando Awaiting requested review from fnando

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

DevX
Status: Done

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@mootz12 @leighmcculloch
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.