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 — fix: verify signature against cached public key after signing (#2571) by NicoMoli · Pull Request #2619 · stellar/stellar-cli

Conversation

@NicoMoli

@NicoMoli NicoMoli commented Jun 24, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

What

Add a post-sign ed25519 verification step to the Ledger and Secure Store signing paths. After producing a signature, we verify it against the signer's cached public key and fail locally with a clear error if they don't match. Covers LedgerEntry::sign_tx_hash, LedgerEntry::sign_payload, SecureStoreEntry::sign_tx_hash, and SecureStoreEntry::sign_payload.

The check is gated on a cached public key actually being present, so the cacheless --sign-with-ledger flow (which fetches the pubkey live) is unaffected.

Closes #2571.

Why

Both LedgerEntry (added in #2569) and SecureStoreEntry carry a cached/derived public key alongside the underlying signing primitive. The SignatureHint (and, for Soroban auth entries, the embedded public_key ScVal) is derived from that cached key, while the actual signature is produced live on the device/keychain.

If the cached key ever drifts from what the underlying signer actually produces (corrupted TOML, wrong device plugged in, alias pointing at a different hd-path, schema migration glitch), the transaction carries a hint/pubkey that disagrees with its signature. Today that only surfaces as an opaque Horizon rejection after submission. ed25519 verification is microseconds, so catching this locally with a clear message is essentially free.

SignerKind::Local and SignerKind::Lab are intentionally out of scope: their public key is derived from the same in-process primitive that signs, so drift is not possible.

Known limitations

The verification only runs when a cached public key is present. The cacheless --sign-with-ledger path fetches the public key live from the same device that signs, so there is nothing to drift from and no check is needed there.

Sorry, something went wrong.

Uh oh!

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

chatgpt-codex-connector[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@github-project-automation github-project-automation Bot added this to DevX Jun 24, 2026
@github-project-automation github-project-automation Bot moved this to Backlog (Not Ready) in DevX Jun 24, 2026
@NicoMoli
NicoMoli marked this pull request as ready for review June 24, 2026 20:03
Copilot AI review requested due to automatic review settings June 24, 2026 20:03
Copilot started reviewing on behalf of NicoMoli June 24, 2026 20:03
View session
Copilot AI reviewed Jun 24, 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 lightweight post-signature ed25519 verification guard for cached-public-key signers (Ledger + Secure Store) so the CLI fails locally with a clear error when the cached key drifts from the actual signing key.

Changes:

  • Introduces validation::verify_signature (ed25519-dalek strict verification) plus unit tests.
  • Wires post-sign verification into SecureStoreEntry::{sign_tx_hash, sign_payload} when a cached public key is present.
  • Wires post-sign verification into LedgerEntry::{sign_tx_hash, sign_payload} for the cached-pubkey path, and plumbs validation errors through signer/ledger error enums.

Reviewed changes

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

File Description
cmd/soroban-cli/src/signer/validation.rs Adds signature verification helper, a dedicated error, and unit tests.
cmd/soroban-cli/src/signer/mod.rs Plumbs validation errors and adds post-sign verification for Secure Store signing paths.
cmd/soroban-cli/src/signer/ledger.rs Adds post-sign verification for Ledger signing paths when a cached public key is used.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread cmd/soroban-cli/src/signer/validation.rs Resolved

Uh oh!

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

Comment thread cmd/soroban-cli/src/signer/validation.rs Resolved

Uh oh!

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Jul 3, 2026

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

All reactions

Sorry, something went wrong.

Uh oh!

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

@NicoMoli

NicoMoli commented Jul 9, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor Author

Hello @fnando and @leighmcculloch
Would be great for me having some feedback about this minor improvement!
Let me know in case of something
Thanks

All reactions

Sorry, something went wrong.

Uh oh!

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

NicoMoli and others added 3 commits July 27, 2026 15:42
@NicoMoli @fnando
fix: verify signature against cached public key after signing (stella…
43a1c67
…r#2571)
@NicoMoli @fnando
fix: distinguish malformed key/signature from genuine signature mismatch
8b3a7b3
@fnando
Add test for invalid cached public key.
1d93223
@fnando
fnando force-pushed the fix/verify-signature-cached-pubkey-2571 branch from a13110f to 1d93223 Compare July 27, 2026 18:43
@fnando
fnando enabled auto-merge (squash) July 27, 2026 18:44
@fnando
Use if-let for cached key check when signing.
819c8b1
fnando
fnando approved these changes Jul 27, 2026
View reviewed changes
@fnando
fnando merged commit 380f7c1 into stellar:main Jul 27, 2026
224 checks passed

Uh oh!

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

@github-project-automation github-project-automation Bot moved this from Backlog (Not Ready) to Done in DevX Jul 27, 2026
@fnando

fnando commented Jul 27, 2026

Copy link
Copy Markdown
Member

@NicoMoli thanks for the pr!

All reactions

Sorry, something went wrong.

Uh oh!

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

@NicoMoli

NicoMoli commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

@NicoMoli thanks for the pr!

Thanks @fnando for your time on validating the changes!

All reactions

Sorry, something went wrong.

Uh oh!

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

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 fnando approved these changes

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.

Verify signature against cached public key after signing

Uh oh!

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

3 participants

@NicoMoli @fnando
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.