CVE-2016-10088

HIGH7.0/ 10.0
Share:
Published: December 30, 2016 at 06:59 PM
Modified: April 12, 2025 at 10:46 AM
Source: security@debian.org

Vulnerability Description

The sg implementation in the Linux kernel through 4.9 does not properly restrict write operations in situations where the KERNEL_DS option is set, which allows local users to read or write to arbitrary kernel memory locations or cause a denial of service (use-after-free) by leveraging access to a /dev/sg device, related to block/bsg.c and drivers/scsi/sg.c. NOTE: this vulnerability exists because of an incomplete fix for CVE-2016-9576.

CVSS Metrics

Base Score
7.0
Severity
HIGH
Vector String
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H

Weaknesses (CWE)

Source: nvd@nist.gov

AI Security Analysis

01 // Technical Summary

Local privilege escalation is possible due to a flaw in the Linux kernel's SCSI generic (sg) implementation. This vulnerability allows attackers with local access to a /dev/sg device to potentially read and write arbitrary kernel memory, leading to system compromise or a denial-of-service condition.

02 // Vulnerability Mechanism

Step 1: Access the /dev/sg Device: The attacker must have local access to the target system and be able to interact with a /dev/sg device. This typically requires a user account with appropriate permissions or the ability to escalate privileges to gain access to the device.

Step 2: Craft Malicious SCSI Commands: The attacker crafts a series of malicious SCSI commands. These commands are designed to exploit the vulnerability in the sg implementation.

Step 3: Send Commands to /dev/sg: The crafted SCSI commands are sent to the /dev/sg device. This is typically done using a user-space program that interacts with the device.

Step 4: Kernel Memory Corruption: The vulnerable code in the kernel processes the malicious SCSI commands. Due to the lack of proper write restrictions, the commands can overwrite kernel memory, potentially leading to a use-after-free condition.

Step 5: Exploit Execution (Read/Write/DoS): Depending on the crafted commands and the specific memory locations overwritten, the attacker can achieve different outcomes. This could include reading sensitive kernel data, writing arbitrary data to kernel memory (potentially leading to code execution), or causing a denial-of-service (DoS) by crashing the kernel.

03 // Deep Technical Analysis

The vulnerability stems from an incomplete fix for CVE-2016-9576. The sg implementation, specifically within block/bsg.c and drivers/scsi/sg.c, fails to properly restrict write operations when the KERNEL_DS option is enabled. This allows a user-space process with access to a /dev/sg device to craft malicious SCSI commands. These commands, due to the lack of proper bounds checking or access control, can then be used to overwrite kernel memory. The root cause is a use-after-free condition, where memory is freed and then accessed again, leading to potential code execution or system instability. The incomplete fix likely missed a specific code path or condition where the write restrictions were bypassed, allowing for the exploitation of the flaw. The vulnerability is triggered by sending crafted SCSI commands through the /dev/sg device, which then interact with the kernel's SCSI subsystem in an unsafe manner.

References & Intelligence

http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=128394eff343fc6d2f32172f03e24829539c5835
Source: security@debian.org
PatchVendor Advisory
http://rhn.redhat.com/errata/RHSA-2017-0817.html
Source: security@debian.org
Third Party Advisory
http://www.openwall.com/lists/oss-security/2016/12/30/1
Source: security@debian.org
Mailing ListThird Party Advisory
http://www.securityfocus.com/bid/95169
Source: security@debian.org
Third Party AdvisoryVDB Entry
http://www.securitytracker.com/id/1037538
Source: security@debian.org
Third Party AdvisoryVDB Entry
https://access.redhat.com/errata/RHSA-2017:1842
Source: security@debian.org
Third Party Advisory
https://access.redhat.com/errata/RHSA-2017:2077
Source: security@debian.org
Third Party Advisory
https://access.redhat.com/errata/RHSA-2017:2669
Source: security@debian.org
Third Party Advisory
https://github.com/torvalds/linux/commit/128394eff343fc6d2f32172f03e24829539c5835
Source: security@debian.org
PatchVendor Advisory
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=128394eff343fc6d2f32172f03e24829539c5835
Source: af854a3a-2127-422b-91ae-364da2661108
PatchVendor Advisory
http://rhn.redhat.com/errata/RHSA-2017-0817.html
Source: af854a3a-2127-422b-91ae-364da2661108
Third Party Advisory
http://www.openwall.com/lists/oss-security/2016/12/30/1
Source: af854a3a-2127-422b-91ae-364da2661108
Mailing ListThird Party Advisory
http://www.securityfocus.com/bid/95169
Source: af854a3a-2127-422b-91ae-364da2661108
Third Party AdvisoryVDB Entry
http://www.securitytracker.com/id/1037538
Source: af854a3a-2127-422b-91ae-364da2661108
Third Party AdvisoryVDB Entry
https://access.redhat.com/errata/RHSA-2017:1842
Source: af854a3a-2127-422b-91ae-364da2661108
Third Party Advisory
https://access.redhat.com/errata/RHSA-2017:2077
Source: af854a3a-2127-422b-91ae-364da2661108
Third Party Advisory
https://access.redhat.com/errata/RHSA-2017:2669
Source: af854a3a-2127-422b-91ae-364da2661108
Third Party Advisory
https://github.com/torvalds/linux/commit/128394eff343fc6d2f32172f03e24829539c5835
Source: af854a3a-2127-422b-91ae-364da2661108
PatchVendor Advisory
CVE-2016-10088 - HIGH Severity (7) | Free CVE Database | 4nuxd