CVE-2014-7169 Bash Shellshock Secondary Injection via Function Definition Names
a419b0dd-8d4a-4db5-b14f-9b73d4346b5d
CVE-2014-7169 is a secondary command injection vulnerability in bash versions 4.3 and earlier that bypasses the original Shellshock (CVE-2014-6271) fix. The vulnerability exists in the function definition import logic. When bash processes exported functions from environment variables, it checks if the variable value starts with '() {' to identify function definitions. However, in non-POSIX mode (the default), the code fails to validate that the variable name itself is a legal identifier before constructing and executing a command string that concatenates the name with the function body. This allows attackers to inject shell metacharacters (backticks, command substitution, etc.) in the variable name, which are then evaluated as shell code during bash initialization.",
touch /tmp/pwned=() { echo test; }' and running bash. Without the fix, the backticks are executed. With the fix, they are rejected because the name fails legal_identifier() validation and parse_and_execute is not called.",