Skip to content

fix: Prevent reading special device files and limit file size in cortex run#9

Merged
echobt merged 1 commit intomasterfrom
fix/issue-1564
Jan 26, 2026
Merged

fix: Prevent reading special device files and limit file size in cortex run#9
echobt merged 1 commit intomasterfrom
fix/issue-1564

Conversation

@echobt
Copy link
Contributor

@echobt echobt commented Jan 26, 2026

Description

Fixes #1564 where cortex run --file /dev/zero would hang indefinitely due to reading an infinite stream.

Changes

  • Added validation in run_cmd.rs to check if the path is a regular file or directory.
  • Added a file size limit (10MB) to prevent OOM issues with large files.

Testing

  • Validated with /dev/zero (now fails gracefully).
  • Validated with large files > 10MB (now fails gracefully).
  • Validated with normal files (works as expected).

@echobt echobt merged commit 1bd743b into master Jan 26, 2026
1 of 12 checks passed
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.

2 participants