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
{{ message }}
Repository navigation
Read a Double-Quoted Wrapper Body's Run-Time Words as Splittable in the Write Guard #3075
Found by the local review of the lane closing #3006. The new merge check and the existing commit check share it. It was confirmed with classify probes on constructed commands.
A Double-Quoted Wrapper Body Is Read With Quotes the Outer Shell Already Expanded Through
The outer shell expands a $ word inside a double-quoted -c body before the inner shell reads it. The guard reads the body's inner quotes as if they were written by hand. So a quoted option value there is exempt from the run-time word check, although its expansion can carry the inner shell's own quotes:
B="x' --admin '"; sh -c "gh pr merge 5 --squash --body '$B'" is allowed. The inner shell runs gh pr merge 5 --squash --body 'x' --admin ''.
B="' -n '"; sh -c "git commit -m '$B'" is allowed through the same exemption on a commit's quoted value.
An unquoted value in the same body, as in bash -c "gh pr merge 5 --squash $A", is denied.
Possible Direction
Carry from _embedded_wrapper_commands whether a body came from double quotes, and read a run-time word inside such a body as never split-free, since the outer shell has already put its text into the body. One change there covers the merge and the commit sites.
Activity
Read Abbreviated, Clustered, and Negated Options in the Write Guard (#…
Read Every Launcher and Exported Git Directory in the Write Guard (#3342
Read Tokenizer, Directory-Value, and Launched-String Gaps in the Writ…