Executive brief
A security vulnerability exists in sg3_utils, a set of utilities for interacting with storage devices. When a specially crafted storage device is plugged into a Linux system, it can provide a malicious name containing hidden characters that trick the system's device manager. This allows an attacker with physical access to the machine to execute unauthorized commands with the highest system privileges (root) when the device is later unplugged.
Technical details
A CRLF injection vulnerability (CWE-93) exists in the export_dev_ids() function within src/sg_inq.c of sg3_utils. When the 'sg_inq --export' command processes SCSI device identification data from VPD page 0x83, it fails to sanitize control characters in the SCSI name string and ATA subfields. An attacker presenting a crafted SCSI device can embed a newline character in these strings to inject arbitrary properties into the udev database, such as 'REMOVE_CMD'. Because default udev rules often execute 'REMOVE_CMD' when a device is removed, this enables arbitrary command execution as root. The flaw was introduced in commit c410806c and fixed in upstream PR #83.
Affected products
- doug-gilbert sg3_utils 1.34 through 1.48
- Red Hat Red Hat Enterprise Linux 7
- Red Hat Red Hat Enterprise Linux 8
- Red Hat Red Hat Enterprise Linux 9
- Red Hat Red Hat Enterprise Linux 10
Timeline
- 2012-02-23: other: Vulnerability introduced in commit c410806c
- 2026-06-06: patched: Fix submitted via upstream Pull Request #83
- 2026-07-20: disclosed: Reported to Red Hat Bugzilla
- 2026-07-28: advisory: CVE published to NVD