Bash how to deal with the problem of security vulnerability
One: Vulnerability description
The vulnerability stems from the special environment variables created before the bash shell that you invoke, which can contain code and be executed by bash.
II: Software and systems identified for successful use
All Linux operating systems that install the version of Gun bash are less than or equal to 4.3.
Three: Vulnerability detection method
[Email protected] ~]# bash-version
GNU Bash, version 4.1.2 (1)-release (X86_64-REDHAT-LINUX-GNU)
Copyright (C) Software Foundation, Inc.
License gplv3+: GNU GPL version 3 or later
This was free software; Redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Input:
[[email protected] ~]# env x= ' () {:;}; Echo vulnerable ' bash-c "echo this is a test"
Output:
Vulnerable
This is a test
If the above information appears, the system has a vulnerability.
Four: Treatment methods
Here are the actions on the virtual machine
[[email protected] ~]# yum-y Update bash
After you upgrade bash, perform the test:
[[email protected] ~]# env x= ' () {:;}; Echo vulnerable ' bash-c "echo this is a test"
BASH:WARNING:X: Ignoring function definition attempt
Bash:error importing function definition for ' x '
This is a test
If shown above, indicates that the vulnerability has been patched.
Linux security Vulnerability Bash patching method