Linux security Vulnerability Bash patching method

Source: Internet
Author: User
Tags function definition

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.