Skip to content

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

Open
fnando wants to merge 2 commits intomainfrom
actionlog-id-validation
Open

Reject non-ULID IDs in cache actionlog read command.#2499
fnando wants to merge 2 commits intomainfrom
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
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.

2 participants