Skip to content

Commit 33f6e3a

Browse files
committed
fix(onboarding): refuse ANY single-quote in pasted dbt path (kilo followup)
Kilo-code-bot flagged that the previous fix refused only UNMATCHED single- quotes in the pasted dbt path. A path with a matched pair like `a'b'c` survives the denylist, but wrapping it as `'a'b'c'` for the shell makes bash see three tokens (`a`, unquoted `b`, `c`) — the middle segment escapes single-quoting silently and we'd run against a different binary than the user pasted. Metacharacter denylist already blocks command injection; this is the remaining correctness gap. Refuse ANY single-quote instead of trying to count matched pairs. Single-quoting the resulting path is then provably path-preserving and the model doesn't have to reason about quote parity.
1 parent 6c8b445 commit 33f6e3a

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎packages/opencode/src/command/template/onboard-connect.txt‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,10 @@ moment, not another menu):
190190
string into a shell pipeline verbatim — a paste like `; rm -rf ~` would
191191
execute. Validate first, then always run through a single-quoted argv:
192192
1. Refuse if the path contains any of `; & | > < $ ` ( ) { } newline`
193-
or unmatched single-quote. Ask the user to paste again.
193+
or any single-quote. Ask the user to paste again. (Matched-pair
194+
single quotes still break the single-quote wrap below — `'a'b'c'`
195+
leaves `b` unquoted — so ANY single-quote is refused, not just
196+
unmatched ones.)
194197
2. Refuse if the file at that path is not executable
195198
(`test -x '<path>'` — quote the path).
196199
3. Verify it's a dbt-duckdb binary by running the SINGLE-QUOTED

0 commit comments

Comments
 (0)