
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2021-39685 is a buffer overflow vulnerability discovered in the Linux kernel's USB Gadget subsystem. The vulnerability was identified by Szymon Heidrich and disclosed in December 2021. The issue affects various setup methods of the USB gadget subsystem, where an incorrect flag check could lead to an out-of-bounds write. The vulnerability impacts multiple USB gadget types including rndis, hid, uac1, uac1_legacy, and uac2 (Openwall).
The vulnerability stems from improper handling of control request lengths (wLength) in USB gadget handlers. The buffer used by endpoint 0 is allocated in composite.c with a size of USBCOMPEP0BUFSIZ (4096) bytes, but the implementation fails to properly restrict the size of control requests. This allows an attacker to set wLength to a value greater than USBCOMPEP0BUFSIZ, resulting in a buffer overflow. The vulnerability has been assigned a CVSS v3.1 base score of 7.8 (High) with vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H (NVD).
The vulnerability allows a local attacker to read and/or write up to 65kB of kernel memory past buffer boundaries. This can lead to information disclosure, denial of service (system crash), or potentially arbitrary code execution in kernel context. No additional execution privileges are needed, and user interaction is not required for exploitation (Openwall, Ubuntu).
The vulnerability was patched by limiting the transfer phase size to min(len, buffer_size) in affected control request handlers to prevent buffer overflow. The fix was merged into the main Linux kernel tree on December 12, 2021. Various Linux distributions have released security updates to address this vulnerability, including Ubuntu which has provided fixes for multiple kernel versions across different releases (Ubuntu).
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."