CVE-2023-52881
tcp: do not accept ACK of bytes we never sent
Check your servers for CVE-2023-52881
The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2023-52881 affects the running kernel, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.
Description
In the Linux kernel, the following vulnerability has been resolved:
tcp: do not accept ACK of bytes we never sent
This patch is based on a detailed report and ideas from Yepeng Pan and Christian Rossow.
ACK seq validation is currently following RFC 5961 5.2 guidelines:
The ACK value is considered acceptable only if it is in the range of ((SND.UNA - MAX.SND.WND) <= SEG.ACK <= SND.NXT). All incoming segments whose ACK value doesn't satisfy the above condition MUST be discarded and an ACK sent back. It needs to be noted that RFC 793 on page 72 (fifth check) says: "If the ACK is a duplicate (SEG.ACK < SND.UNA), it can be ignored. If the ACK acknowledges something not yet sent (SEG.ACK > SND.NXT) then send an ACK, drop the segment, and return". The "ignored" above implies that the processing of the incoming data segment continues, which means the ACK value is treated as acceptable. This mitigation makes the ACK check more stringent since any ACK < SND.UNA wouldn't be accepted, instead only ACKs that are in the range ((SND.UNA - MAX.SND.WND) <= SEG.ACK <= SND.NXT) get through.
This can be refined for new (and possibly spoofed) flows, by not accepting ACK for bytes that were never sent.
This greatly improves TCP security at a little cost.
I added a Fixes: tag to make sure this patch will reach stable trees, even if the 'blamed' patch was adhering to the RFC.
tp->bytes_acked was added in linux-4.2
Following packetdrill test (courtesy of Yepeng Pan) shows the issue at hand:
0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3 +0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0 +0 bind(3, ..., ...) = 0 +0 listen(3, 1024) = 0
// ---------------- Handshake ------------------- //
// when window scale is set to 14 the window size can be extended to // 65535 * (2^14) = 1073725440. Linux would accept an ACK packet // with ack number in (Server_ISN+1-1073725440. Server_ISN+1) // ,though this ack number acknowledges some data never // sent by the server.
+0 < S 0:0(0) win 65535 <mss 1400,nop,wscale 14> +0 > S. 0:0(0) ack 1 <...> +0 < . 1:1(0) ack 1 win 65535 +0 accept(3, ..., ...) = 4
// For the established connection, we send an ACK packet, // the ack packet uses ack number 1 - 1073725300 + 2^32, // where 2^32 is used to wrap around. // Note: we used 1073725300 instead of 1073725440 to avoid possible // edge cases. // 1 - 1073725300 + 2^32 = 3221241997
// Oops, old kernels happily accept this packet. +0 < . 1:1001(1000) ack 3221241997 win 65535
// After the kernel fix the following will be replaced by a challenge ACK, // and prior malicious frame would be dropped. +0 > . 1:1(0) ack 1001
Severity (CVSS)
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- Attack vector
- network: an attacker can reach the vulnerable part over the network, often from the internet
- Attack complexity
- low: an attack works without special conditions
- Privileges required
- none: the attacker does not need an account
- User interaction
- none: nobody has to click or open anything
- Scope
- unchanged: the damage stays inside the vulnerable component
- Impact
- confidentiality high, integrity high, availability high: what an attacker can read (confidentiality), change (integrity) or stop (availability)
Exploitation
EPSS 0.61%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 50.5% of all scored CVEs. Scores of 1 Dec 2026.
The assessment of CISA (SSVC, 3 Jun 2024):
- Exploitation
- none: CISA did not find evidence of exploitation or a public proof of concept
- Automatable
- no: each attack takes manual steps
- Technical impact
- partial: limited control or limited data
Affected products
As the CNA lists them.
| Product | Versions |
|---|---|
| Linux |
affected from 354e4aa391ed50a4d827ff6fc11e0667d0859b25, before 69eae75ca5255e876628ac5cee9eaab31f644b57 affected from 354e4aa391ed50a4d827ff6fc11e0667d0859b25, before 458f07ffeccd17f99942311e09ef574ddf4a414a affected from 354e4aa391ed50a4d827ff6fc11e0667d0859b25, before 7ffff0cc929fdfc62a74b384c4903d6496c910f0 affected from 354e4aa391ed50a4d827ff6fc11e0667d0859b25, before b17a886ed29f3b70b78ccf632dad03e0c69e3c1a affected from 354e4aa391ed50a4d827ff6fc11e0667d0859b25, before 0d4e0afdd6658cd21dd5be61880411a2553fd1fc affected from 354e4aa391ed50a4d827ff6fc11e0667d0859b25, before 008b807fe487e0b15a3a6c39add4eb477f73e440 affected from 354e4aa391ed50a4d827ff6fc11e0667d0859b25, before 2087d53a66e97a5eb5d1bf558d5bef9e5f891757 affected from 354e4aa391ed50a4d827ff6fc11e0667d0859b25, before 3d501dd326fb1c73f1b8206d4c6e1d7b15c07e27 affected 8d15569e14cfcf9151e9e3b4c0cb98369943a2bb affected e252bbd8c87b95e9cecdc01350fbb0b46a0f9bf1 affected 2ee4432e82437a7c051c254b065fbf5d4581e1a3 affected from 3.0.58, before 3.1 affected from 3.2.37, before 3.3 affected from 3.4.25, before 3.5
Other versions: unaffected
|
| Linux |
affected 3.8 unaffected before 3.8 unaffected from 4.14.333 up to and including 4.14.* unaffected from 4.19.302 up to and including 4.19.* unaffected from 5.4.264 up to and including 5.4.* unaffected from 5.10.204 up to and including 5.10.* unaffected from 5.15.143 up to and including 5.15.* unaffected from 6.1.68 up to and including 6.1.* unaffected from 6.6.7 up to and including 6.6.* unaffected 6.7 and later
Other versions: affected
|
Is my server affected?
This CVE is in the Linux kernel. Compare the running kernel with the fixed kernel version of your distribution, and reboot after a kernel update:
uname -r
# Debian, Ubuntu: does the changelog of the running kernel name the CVE?
zgrep -l CVE-2023-52881 /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz
# RHEL, Rocky, Alma
rpm -q --changelog kernel | grep CVE-2023-52881
With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:
trivy rootfs --scanners vuln / | grep CVE-2023-52881
trivy image --scanners vuln IMAGE | grep CVE-2023-52881
Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.
References
Other references
- https://git.kernel.org/stable/c/69eae75ca5255e876628ac5cee9eaab31f644b57 git.kernel.org
- https://git.kernel.org/stable/c/458f07ffeccd17f99942311e09ef574ddf4a414a git.kernel.org
- https://git.kernel.org/stable/c/7ffff0cc929fdfc62a74b384c4903d6496c910f0 git.kernel.org
- https://git.kernel.org/stable/c/b17a886ed29f3b70b78ccf632dad03e0c69e3c1a git.kernel.org
- https://git.kernel.org/stable/c/0d4e0afdd6658cd21dd5be61880411a2553fd1fc git.kernel.org
- https://git.kernel.org/stable/c/008b807fe487e0b15a3a6c39add4eb477f73e440 git.kernel.org
- https://git.kernel.org/stable/c/2087d53a66e97a5eb5d1bf558d5bef9e5f891757 git.kernel.org
- https://git.kernel.org/stable/c/3d501dd326fb1c73f1b8206d4c6e1d7b15c07e27 git.kernel.org
Source: the record CVE-2023-52881 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse