
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2026-16313 is a CRLF injection vulnerability in sg3_utils that allows an attacker with physical access to execute arbitrary commands as root by presenting a crafted SCSI/USB device. The flaw exists in the sg_inq command's --export option, which outputs SCSI device identification data from VPD page 0x83 without sanitizing control characters in name string fields. Affected versions are sg3_utils 1.34 through 1.48; version 1.49 and Red Hat-patched packages (sg3_utils-1.47-10.el9_8.1 for RHEL 9, sg3_utils-1.48-7.el10_2.1 for RHEL 10) are unaffected. The vulnerability was disclosed on July 28, 2026, and carries a CVSS v3.1 base score of 7.6 (High) (Red Hat CVE, Github Advisory).
The root cause is CWE-93 (Improper Neutralization of CRLF Sequences), introduced in commit c410806c (2012-02-23) within the export_dev_ids() function in src/sg_inq.c. When sg_inq --export processes SCSI device identification data, the SCSI name string designator (type 8, VPD page 0x83) and the ATA T10 vendor-ID subfield are printed using printf("%.*s") without sanitizing embedded control characters. An attacker can embed a newline character in a device-controlled name string, splitting the KEY=VALUE udev output into two lines and injecting an arbitrary udev property — most critically REMOVE_CMD. On systems where default udev rules (e.g., 50-udev-default.rules) invoke sg_inq --export for SCSI device identification and execute REMOVE_CMD on device removal, disconnecting the crafted device triggers root command execution. The upstream fix applies udev-conforming character escaping to the affected fields, matching encoding already used for designator types 0 and 1 (Red Hat CVE, Red Hat Bugzilla, sg3_utils PR#83).
Successful exploitation grants an attacker full root-level command execution on the affected Linux host, resulting in complete compromise of confidentiality, integrity, and availability. Because the injected REMOVE_CMD udev property executes as root when the device is disconnected, the attacker can run arbitrary system commands, install backdoors, exfiltrate sensitive data, or disrupt system availability. The scope is marked as "Changed" in CVSS, reflecting that the vulnerability in sg3_utils impacts the broader system via the udev subsystem (Red Hat CVE, Github Advisory).
REMOVE_CMD=/path/to/malicious_script.sg_inq --export.sg_inq --export on the new device. The unsanitized output splits into multiple lines due to the embedded newline, injecting the attacker-controlled REMOVE_CMD property into the udev device database.50-udev-default.rules reads the REMOVE_CMD property and executes it as root, running the attacker's arbitrary command (e.g., a reverse shell, credential dumper, or persistence mechanism) (Red Hat CVE, Red Hat Bugzilla)./var/log/udev or journalctl -u systemd-udevd) showing REMOVE_CMD properties being set for SCSI/USB devices; sg_inq --export output containing multi-line entries or unexpected KEY=VALUE pairs beyond standard device identifiers./tmp, /dev/shm) that may have been placed by a REMOVE_CMD payload; new cron jobs, systemd units, or SSH authorized keys added around the time of device connection/disconnection events.udevd or as root at the time of device removal (e.g., bash, curl, wget, nc, python) visible in process audit logs (auditd) or ps snapshots.Preferred remediation: Update sg3_utils to a patched version — Red Hat has released RHSA-2026:50141 (sg3_utils-1.47-10.el9_8.1 for RHEL 9) and RHSA-2026:50142 (sg3_utils-1.48-7.el10_2.1 for RHEL 10). Upstream sg3_utils version 1.49 also includes the fix via PR #83 (RHSA-2026:50141, sg3_utils PR#83).
Workarounds (if patching is not immediately possible):
REMOVE_CMD rule from /lib/udev/rules.d/50-udev-default.rules to prevent command execution on device removal.sg_inq --export on device connection.Red Hat rated this vulnerability as "Important" severity and issued security advisories for RHEL 9 and RHEL 10 on August 4, 2026 (RHSA-2026:50141). The upstream reporter is credited as Shaomin Chen, and the fix was contributed by Paul Evans via GitHub PR #83, which was accepted and merged by the sg3_utils maintainer (sg3_utils PR#83). The NixOS community also responded promptly, merging an update to sg3_utils 1.49 in nixpkgs to address the CVE. OpenSUSE similarly backported the fix to their sg3_utils package shortly after the upstream fix was published.
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."