You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bash brace expansion can produce a parent-traversal path the bash path projection never sees. cat {..,y}/z makes bash read ../z and y/z, but the token reaches the classifiers as the literal {..,y}/z.
The resolver resolves that literal lexically against the effective working directory, where {..,y} is a single segment, so the path stays inside the cwd and nothing is flagged.
I measured this at 60c22b0a with a disposable spike through the real BashProgram (cwd /home/user/work):
Command
externalAccesses()
cat {..,y}/z
[]
cd ~/x && cat {..,y}/z
[…, "/home/user/work/{..,y}/z"]
The second row is flagged only because the effective base is unknown after cd ~/x and today's classifier accepts any token that contains .. as a substring.
Issue #859 narrows that to a whole .. segment (so git revision ranges like HEAD..origin/main stop raising external_directory asks), and the unknown-base row will then return [] as well.
So both rows will be unflagged, and brace expansion becomes a gap that nothing records.
Expected behavior
A token whose brace expansion yields a .. segment should reach the external_directory gate.
The simplest options I can see:
Treat an unexpanded brace-expansion token ({a,b}, {1..3}) conservatively, the way ADR 0009 handles an unknown base.
Expand the brace set at token collection, the same way $HOME/$PWD are resolved in shell-variable-expansion.ts, and classify each expansion.
Found while planning #859.
The {..,y} form turned up in no command of an 8360-command local review-log corpus, so this is a reachability gap rather than an observed one.
Package
pi-permission-system
What happened?
Bash brace expansion can produce a parent-traversal path the bash path projection never sees.
cat {..,y}/zmakes bash read../zandy/z, but the token reaches the classifiers as the literal{..,y}/z.The resolver resolves that literal lexically against the effective working directory, where
{..,y}is a single segment, so the path stays inside the cwd and nothing is flagged.I measured this at
60c22b0awith a disposable spike through the realBashProgram(cwd/home/user/work):externalAccesses()cat {..,y}/z[]cd ~/x && cat {..,y}/z[…, "/home/user/work/{..,y}/z"]The second row is flagged only because the effective base is unknown after
cd ~/xand today's classifier accepts any token that contains..as a substring.Issue #859 narrows that to a whole
..segment (so git revision ranges likeHEAD..origin/mainstop raisingexternal_directoryasks), and the unknown-base row will then return[]as well.So both rows will be unflagged, and brace expansion becomes a gap that nothing records.
Expected behavior
A token whose brace expansion yields a
..segment should reach theexternal_directorygate.The simplest options I can see:
{a,b},{1..3}) conservatively, the way ADR 0009 handles an unknown base.$HOME/$PWDare resolved inshell-variable-expansion.ts, and classify each expansion.Additional context
Found while planning #859.
The
{..,y}form turned up in no command of an 8360-command local review-log corpus, so this is a reachability gap rather than an observed one.