False-positive "glob-expand" warning on literal [bracket] path segments (e.g. Next.js dynamic routes)

Status Open
Maintainer reply None cached
Activity 0 comments · opened Aug 26, 2026

When a find/Bash command contains a quoted path with literal square brackets — e.g. a Next.js dynamic route folder like app/[lang]/_components — the permission prompt flags it: "contains glob characters — could glob-expand to a dangerous action."

The brackets here are a literal directory name, not an intended glob pattern, and the argument is double-quoted, so the shell won't actually expand them. The static analyzer can't distinguish "literal bracket in a real path" from "attacker-controlled glob," which makes this a common false positive in any codebase using bracket-named directories (Next.js/Remix/SvelteKit route conventions all use this).

Request: When the bracketed segment is inside a quoted argument (single or double quotes), skip the glob-expansion warning, since quoting prevents shell expansion. This would remove a very common source of confusing prompts for JS/TS projects using file-based routing.

Related: same command's permission preview doesn't highlight which span triggered the flag (see #89758) — this one compounds that, since users have to reason about quoting/glob semantics to even understand why it fired.

View original on GitHub ↗