Skip to content

Reject non-ULID IDs in cache actionlog read command.#2499

Merged
fnando merged 3 commits into
mainfrom
actionlog-id-validation
Apr 21, 2026
Merged

Reject non-ULID IDs in cache actionlog read command.#2499
fnando merged 3 commits into
mainfrom
actionlog-id-validation

Conversation

@fnando
Copy link
Copy Markdown
Member

@fnando fnando commented Apr 20, 2026

What

Reject non-ULID IDs in cache actionlog read command.

Why

So we only accept valid ULIDs.

Known limitations

N/A

Copilot AI review requested due to automatic review settings April 20, 2026 22:08
@github-project-automation github-project-automation Bot moved this to Backlog (Not Ready) in DevX Apr 20, 2026
@fnando fnando self-assigned this 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 22:08
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 tightens the cache actionlog read command to only accept ULID-formatted IDs, preventing non-ULID inputs from being used to construct cache file paths.

Changes:

  • Parse the provided --id as a ulid::Ulid and reject invalid IDs with a dedicated error.
  • Build the actionlog cache file path from the normalized ULID string (<ulid>.json).
  • Add unit tests to ensure path-traversal-like IDs (e.g. ../..., absolute paths) are rejected.

Comment thread cmd/soroban-cli/src/commands/cache/actionlog/read.rs
Comment thread cmd/soroban-cli/src/commands/cache/actionlog/read.rs Outdated
Comment thread cmd/soroban-cli/src/commands/cache/actionlog/read.rs
Comment thread cmd/soroban-cli/src/commands/cache/actionlog/read.rs
Comment thread cmd/soroban-cli/src/commands/cache/actionlog/read.rs
@fnando fnando enabled auto-merge (squash) April 21, 2026 00:26
Comment thread cmd/soroban-cli/src/commands/cache/actionlog/read.rs Outdated
@fnando fnando merged commit bed9f6e into main Apr 21, 2026
213 checks passed
@fnando fnando deleted the actionlog-id-validation branch April 21, 2026 17:10
@github-project-automation github-project-automation Bot moved this from Needs Review to Done in DevX Apr 21, 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