# CVE-2021-47243: sch_cake: Fix out of bounds when parsing TCP options and header

- Severity: High 7.1 (CVSS:3.1, scored by Linux) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/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.26%, higher than 19% of CVEs (2026-12-01)
- Published: 2024-05-21T14:19:42.309Z
- Modified: 2026-08-05T08:46:54.221Z
- Weaknesses: CWE-125
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: Linux

## Description

In the Linux kernel, the following vulnerability has been resolved:

sch_cake: Fix out of bounds when parsing TCP options and header

The TCP option parser in cake qdisc (cake_get_tcpopt and
cake_tcph_may_drop) could read one byte out of bounds. When the length
is 1, the execution flow gets into the loop, reads one byte of the
opcode, and if the opcode is neither TCPOPT_EOL nor TCPOPT_NOP, it reads
one more byte, which exceeds the length of 1.

This fix is inspired by commit 9609dad263f8 ("ipv4: tcp_input: fix stack
out of bounds when parsing TCP options.").

v2 changes:

Added doff validation in cake_get_tcphdr to avoid parsing garbage as TCP
header. Although it wasn't strictly an out-of-bounds access (memory was
allocated), garbage values could be read where CAKE expected the TCP
header if doff was smaller than 5.

(As written by CVE List.)

## Affected

- Linux Linux: from 8b7138814f29933898ecd31dfc83e35a30ee69f5 before 595897ef118d6fe66690c4fc5b572028c9da95b7; from 8b7138814f29933898ecd31dfc83e35a30ee69f5 before 4cefa061fc63f4d2dff5ab4083f43857cd7a2335; from 8b7138814f29933898ecd31dfc83e35a30ee69f5 before 3b491dd593d582ceeb27aa617600712a6bd14246; from 8b7138814f29933898ecd31dfc83e35a30ee69f5 before 3371392c60e2685af30bd4547badd880f5df2b3f; from 8b7138814f29933898ecd31dfc83e35a30ee69f5 before ba91c49dedbde758ba0b72f57ac90b06ddf8e548; 4.19 (not affected: before 4.19; from 4.19.196 up to 4.19.*; from 5.4.128 up to 5.4.*; from 5.10.46 up to 5.10.*; from 5.12.13 up to 5.12.*; from 5.13 up to *)
- linux linux_kernel: from 4.19 before 4.19.196; from 4.20 before 5.4.128; from 5.5 before 5.10.46; from 5.11 before 5.12.13; 5.13

## Every score

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

## References

- <https://git.kernel.org/stable/c/595897ef118d6fe66690c4fc5b572028c9da95b7> (patch)
- <https://git.kernel.org/stable/c/4cefa061fc63f4d2dff5ab4083f43857cd7a2335> (patch)
- <https://git.kernel.org/stable/c/3b491dd593d582ceeb27aa617600712a6bd14246> (patch)
- <https://git.kernel.org/stable/c/3371392c60e2685af30bd4547badd880f5df2b3f> (patch)
- <https://git.kernel.org/stable/c/ba91c49dedbde758ba0b72f57ac90b06ddf8e548> (patch)

## Sources

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

---

Page: https://cve.day/CVE-2021-47243 · Whole record: https://cve.day/CVE-2021-47243.json · Rebuilt by cve.day 2026-11-25T22:58:08.753Z
