GNU C Library 2.19 spawn_faction_addopen.c xc_cpupool_getinfo code injection

CVSS Meta Temp Score
CVSS is a standardized scoring system to determine possibilities of attacks. The Temp Score considers temporal factors like disclosure, exploit and countermeasures. The unique Meta Score calculates the average score of different sources to provide a normalized scoring system.
Current Exploit Price (≈)
Our analysts are monitoring exploit markets and are in contact with vulnerability brokers. The range indicates the observed or calculated exploit price to be seen on exploit markets. A good indicator to understand the monetary effort required for and the popularity of an attack.
CTI Interest Score
Our Cyber Threat Intelligence team is monitoring different web sites, mailing lists, exploit markets and social media networks. The CTI Interest Score identifies the interest of attackers and the security community for this specific vulnerability in real-time. A high score indicates an elevated risk to be targeted for this vulnerability.
7.9$0-$5k0.00

Summaryinfo

A vulnerability was found in GNU C Library 2.19. It has been rated as problematic. This affects the function xc_cpupool_getinfo of the file posix/spawn_faction_addopen.c. Performing a manipulation results in code injection. This vulnerability is reported as CVE-2014-4043. Moreover, an exploit is present. Upgrading the affected component is advised.

Detailsinfo

A vulnerability was found in GNU C Library 2.19 (Software Library). It has been classified as critical. This affects the function xc_cpupool_getinfo of the file posix/spawn_faction_addopen.c. The manipulation with an unknown input leads to a code injection vulnerability. CWE is classifying the issue as CWE-94. The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. This is going to have an impact on confidentiality, integrity, and availability. The summary by CVE is:

The posix_spawn_file_actions_addopen function in glibc before 2.20 does not copy its path argument in accordance with the POSIX specification, which allows context-dependent attackers to trigger use-after-free vulnerabilities.

The issue has been introduced in 02/07/2014. The weakness was disclosed 06/11/2014 by David Reid, Alex Gaynor and and Glyph Lefkowitz as Bug 17048 as confirmed bug report (Bugzilla). It is possible to read the advisory at sourceware.org. The public release has been coordinated in cooperation with GNU. This vulnerability is uniquely identified as CVE-2014-4043 since 06/12/2014. Attacking locally is a requirement. The successful exploitation requires a authentication. Technical details and a public exploit are known. The attack technique deployed by this issue is T1059 according to MITRE ATT&CK.

A public exploit has been developed by Alex Gaynor in ANSI C and been published immediately after the advisory. The exploit is shared for download at sourceware.org. It is declared as proof-of-concept. The vulnerability was handled as a non-public zero-day exploit for at least 124 days. During that time the estimated underground price was around $0-$5k. The vulnerability scanner Nessus provides a plugin with the ID 76604 (SuSE 11.3 Security Update : glibc (SAT Patch Number 9477)), which helps to determine the existence of the flaw in a target environment. It is assigned to the family SuSE Local Security Checks. The commercial vulnerability scanner Qualys is able to test this issue with plugin 195576 (Ubuntu Security Notification for Eglibc Vulnerabilities (USN-2306-1)). The code used by the exploit is:

int main() {
    int res;
    posix_spawn_file_actions_t fa;
    posix_spawn_file_actions_init(&fa);

    char *orig_path = "/tmp/afddsa";
    char *path = malloc(strlen(orig_path) + 1);
    strcpy(path, orig_path);
    path[strlen(orig_path)] = '\0';

    res = posix_spawn_file_actions_addopen(
        &fa, 1, path, O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR);
    assert(res == 0);

    memset(path, 0, strlen(orig_path));
    free(path);

    char *argv[] = {"/bin/echo", NULL};
    pid_t pid;
    res = posix_spawn(
        &pid,
        "/bin/echo",
        &fa,
        NULL,
        argv,
        environ
    );
    assert(res == 0);
    int status;
    wait4(pid, &status, 0, NULL);
    printf("%d\n", WEXITSTATUS(status));
}

Upgrading to version 2.20 eliminates this vulnerability. Applying a patch is able to eliminate this problem. The bugfix is ready for download at sourceware.org. The best possible mitigation is suggested to be upgrading to the latest version. The vulnerability will be addressed with the following lines of code:

#include <string.h>

The vulnerability is also documented in the databases at X-Force (93784), Tenable (76604), SecurityFocus (BID 68006†), Secunia (SA58697†) and Vulnerability Center (SBV-45742†). Further details are available at seclists.org. The entries VDB-67049 and VDB-67286 are pretty similar. Statistical analysis made it clear that VulDB provides the best quality for vulnerability data.

