Activity log for bug #1411318

Date Who What changed Old value New value Message
2015-01-15 16:51:00 Phillip Sz bug added bug
2015-01-15 16:51:56 Phillip Sz information type Private Security Public Security
2015-01-15 16:52:47 Phillip Sz description "The problem with bash's name references Bash 4.3 introduced declare -n ("name references") to mimic Korn shell's nameref feature, which permits variables to hold references to other variables (see FAQ 006 to see these in action). Unfortunately, the implementation used in Bash has some issues. {…} Bash's name reference implementation still allows arbitrary code execution: $ foo() { declare -n var=$1; echo "$var"; } $ foo 'x[i=$(date)]' bash: i=Thu Mar 27 16:34:09 EDT 2014: syntax error in expression (error token is "Mar 27 16:34:09 EDT 2014") It's not an elegant example, but you can clearly see that the date command was actually executed. This is not at all what one wants. source: http://mywiki.wooledge.org/BashFAQ/048 "The problem with bash's name references Bash 4.3 introduced declare -n ("name references") to mimic Korn shell's nameref feature, which permits variables to hold references to other variables (see FAQ 006 to see these in action). Unfortunately, the implementation used in Bash has some issues. {…} Bash's name reference implementation still allows arbitrary code execution: $ foo() { declare -n var=$1; echo "$var"; } $ foo 'x[i=$(date)]' bash: i=Thu Mar 27 16:34:09 EDT 2014: syntax error in expression (error token is "Mar 27 16:34:09 EDT 2014") It's not an elegant example, but you can clearly see that the date command was actually executed. This is not at all what one wants." source: http://mywiki.wooledge.org/BashFAQ/048
2015-01-30 20:40:27 Marc Deslauriers bash (Ubuntu): status New Confirmed
2015-01-30 20:55:45 Phillip Sz description "The problem with bash's name references Bash 4.3 introduced declare -n ("name references") to mimic Korn shell's nameref feature, which permits variables to hold references to other variables (see FAQ 006 to see these in action). Unfortunately, the implementation used in Bash has some issues. {…} Bash's name reference implementation still allows arbitrary code execution: $ foo() { declare -n var=$1; echo "$var"; } $ foo 'x[i=$(date)]' bash: i=Thu Mar 27 16:34:09 EDT 2014: syntax error in expression (error token is "Mar 27 16:34:09 EDT 2014") It's not an elegant example, but you can clearly see that the date command was actually executed. This is not at all what one wants." source: http://mywiki.wooledge.org/BashFAQ/048 "The problem with bash's name references Bash 4.3 introduced declare -n ("name references") to mimic Korn shell's nameref feature, which permits variables to hold references to other variables (..). Unfortunately, the implementation used in Bash has some issues. {…} Bash's name reference implementation still allows arbitrary code execution: $ foo() { declare -n var=$1; echo "$var"; } $ foo 'x[i=$(date)]' bash: i=Thu Mar 27 16:34:09 EDT 2014: syntax error in expression (error token is "Mar 27 16:34:09 EDT 2014") It's not an elegant example, but you can clearly see that the date command was actually executed. This is not at all what one wants." source: http://mywiki.wooledge.org/BashFAQ/048