For more & newer tests & consideration of other
shells, eg ksh etc, see the
mail list link above.
# Next line from np@, Thanks.
env x='() { :;}; echo Vulnerable.' bash -c "echo This is a
test."
# Old bash:
Vulnerable.
This is a test.
# Fresh patched current bash:
bash: warning: x: ignoring function definition
attempt
bash: error importing function definition for `x'
This is a test.
# Show the error message goes to stderr, not stdout:
env x='() { :;}; echo Vulnerable.' bash -c "echo This is a
test." > stdout
# Old bash:
Nothing to stderr
# Fresh patched current bash:
To stderr:
bash: warning: x: ignoring function definition
attempt
bash: error importing function definition for `x'
cat stdout
# Old bash:
Vulnerable.
This is a test.
# Fresh patched current bash:
This is a test.