You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Avoid shell execution in ReadFileTool ranged reads #5267
full reads use environment.read_file(path) and slice/number lines in Python
ranged reads build and execute cat -n '{path}' | sed -n ...
That ranged-read branch shells out on caller-controlled path instead of reusing the normal file-read path.
Problem
Because path is interpolated into a shell command, filenames containing shell metacharacters are interpreted by the shell rather than treated as literal file paths. This also makes ranged reads behave differently from the default ReadFileTool path and introduces an unnecessary shell dependency into a read-oriented tool.
Expected behavior
ReadFileTool should read files through environment.read_file(...) for both full reads and ranged reads, and apply line slicing/numbering in Python.
Proposed fix
Remove the shell-based ranged-read branch and reuse the existing Python file-read logic for all reads.
Validation
I have a PR prepared that:
removes the shell-based ranged-read path
adds regression tests showing ranged reads no longer invoke execute()
confirms in Linux that a path payload that previously executed a proof command is now treated as a literal filename and does not write a proof file
Hi @petrmarinec , Thank you for reporting this and for taking the time to submit PR (#5268).
We are currently looking into the behavior of ReadFileTool regarding ranged reads, and the engineering team is reviewing your pull request to evaluate the proposed changes.
We appreciate your contribution.
Activity
sanketpatil06 commentedon Apr 14, 2026
Hi @petrmarinec , Thank you for reporting this and for taking the time to submit PR (#5268).
We are currently looking into the behavior of ReadFileTool regarding ranged reads, and the engineering team is reviewing your pull request to evaluate the proposed changes.
We appreciate your contribution.
fix: Avoid shell execution in ReadFileTool ranged reads
fix: Avoid shell execution in ReadFileTool ranged reads (backport)
fix: Avoid shell execution in ReadFileTool ranged reads