Menu

Star on GitHub · 3.2k

CVE-2024-36904

7.8 · HIGH

In the Linux kernel, the following vulnerability has been resolved: tcp: Use refcount_inc_not_zero() in tcp_twsk_unique().

Published May 30, 2024CWE-416EPSS 0.61%

Overview

CVE-2024-36904 is a high-severity vulnerability. It was published on May 30, 2024 and has a CVSS 3.1 base score of 7.8 (HIGH).

This vulnerability has a CVSS 3.1 base score of 7.8, rated HIGH. It requires local or adjacent network access to exploit. Some level of privileges is required for exploitation.

Technical description

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

tcp: Use refcount_inc_not_zero() in tcp_twsk_unique().

Anderson Nascimento reported a use-after-free splat in tcp_twsk_unique()

with nice analysis.

Since commit ec94c2696f0b ("tcp/dccp: avoid one atomic operation for

timewait hashdance"), inet_twsk_hashdance() sets TIME-WAIT socket's

sk_refcnt after putting it into ehash and releasing the bucket lock.

Thus, there is a small race window where other threads could try to

reuse the port during connect() and call sock_hold() in tcp_twsk_unique()

for the TIME-WAIT socket with zero refcnt.

If that happens, the refcnt taken by tcp_twsk_unique() is overwritten

and sock_put() will cause underflow, triggering a real use-after-free

somewhere else.

To avoid the use-after-free, we need to use refcount_inc_not_zero() in

tcp_twsk_unique() and give up on reusing the port if it returns false.

[0]:

refcount_t: addition on 0; use-after-free.

WARNING: CPU: 0 PID: 1039313 at lib/refc

Remediation

Check the references section for vendor advisories, patches, and mitigation guidance. If immediate patching is not possible, review the CVSS vector to understand the attack surface and apply compensating controls such as network segmentation or access restrictions.

Frequently asked questions

What is CVE-2024-36904?

CVE-2024-36904 is a high-severity vulnerability. It was published on May 30, 2024 and has a CVSS 3.1 base score of 7.8 (HIGH).

How severe is CVE-2024-36904?

This vulnerability has a CVSS 3.1 base score of 7.8, rated HIGH. It requires local or adjacent network access to exploit. Some level of privileges is required for exploitation.

How do I fix or remediate CVE-2024-36904?

Check the references section for vendor advisories, patches, and mitigation guidance. If immediate patching is not possible, review the CVSS vector to understand the attack surface and apply compensating controls such as network segmentation or access restrictions.

How can CyberStrike help with CVE-2024-36904?

CyberStrike is an open-source, AI-augmented pentesting engine. Rather than flag a version number, it tests whether an issue like CVE-2024-36904 is actually reachable in your own applications and APIs, then verifies each finding before reporting it. That tells you if the weakness is a real, exploitable risk in your environment or a false positive you can safely deprioritize.

Related HIGH CVEs from 2024

View all