Skip to content

fix(test-utils): validate fixture paths against repo root#7

Open
piyushbag wants to merge 1 commit into
Instadapp:mainfrom
piyushbag:fix/path-traversal-test-utils
Open

fix(test-utils): validate fixture paths against repo root#7
piyushbag wants to merge 1 commit into
Instadapp:mainfrom
piyushbag:fix/path-traversal-test-utils

Conversation

@piyushbag

Copy link
Copy Markdown

Problem

Aikido flagged path traversal in the LiteSVM test framework where program bytecode and lookup-table JSON paths were read without validating they stay inside the repository.

Approach

  • Add validate_readable_path helper that rejects .. segments and canonicalizes paths against the repo root.
  • Use the helper in Vm::add_program_from_file and LookupTableHelper::load_lookup_table_from_file.

Test plan

  • cargo test helpers::path in test-utils/rust

Fixes #5

Reject parent-dir segments and paths outside the repository when loading
program bytecode or lookup-table JSON in the LiteSVM test framework.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Path traversal attack possible - fluid-solana-programs

1 participant