CVE-2021-47245 netfilter: synproxy: Fix out of bounds when parsing TCP options

High 8.2 Published Updated

An out-of-bounds read in the Linux kernel's netfilter synproxy TCP option parser can lead to denial of service or information disclosure.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2021-47245?

CVE-2021-47245 is a high-severity memory corruption vulnerability in Linux kernel, published on 21 May 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

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

netfilter: synproxy: Fix out of bounds when parsing TCP options

The TCP option parser in synproxy (synproxy_parse_options) 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 an early return when length < 0 to avoid calling skb_header_pointer with negative length.

Weakness: CWE-125

Which versions are affected by CVE-2021-47245?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2021-47245?

Apply the vendor's patch.

Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.

Is CVE-2021-47245 being exploited?

There is no known exploitation of CVE-2021-47245 in the wild and no public exploit code.

All Linux kernel vulnerabilities

Sources

Also known as DEBIAN-CVE-2021-47245, GHSA-ch44-784c-7wgq, UBUNTU-CVE-2021-47245.

Is CVE-2021-47245 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free