Repository navigation
fix(exec): splice shell line continuations before allowlist analysis - #71225
udaymanish6 wants to merge 1 commit into
Conversation
Greptile SummaryThis PR replaces the blanket rejection of commands containing shell line continuations ( The implementation correctly handles single-quote preservation (no splicing inside Confidence Score: 5/5Safe to merge — the splicing logic is quote-aware, the security-critical $<newline>(cmd) bypass case is explicitly tested and caught, and chain-operator injection after splicing is correctly blocked. All findings from the prior review thread are already addressed in the new implementation (single-quote context is preserved, not spliced). No new P0/P1 issues were found. Remaining observations are at P2 or below. No files require special attention. Reviews (2): Last reviewed commit: "fix(exec): splice shell line continuatio..." | Re-trigger Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b9d2f95e10
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const command = hasShellLineContinuation(params.command) | ||
| ? spliceShellLineContinuations(params.command) | ||
| : params.command; |
There was a problem hiding this comment.
Preserve comment-context newlines during command splicing
This unconditional pre-pass strips every \+newline pair, but POSIX shells do not treat that pair as a line continuation in all contexts (notably comments), so analysis can diverge from runtime execution. For example, /usr/bin/echo ok # note \\\n/usr/bin/rm -rf / executes the second line as a separate command in the shell, while the spliced string turns it into part of the comment and can incorrectly satisfy an /usr/bin/echo allowlist entry. That creates a policy-bypass path for multiline input; splicing needs to be syntax-aware (or fallback to reject when context is ambiguous).
Useful? React with 👍 / 👎.
b9d2f95 to
0fcf830
Compare
|
Closing this as duplicate or superseded after Codex automated review. PR #71225 is a narrower duplicate/superseded implementation for the same exec allowlist line-continuation problem already tracked by open issue #71153 and open PR #71154. Current main still rejects shell backslash-newline continuations before allowlist analysis, so this is not implemented-on-main; the best cleanup is to close #71225 and keep the maintainer-reviewed #71154/#71153 path as canonical. Best possible solution: Close #71225 as superseded by the canonical #71154 implementation for open issue #71153. Keep the remaining work on #71154/#71153, where maintainers can review the syntax-aware POSIX continuation normalizer, comment/heredoc/quote behavior, clearer unsupported-syntax errors, and required regression coverage before merging. What I checked:
So I’m closing this here and keeping the remaining discussion on the canonical linked item. Codex Review notes: model gpt-5.5, reasoning high; reviewed against 7e376e5aba32. |
No description provided.