Is the behavior behind the Shellshock vulnerability in Bash documented or at all intentional?

前端 未结 4 815
余生分开走
余生分开走 2020-11-30 03:26

A recent vulnerability, CVE-2014-6271, in how Bash interprets environment variables was disclosed. The exploit relies on Bash parsing some environment variable declarations

4条回答
  •  温柔的废话
    2020-11-30 04:14

    In regard to your question about documentation, notice here in the commandline documentation for the env command, that a study of the syntax shows that env is working as documented.

    • There are, optionally, 4 possible options
    • An optional hyphen as a synonym for -i (for backward compatibility I assume)
    • Zero or more NAME=VALUE pairs. These are the variable assignment(s) which could include function definitions.
    • Note that no semicolon (;) is required between or following the assignments.
    • The last argument(s) can be a single command followed by its argument(s). It will run with whatever permissions have been granted to the login being used. Security is controlled by restricting permissions on the login user and setting permissions on user-accessible executables such that users other than the executable's owner can only read and execute the program, not alter it.
    [ spot@LX03:~ ] env --help
    Usage: env [OPTION]... [-] [NAME=VALUE]... [COMMAND [ARG]...]
    Set each NAME to VALUE in the environment and run COMMAND.
    
      -i, --ignore-environment   start with an empty environment
      -u, --unset=NAME           remove variable from the environment
          --help     display this help and exit
          --version  output version information and exit
    
    A mere - implies -i.  If no COMMAND, print the resulting environment.
    
    Report env bugs to bug-coreutils@gnu.org
    GNU coreutils home page: 
    General help using GNU software: 
    Report env translation bugs to 
    

提交回复
热议问题