Skip to content

fix: validate attached redirection paths#3237

Merged
code-yeongyu merged 1 commit into
ultraworkers:mainfrom
hiisandog:fix/redirection-path-scope-20260608
Jun 8, 2026
Merged

fix: validate attached redirection paths#3237
code-yeongyu merged 1 commit into
ultraworkers:mainfrom
hiisandog:fix/redirection-path-scope-20260608

Conversation

@hiSandog
Copy link
Copy Markdown
Contributor

@hiSandog hiSandog commented Jun 8, 2026

Summary

  • strip attached shell redirection operators before extracting path candidates
  • validate redirection targets like <../file and 2>../file against workspace scope
  • add regression coverage for attached redirection targets

Validation

  • python3 -m unittest tests.test_security_scope -q
  • python3 -m compileall -q src/path_scope.py tests/test_security_scope.py
  • git diff --check -- src/path_scope.py tests/test_security_scope.py

@1716775457damn
Copy link
Copy Markdown

Good catch on the redirection bypass. Stripping shell redirects before path extraction is the right fix. One minor suggestion: confirm this handles no-space-after-redirect like 2>../file (valid in bash). Otherwise LGTM.

@code-yeongyu code-yeongyu merged commit 2e52ea7 into ultraworkers:main Jun 8, 2026
1 check passed
@1716775457damn
Copy link
Copy Markdown

Good catch on the attached redirection operators — <../file and 2>../file are real edge cases that could slip through naive path validation. The regression tests look solid. One suggestion: consider also covering >> (append) and &> (combined stdout+stderr) in the stripping logic, since those are also valid shell redirection syntax that could be abused similarly.

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.

3 participants