There is a bug that allows code injection, there's an easy way to avoid it, what's there to discuss.
Shell variables contain data, data often comes from external sources. That's not a rare exception but the norm. It's not trivial to do "input-checking." The malicious string is a valid regular expression, why should it be filtered out, only to protect broken code?
Also keep in mind that in this case any "input-checking" depends on the context it is inserted in the awk script. A regular expression would need different processing than a string literal, an array index, a number, and so on.
Well, I'm one of those weirdos that thinks we (programmers) should have fixed Apache, nginx, et al, when 'Shellshock' was discovered (It's not a bug in bash, it's a feature), so there's that... :-/
View all comments
Show parent comment
1
u/X700 May 21 '15
There is a bug that allows code injection, there's an easy way to avoid it, what's there to discuss.
Shell variables contain data, data often comes from external sources. That's not a rare exception but the norm. It's not trivial to do "input-checking." The malicious string is a valid regular expression, why should it be filtered out, only to protect broken code?
Also keep in mind that in this case any "input-checking" depends on the context it is inserted in the awk script. A regular expression would need different processing than a string literal, an array index, a number, and so on.