5 ms·
It looks like the important part of the patch (bash43-025) is here: In builtins/evalstring.c: if ((flags & SEVAL_FUNCDEF) && command->type != cm_function_
by userbinator 12y ago
It looks like the important part of the patch (bash43-025) is here:
In builtins/evalstring.c:
if ((flags & SEVAL_FUNCDEF) && command->type != cm_function_def)
In variables.c:
parse_and_execute (temp_string, name, SEVAL_NONINT|SEVAL_NOHIST|SEVAL_FUNCDEF|SEVAL_ONECMD);
So what the patch does is create a special mode of parse_and_execute() where it's supposed to only evaluate function definitions. A better option would be to add a flag to parse_and_execute() that disables it from attempting any execution completely, not just function definitions.
- ygra 12y agoWouldn't that break the feature? Function definitions need to be executed so that they are available, right?
- userbinator 12y agoBy "execution" I meant the execution of arbitrary code, either shell builtins or other programs, the original point of this vulnerability. Function definitions should really be thought of as being evaluated to make them available for future use.