# CVE-2024-42236: usb: gadget: configfs: Prevent OOB read/write in usb_string_copy()

- Severity: High 7.8 (CVSS:3.1, scored by Linux) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.24%, higher than 16% of CVEs (2026-12-01)
- Published: 2024-08-07T15:14:25.642Z
- Modified: 2026-08-05T11:36:01.503Z
- Weaknesses: CWE-787
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: Linux

## Description

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.

(As written by CVE List.)

## Affected

- Linux Linux: from 88af8bbe4ef781031ad3370847553f3b42ba0076 before a444c3fc264119801575ab086e03fb4952f23fd0; from 88af8bbe4ef781031ad3370847553f3b42ba0076 before c95fbdde87e39e5e0ae27f28bf6711edfb985caa; from 88af8bbe4ef781031ad3370847553f3b42ba0076 before e8474a10c535e6a2024c3b06e37e4a3a23beb490; from 88af8bbe4ef781031ad3370847553f3b42ba0076 before 72b8ee0d9826e8ed00e0bdfce3e46b98419b37ce; from 88af8bbe4ef781031ad3370847553f3b42ba0076 before 2d16f63d8030903e5031853e79d731ee5d474e70; from 88af8bbe4ef781031ad3370847553f3b42ba0076 before d1205033e912f9332c1dbefa812e6ceb0575ce0a; from 88af8bbe4ef781031ad3370847553f3b42ba0076 before eecfefad0953b2f31aaefa058f7f348ff39c4bba; from 88af8bbe4ef781031ad3370847553f3b42ba0076 before 6d3c721e686ea6c59e18289b400cc95c76e927e0; 3.10 (not affected: before 3.10; from 4.19.318 up to 4.19.*; from 5.4.280 up to 5.4.*; from 5.10.222 up to 5.10.*; from 5.15.163 up to 5.15.*; from 6.1.100 up to 6.1.*; from 6.6.41 up to 6.6.*; from 6.9.10 up to 6.9.*; from 6.10 up to *)
- linux linux_kernel: before 4.19.318; from 4.20 before 5.4.280; from 5.5 before 5.10.222; from 5.11 before 5.15.163; from 5.16 before 6.1.100; from 6.2 before 6.6.41; from 6.7 before 6.9.10

## Every score

- Linux: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:3.1 5.5 Medium `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`

## References

- <https://git.kernel.org/stable/c/a444c3fc264119801575ab086e03fb4952f23fd0> (patch)
- <https://git.kernel.org/stable/c/c95fbdde87e39e5e0ae27f28bf6711edfb985caa> (patch)
- <https://git.kernel.org/stable/c/e8474a10c535e6a2024c3b06e37e4a3a23beb490> (patch)
- <https://git.kernel.org/stable/c/72b8ee0d9826e8ed00e0bdfce3e46b98419b37ce> (patch)
- <https://git.kernel.org/stable/c/2d16f63d8030903e5031853e79d731ee5d474e70> (patch)
- <https://git.kernel.org/stable/c/d1205033e912f9332c1dbefa812e6ceb0575ce0a> (patch)
- <https://git.kernel.org/stable/c/eecfefad0953b2f31aaefa058f7f348ff39c4bba> (patch)
- <https://git.kernel.org/stable/c/6d3c721e686ea6c59e18289b400cc95c76e927e0> (patch)
- <https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html>

## Sources

- CVE List: [CVE-2024-42236](https://www.cve.org/CVERecord?id=CVE-2024-42236), CVE Terms of Use, modified 2026-08-05
- NVD: [CVE-2024-42236](https://nvd.nist.gov/vuln/detail/CVE-2024-42236), Public domain, modified 2026-08-04

---

Page: https://cve.day/CVE-2024-42236 · Whole record: https://cve.day/CVE-2024-42236.json · Rebuilt by cve.day 2026-11-25T22:58:44.104Z
