Skip to content

fix(miner): validate commit SHA format in replay-snapshot path planner (#7796) - #7836

Closed
RealDiligent wants to merge 1 commit into
JSONbored:mainfrom
RealDiligent:fix/replay-snapshot-commit-sha-validation-7796
Closed

fix(miner): validate commit SHA format in replay-snapshot path planner (#7796)#7836
RealDiligent wants to merge 1 commit into
JSONbored:mainfrom
RealDiligent:fix/replay-snapshot-commit-sha-validation-7796

Conversation

@RealDiligent

Copy link
Copy Markdown
Contributor

Summary

  • Add /^[0-9a-f]{7,40}$/i validation to normalizeCommitSha (matching replay-task-generation.ts) so path-traversal-shaped values are rejected before path.join()n- Normalize valid SHAs to lowercase for deterministic snapshot paths
  • Regression tests for traversal-shaped input, too-short SHAs, uppercase normalization; update fixture SHAs across replay-snapshot tests

Closes #7796

Test plan

  • npm run typecheck passes locally
  • npm run build:tsc in miner workspace emits matching .js
  • CI validate-code + validate-tests green
  • codecov/patch >= 99% on changed lines

Made with Cursor

@RealDiligent
RealDiligent requested a review from JSONbored as a code owner July 21, 2026 14:29
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@RealDiligent
RealDiligent force-pushed the fix/replay-snapshot-commit-sha-validation-7796 branch from eac03a7 to ea9695b Compare July 21, 2026 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

replay-snapshot.ts's normalizeCommitSha has no format validation, letting a crafted value escape the intended snapshot directory via path.join

1 participant