Skip to content

Security: harden command execution against shell-path hijacking#279

Merged
ghantoos merged 1 commit intopre-releasefrom
f/engine-v2
Apr 3, 2026
Merged

Security: harden command execution against shell-path hijacking#279
ghantoos merged 1 commit intopre-releasefrom
f/engine-v2

Conversation

@ghantoos
Copy link
Copy Markdown
Owner

@ghantoos ghantoos commented Apr 3, 2026

  • Add a shared expansion inspector (lshell/expansion_inspector.py) and use it in both sec and engine authorizer paths.
  • Enforce recursive validation of nested shell expansions ($(), backticks, process substitution, arithmetic/parameter expansions).
  • Fail closed on malformed or unsupported expansion/syntax patterns.
  • Harden path checks with safer wildcard handling (brace expansion limits, extglob fail-closed behavior, improved token/path detection).
  • Block environment-based breakout vectors by rejecting BASH_FUNC_* exports/sourced vars and scrubbing BASH_FUNC_* from child process environments.
  • Keep SSH (overssh) allowlist behavior consistent for nested expansion payloads.

Use trusted absolute shell interpreters for non-sudo/su execution, add breakout regression coverage, and keep compatibility/lint coverage aligned.
@ghantoos ghantoos merged commit 1337c96 into pre-release Apr 3, 2026
6 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.

1 participant