Productinfo

Type

Vendor

Name

Version

License

Website

CPE 2.3info

CPE 2.2info

CVSSv4info

VulDB Vector: 🔍
VulDB Reliability: 🔍

CVSSv3info

VulDB Meta Base Score: 8.8
VulDB Meta Temp Score: 7.9

VulDB Base Score: 8.8
VulDB Temp Score: 7.9
VulDB Vector: 🔍
VulDB Reliability: 🔍

CVSSv2info

AVACAuCIA
💳💳💳💳💳💳
💳💳💳💳💳💳
💳💳💳💳💳💳
VectorComplexityAuthenticationConfidentialityIntegrityAvailability
UnlockUnlockUnlockUnlockUnlockUnlock
UnlockUnlockUnlockUnlockUnlockUnlock
UnlockUnlockUnlockUnlockUnlockUnlock

VulDB Base Score: 🔍
VulDB Temp Score: 🔍
VulDB Reliability: 🔍

NVD Base Score: 🔍

Exploitinginfo

Class: Code injection
CWE: CWE-94 / CWE-74 / CWE-707
CAPEC: 🔍
ATT&CK: 🔍

Physical: Partially
Local: Yes
Remote: Yes

Availability: 🔍
Access: Public
Status: Proof-of-Concept
Author: Alex Gaynor
Programming Language: 🔍
Download: 🔍

EPSS Score: 🔍
EPSS Percentile: 🔍

Price Prediction: 🔍
Current Price Estimation: 🔍

0-DayUnlockUnlockUnlockUnlock
TodayUnlockUnlockUnlockUnlock

Nessus ID: 76604
Nessus Name: SuSE 11.3 Security Update : glibc (SAT Patch Number 9477)
Nessus File: 🔍
Nessus Risk: 🔍
Nessus Family: 🔍
Nessus Port: 🔍

OpenVAS ID: 703169
OpenVAS Name: Debian Security Advisory DSA 3169-1 (eglibc - security update)
OpenVAS File: 🔍
OpenVAS Family: 🔍

Qualys ID: 🔍
Qualys Name: 🔍

Threat Intelligenceinfo

Interest: 🔍
Active Actors: 🔍
Active APT Groups: 🔍

Countermeasuresinfo

Recommended: Upgrade
Status: 🔍

0-Day Time: 🔍
Exploit Delay Time: 🔍

Upgrade: C Library 2.20
Patch: sourceware.org

Timelineinfo

02/07/2014 🔍
06/11/2014 +124 days 🔍
06/11/2014 +0 days 🔍
06/11/2014 +0 days 🔍
06/12/2014 +1 days 🔍
06/13/2014 +1 days 🔍
06/13/2014 +0 days 🔍
06/13/2014 +0 days 🔍
07/20/2014 +37 days 🔍
08/11/2014 +22 days 🔍
10/06/2014 +56 days 🔍
06/22/2021 +2451 days 🔍

Sourcesinfo

Vendor: gnu.org

Advisory: Bug 17048
Researcher: David Reid, Alex Gaynor, and Glyph Lefkowitz
Status: Confirmed
Confirmation: 🔍
Coordinated: 🔍

CVE: CVE-2014-4043 (🔍)
GCVE (CVE): GCVE-0-2014-4043
GCVE (VulDB): GCVE-100-13587

OVAL: 🔍

X-Force: 93784 - GNU C Library posix_spawn_file_actions_addopen code execution, High Risk
SecurityFocus: 68006 - GNU glibc 'xc_cpupool_getinfo()' Function Use After Free Memory Corruption Vulnerability
Secunia: 58697 - GNU C Library "posix_spawn_file_actions_addopen()" Denial of Service Vulnerabili, Less Critical
Vulnerability Center: 45742 - GNU C Library Remote Code Execution due to a Use After Free Error in \x27posix_spawn_file_actions_addopen\x27, High

scip Labs: https://www.scip.ch/en/?labs.20161013
Misc.: 🔍
See also: 🔍

Entryinfo

Created: 06/13/2014 15:04
Updated: 06/22/2021 20:43
Changes: 06/13/2014 15:04 (94), 06/04/2017 10:36 (7), 06/22/2021 20:43 (3)
Complete: 🔍
Cache ID: 216:5B6:103

Discussion

No comments yet. Languages: en.

Please log in to comment.

Want to stay up to date on a daily basis?

Enable the mail alert feature now!