This article is a mirror article of machine translation, please click here to jump to the original article.

View: 13297|Reply: 2

[linux] Linux Glibc Library Critical Security Vulnerability Fix Notice (Important)

[Copy link]
Posted on 1/30/2015 6:36:02 PM | | |
Hello, a few days agoLinuxA buffer overflow vulnerability has been discovered in the gethostbyname function of the GNU glibc standard library, and the vulnerability number is CVE-2015-0235. Hackers can use the gethostbyname series of functions to execute remote code and obtain itserverThis vulnerability has many trigger paths and a large scope of impact, please pay attention to and temporarily fix it in time, and we will update it as soon as possibleMirroringFix. Please know.

1. Vulnerability release date
2015January 27, 2019


2. Software and systems that have been confirmed to be successfully used
Glibc 2.2Up to 2.17 (includes versions 2.2 and 2.17)

3. Description of vulnerabilities
GNU glibcA buffer overflow vulnerability was exposed in the gethostbyname function of the standard library, and the vulnerability number is CVE-2015-0235. Glibc is a C library that provides system calls and basic functions, such as open, malloc, printf, etc. All dynamically connected programs use Glibc. A remote attacker could exploit this vulnerability to execute arbitrary code and escalate the privileges of the user running the application.

4. Vulnerability detection methods


Follow the instructionsoperationCan.
#include <netdb.h>   
#include <stdio.h>   
#include <stdlib.h>   
#include <string.h>   
#include <errno.h>   
#define CANARY"in_the_coal_mine"   
struct {   
  char buffer[1024];   
  char canary[sizeof(CANARY)];   
} temp = { "buffer", CANARY };   
int main(void) {   
  struct hostent resbuf;   
  struct hostent *result;   
  int herrno;   
  int retval;   
  /*** strlen (name) = size_needed -sizeof (*host_addr) - sizeof (*h_addr_ptrs) - 1; ***/   
  size_t len = sizeof(temp.buffer) -16*sizeof(unsigned char) - 2*sizeof(char *) - 1;   
  char name[sizeof(temp.buffer)];   
  memset(name, '0', len);   
  name[len] = '\0';   
  retval = gethostbyname_r(name,&resbuf, temp.buffer, sizeof(temp.buffer), &result, &herrno);   
  if (strcmp(temp.canary, CANARY) !=0) {   
    puts("vulnerable");   
    exit(EXIT_SUCCESS);   
  }   
  if (retval == ERANGE) {   
    puts("notvulnerable");   
    exit(EXIT_SUCCESS);   
  }   
  puts("should nothappen");   
  exit(EXIT_FAILURE);   
}


Save as GHOST.c
Run gcc GHOST.c -o GHOST


$./GHOST   
novulnerable
Represents a successful repair.


5. Suggest repair plans


Special Note: Since glibc is a basic component of the Linux system, in order to avoid the impact of patching on your server, it is recommended that you choose a suitable time to repair, and be sure to back up through the snapshot operation before repairing.



Centos 5/6/7:


yum update glibc


Ubuntu 12/14
apt-get update
apt-get install libc6


Debian 6


wget -O /etc/apt/sources.list.d/debian6-lts.listhttp://mirrors.aliyun.com/repo/debian6-lts.list
apt-get update
apt-get install libc6




Debian 7


apt-get update
apt-get install libc6


Opensuse 13


zypper refresh
zypper update glibc*


Aliyun linux 5u7


wget -O /etc/yum.repos.d/aliyun-5.repohttp://mirrors.aliyun.com/repo/aliyun-5.repo  
yum update glibc





Previous:C# copy and paste text information to the clipboard
Next:html dl dt dd tag element syntax structure and usage
Posted on 1/30/2015 8:51:58 PM |
has been fixed.
Posted on 1/31/2015 6:49:17 PM |
base                                                              | 3.7 kB     00:00     
base/primary_db                                                   | 4.6 MB     00:01     
epel                                                              | 4.4 kB     00:00     
epel/primary_db                                                   | 6.3 MB     00:02     
extras                                                            | 3.4 kB     00:00     
extras/primary_db                                                 |  30 kB     00:00     
updates                                                           | 3.4 kB     00:00     
updates/primary_db                                                | 2.1 MB     00:00     
Setting up Update Process
Resolving Dependencies
--> Running transaction check
---> Package glibc.x86_64 0:2.12-1.132.el6_5.2 will be updated
--> Processing Dependency: glibc = 2.12-1.132.el6_5.2 for package: glibc-devel-2.12-1.132.el6_5.2.x86_64
--> Processing Dependency: glibc = 2.12-1.132.el6_5.2 for package: glibc-headers-2.12-1.132.el6_5.2.x86_64
--> Processing Dependency: glibc = 2.12-1.132.el6_5.2 for package: glibc-common-2.12-1.132.el6_5.2.x86_64
--> Processing Dependency: glibc = 2.12-1.132.el6_5.2 for package: nscd-2.12-1.132.el6_5.2.x86_64
---> Package glibc.x86_64 0:2.12-1.149.el6_6.5 will be an update
--> Running transaction check
---> Package glibc-common.x86_64 0:2.12-1.132.el6_5.2 will be updated
---> Package glibc-common.x86_64 0:2.12-1.149.el6_6.5 will be an update
---> Package glibc-devel.x86_64 0:2.12-1.132.el6_5.2 will be updated
---> Package glibc-devel.x86_64 0:2.12-1.149.el6_6.5 will be an update
---> Package glibc-headers.x86_64 0:2.12-1.132.el6_5.2 will be updated
---> Package glibc-headers.x86_64 0:2.12-1.149.el6_6.5 will be an update
---> Package nscd.x86_64 0:2.12-1.132.el6_5.2 will be updated
---> Package nscd.x86_64 0:2.12-1.149.el6_6.5 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

=========================================================================================
Package               Arch           Version                      Repository       Size
=========================================================================================
Updating:
glibc                 x86_64         2.12-1.149.el6_6.5           updates         3.8 M
Updating for dependencies:
glibc-common          x86_64         2.12-1.149.el6_6.5           updates          14 M
glibc-devel           x86_64         2.12-1.149.el6_6.5           updates         983 k
glibc-headers         x86_64         2.12-1.149.el6_6.5           updates         612 k
nscd                  x86_64         2.12-1.149.el6_6.5           updates         223 k

Transaction Summary
=========================================================================================
Upgrade       5 Package(s)

Total download size: 20 M
Is this ok [y/N]: y
Downloading Packages:
(1/5): glibc-2.12-1.149.el6_6.5.x86_64.rpm                        | 3.8 MB     00:00     
(2/5): glibc-common-2.12-1.149.el6_6.5.x86_64.rpm                 |  14 MB     00:03     
(3/5): glibc-devel-2.12-1.149.el6_6.5.x86_64.rpm                  | 983 kB     00:00     
(4/5): glibc-headers-2.12-1.149.el6_6.5.x86_64.rpm                | 612 kB     00:00     
(5/5): nscd-2.12-1.149.el6_6.5.x86_64.rpm                         | 223 kB     00:00     
-----------------------------------------------------------------------------------------
Total                                                    4.6 MB/s |  20 MB     00:04     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Updating   : glibc-2.12-1.149.el6_6.5.x86_64                                      1/10
  Updating   : glibc-common-2.12-1.149.el6_6.5.x86_64                               2/10
  Updating   : glibc-headers-2.12-1.149.el6_6.5.x86_64                              3/10
  Updating   : glibc-devel-2.12-1.149.el6_6.5.x86_64                                4/10
  Updating   : nscd-2.12-1.149.el6_6.5.x86_64                                       5/10
  Cleanup    : glibc-devel-2.12-1.132.el6_5.2.x86_64                                6/10
  Cleanup    : glibc-headers-2.12-1.132.el6_5.2.x86_64                              7/10
  Cleanup    : nscd-2.12-1.132.el6_5.2.x86_64                                       8/10
  Cleanup    : glibc-common-2.12-1.132.el6_5.2.x86_64                               9/10
  Cleanup    : glibc-2.12-1.132.el6_5.2.x86_64                                     10/10
  Verifying  : nscd-2.12-1.149.el6_6.5.x86_64                                       1/10
  Verifying  : glibc-common-2.12-1.149.el6_6.5.x86_64                               2/10
  Verifying  : glibc-devel-2.12-1.149.el6_6.5.x86_64                                3/10
  Verifying  : glibc-headers-2.12-1.149.el6_6.5.x86_64                              4/10
  Verifying  : glibc-2.12-1.149.el6_6.5.x86_64                                      5/10
  Verifying  : glibc-headers-2.12-1.132.el6_5.2.x86_64                              6/10
  Verifying  : nscd-2.12-1.132.el6_5.2.x86_64                                       7/10
  Verifying  : glibc-devel-2.12-1.132.el6_5.2.x86_64                                8/10
  Verifying  : glibc-2.12-1.132.el6_5.2.x86_64                                      9/10
  Verifying  : glibc-common-2.12-1.132.el6_5.2.x86_64                              10/10

Updated:
  glibc.x86_64 0:2.12-1.149.el6_6.5                                                      

Dependency Updated:
  glibc-common.x86_64 0:2.12-1.149.el6_6.5     glibc-devel.x86_64 0:2.12-1.149.el6_6.5   
  glibc-headers.x86_64 0:2.12-1.149.el6_6.5    nscd.x86_64 0:2.12-1.149.el6_6.5         

Complete!
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com