CVE-2024-42236: usb: gadget: configfs: Prevent OOB read/write in usb_string_copy()
In the Linux kernel, the following vulnerability has been resolved:
usb: gadget: configfs: Prevent OOB read/write in usb_string_copy()
Userspace provided string 's' could trivially have the length zero. Left
unchecked this will firstly result in an OOB read in the form
`if (str[0 - 1] == '\n') followed closely by an OOB write in the form
`str[0 - 1] = '\0'`.
There is already a validating check to catch strings that are too long.
Let's supply an additional check for invalid strings that are too short.
Security readout for executives and security teams
Plain-English summary
A locally authenticated user may trigger a Linux kernel memory-safety error through USB gadget configuration. An empty userspace-supplied string causes memory access immediately outside its buffer, potentially affecting confidentiality, integrity, or availability. Systems are mainly exposed when affected kernels provide untrusted users access to the relevant configfs interface.
Executive priority
Prioritize remediation on multi-user, appliance, kiosk, and embedded systems where less-trusted users can configure USB gadgets. Treat ordinary servers without accessible gadget configfs as lower immediate risk, while still applying supported kernel updates during the normal security cycle.
Technical view
The Linux USB gadget configfs function usb_string_copy() failed to reject zero-length strings. It accessed str[length-1], producing an out-of-bounds read followed by an out-of-bounds null-byte write. The upstream resolution adds a minimum-length validation check; multiple stable-kernel fix commits are cited.
Likely exposure
Exposure requires local access with low privileges and reachability of the USB gadget configfs path. Internet-facing status alone does not create direct exposure. Embedded devices and systems using configurable USB gadget functionality warrant attention. The supplied version data spans multiple kernel branches, so distribution backports must be checked rather than relying only on version numbers.
Exploitation context
The CVSS 3.1 score is 7.8 with local, low-complexity, low-privilege exploitation and no user interaction. The bundle states that this CVE is not in KEV, and the cited material does not establish active exploitation or a public weaponized exploit.
Researcher notes
The primitive is an index of negative one when length equals zero: first a read, then a null-byte write. Sources describe the defect and validation fix but do not demonstrate reliable privilege escalation, code execution, or denial of service. Branch-specific commit ancestry and distribution backports require product-level verification.
Mitigation direction
Install a vendor-supported kernel containing the applicable upstream stable fix.
Review distribution advisories because vendors may backport fixes without changing the apparent upstream version.
Prioritize systems where untrusted local users can access USB gadget configfs.
Reboot into the corrected kernel when required by the operating-system vendor.
Validation and detection
Inventory running kernel versions across Linux and embedded systems.
Identify hosts using USB gadget functionality and exposing its configfs configuration.
Check vendor package changelogs for CVE-2024-42236 or the applicable cited fix commit.
After remediation, confirm each system is running the corrected kernel, not merely storing it.
Monitor vendor guidance for branch-specific affected and fixed version boundaries.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cve · low confidence lookup
CVE-2024-42236 mapping review
Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.