Skip to main content

CVE-2023-52881: Vulnerability in Linux Linux

High
VulnerabilityCVE-2023-52881cvecve-2023-52881
Published: Wed May 29 2024 (05/29/2024, 10:15:14 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

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

AI-Powered Analysis

AILast updated: 06/28/2025, 01:41:48 UTC

Technical Analysis

CVE-2023-52881 addresses a vulnerability in the Linux kernel's TCP stack related to the validation of TCP ACK sequence numbers. The Linux kernel implements TCP ACK validation based on RFC 5961 section 5.2, which restricts acceptable ACK numbers to a range between (SND.UNA - MAX.SND.WND) and SND.NXT, where SND.UNA is the oldest unacknowledged sequence number, MAX.SND.WND is the maximum send window, and SND.NXT is the next sequence number to be sent. However, the previous implementation allowed acceptance of ACK numbers that acknowledged bytes never sent by the server, especially when large window scaling factors were used (e.g., window scale of 14, which can extend the window size to over 1 billion bytes). This flaw permitted an attacker to send spoofed ACK packets with sequence numbers that fell outside the legitimate range but were still accepted by the kernel, potentially disrupting TCP connection state or enabling denial-of-service (DoS) attacks. The patch refines the ACK validation logic to reject any ACK that acknowledges bytes never sent, tightening the acceptance criteria beyond the RFC guidelines. This change prevents acceptance of spoofed ACKs with invalid sequence numbers by responding with challenge ACKs and dropping malicious packets. The fix was backported to stable kernel trees to ensure broad coverage. The vulnerability was demonstrated using packetdrill tests, showing that prior to the fix, the kernel accepted an ACK with an invalid sequence number due to window scaling, while the patched kernel correctly rejected it. This vulnerability affects multiple Linux kernel versions identified by specific commit hashes and is relevant to all Linux systems using affected kernel versions with TCP enabled. No known exploits are currently reported in the wild, but the vulnerability poses a risk due to its potential to disrupt TCP communications and enable spoofing attacks.

Potential Impact

For European organizations, this vulnerability could have significant impact given the widespread use of Linux-based systems in servers, cloud infrastructure, and network devices. Exploitation could allow attackers to disrupt TCP connections by injecting spoofed ACK packets, potentially causing denial of service or connection instability. This could affect critical services such as web servers, database servers, and internal communication systems relying on TCP. In high-availability environments, such disruptions could lead to service outages, impacting business operations and customer trust. Additionally, attackers might leverage this flaw to bypass certain TCP-based security controls or to facilitate more complex attacks involving TCP session manipulation. Although no active exploits are known, the vulnerability's presence in widely deployed kernels means that unpatched systems remain at risk. European organizations with large-scale Linux deployments, especially those using high window scaling factors for performance optimization, are particularly vulnerable. This includes cloud service providers, telecommunications infrastructure, and enterprises with Linux-based network appliances. The vulnerability's exploitation could also have cascading effects on supply chains and critical infrastructure relying on stable TCP communications.

Mitigation Recommendations

European organizations should prioritize patching affected Linux kernel versions with the updates that implement the refined ACK validation logic. Specifically, they should: 1) Identify all Linux systems running affected kernel versions using the provided commit hashes or kernel version mappings. 2) Apply the official Linux kernel patches or upgrade to the latest stable kernel releases that include the fix for CVE-2023-52881. 3) For systems where immediate patching is not feasible, implement network-level mitigations such as ingress filtering to block spoofed packets and deploy TCP anomaly detection tools that can identify and drop suspicious ACK packets with invalid sequence numbers. 4) Review and adjust TCP window scaling configurations if possible to minimize exposure, although this is a temporary measure and not a substitute for patching. 5) Monitor network traffic for unusual TCP ACK patterns indicative of attempted exploitation. 6) Coordinate with cloud and infrastructure providers to ensure underlying platforms are patched. 7) Incorporate this vulnerability into incident response and vulnerability management workflows to ensure timely detection and remediation. These steps go beyond generic advice by focusing on kernel patching, network filtering, and configuration adjustments tailored to the nature of the vulnerability.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-05-21T15:35:00.781Z
Cisa Enriched
true
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9821c4522896dcbdd875

Added to database: 5/21/2025, 9:08:49 AM

Last enriched: 6/28/2025, 1:41:48 AM

Last updated: 7/28/2025, 11:12:19 AM

Views: 8

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats