Fact-checked by Grok 2 weeks ago

SYN cookies

SYN cookies are a cryptographic technique employed in the Transmission Control Protocol () to mitigate denial-of-service () attacks, where an attacker overwhelms a with spoofed SYN packets, causing resource exhaustion from half-open connections. By encoding essential connection state information—such as the (), a counter, and the client- /port tuple—directly into the initial sequence number (ISN) of the SYN-ACK response, the avoids allocating a full Transmission Control Block (TCB) or other resources until a valid packet is received from the client. This stateless approach during the initial handshake phase ensures that legitimate connections can still be established even under heavy attack loads. The concept of SYN cookies was proposed by on September 16, 1996, shortly after a attack disrupted the Panix ISP on September 6, 1996, highlighting the vulnerability in TCP's three-way . In operation, upon receiving a SYN packet, the server computes a 32-bit cookie value using a secret cryptographic hash (typically MD5 or similar) of the connection details XORed with the client's SYN sequence number, which serves as the ISN in the SYN-ACK. If the client responds with an ACK containing the expected sequence number (client's SYN sequence plus one), the server recomputes the cookie to verify it and only then allocates resources to complete the handshake; invalid ACKs are discarded without state commitment. This method supports a limited set of MSS values (eight predefined options) and relies on a 64-second counter to handle timing, ensuring replay protection through the hash's dependency on current time. SYN cookies offer significant advantages in , as they prevent the of half-open connections from filling up, allowing servers to maintain service availability without dropping legitimate s. However, they introduce computational overhead from hash calculations on every and , and they are incompatible with certain extensions, such as window (per RFC 1323), selective acknowledgments (), and timestamps, unless modified implementations encode additional state (e.g., using unused timestamp bits in ). They also do not support in packets ( with ) and can be vulnerable to exhaustion if an attacker guesses valid cookies through brute-force forgery, though this requires substantial effort. The first implementation of SYN cookies was released for in October 1996, followed by inclusion in kernels in February 1997, and starting with version 4.4 in 2002, often enabled dynamically when SYN queue limits are reached or via administrative configuration. While not standardized in an as a protocol extension, SYN cookies conform to specifications ( 793) and are described as a common in 4987, which outlines their role alongside other defenses like SYN caches and . Modern operating systems, including various variants, continue to support SYN cookies as a lightweight, stateless countermeasure against SYN floods, though they are typically used in conjunction with firewalls and intrusion detection systems for comprehensive protection.

Background

TCP Three-Way Handshake

The establishes a reliable, connection-oriented between two endpoints through a process known as the three-way handshake. This mechanism synchronizes sequence numbers and confirms bidirectional reachability before data transfer begins. The handshake initiates when a client, seeking to connect to a server, sends a (synchronize) packet containing the client's initial sequence number (ISN), a randomly chosen 32-bit value that marks the starting point of the client's byte stream. The server, upon receiving the SYN, responds with a SYN- (synchronize-acknowledge) packet that includes its own ISN and an acknowledgment number equal to the client's ISN plus one, thereby confirming receipt of the SYN and proposing the server's starting sequence number. Finally, the client completes the handshake by sending an packet with an acknowledgment number equal to the server's ISN plus one, establishing the full-duplex connection and allowing subsequent data exchange. During this process, the maintains a connection queue, often called the SYN queue or , to store half-open connections—those that have received a SYN but await the final ACK. This queue temporarily holds state information for these pending connections, including the client's ISN and other parameters, until the completes or times out. Sequence numbers play a critical role in TCP's reliability by enabling ordered delivery, duplicate detection, and retransmission of lost segments; the ISNs established in the serve as the foundation for numbering all subsequent bytes in the . In many systems, the SYN queue is configured with a limited capacity, such as entries, to balance resource usage against expected volumes. This limitation can expose vulnerabilities like attacks, where excessive SYN packets overwhelm the queue.

SYN Flood Attacks

A attack targets the three-way by exploiting the server's for incoming requests. During the , a client sends a SYN packet to initiate a , prompting the server to allocate memory for a half-open in its backlog queue and respond with a SYN-ACK packet. An attacker floods the server with a large number of SYN packets using spoofed source IP addresses that do not respond to the SYN-ACKs, leaving the half-open connections to consume server resources until the queue fills. As the backlog overflows—typically limited to a few dozen entries on many systems—the server drops incoming legitimate SYN packets, preventing new and causing a denial of service for valid clients. This resource exhaustion does not disrupt existing or outgoing traffic but effectively renders the server unavailable for new sessions. Attacks can scale to rates of thousands of SYN packets per second, overwhelming default queue limits and timers for connection reclamation, which often range from 75 to 511 seconds. SYN floods can be direct, originating from a single attacker's , or distributed as a DDoS using botnets of compromised hosts to amplify volume from multiple sources. Amplification variants involve tricking third-party servers into reflecting SYN-ACK responses toward the victim, increasing the traffic multiplier. The vulnerability was first documented in by Cheswick and Bellovin in their analysis of weaknesses. It gained public attention in 1996 through a Phrack magazine article and was observed in real-world incidents, such as the September 1996 attack on Panix ISP's mail servers, which caused multi-day outages.

SYN Cookies Technique

Principle of Operation

SYN cookies provide a stateless mechanism for defending against attacks during the three-way , allowing s to avoid allocating resources for half-open s until a legitimate completes. In this approach, the encodes essential information—such as the client's , port, and other parameters—into the initial sequence number (ISN) of the SYN-ACK response, effectively transforming it into a "." This eliminates the need to store pending states in a SYN queue, which can otherwise be exhausted by malicious floods of SYN packets. The operational process begins when the receives a SYN packet from a client. Instead of immediately allocating memory for the in the SYN-RECEIVED , the computes a based on the incoming SYN's details and uses it as the ISN in the responding SYN-ACK packet, which is sent back without queuing the . If the client sends a valid in response, the decodes the from the ACK's acknowledgment number (which echoes the SYN-ACK's ISN) and verifies its integrity. Upon successful verification, the then allocates the necessary to complete the establishment, ensuring that only genuine handshakes consume resources. This process maintains compatibility with standard behavior for non-attack scenarios. A primary benefit of this principle is the significant reduction in usage, as the does not store half-open states—potentially thousands or more—until the full is confirmed, thereby preserving space for legitimate during resource-intensive attacks. SYN cookies are typically activated only when the SYN reaches its capacity, indicating potential overload; under normal conditions, the system reverts to stateful queuing to support features like large windows. Additionally, the inclusion of time-based components in the cookie generation, such as a or counter, prevents replay attacks by ensuring that old or captured cookies cannot be reused after a short validity window, typically on the order of minutes. The SYN cookie is encoded as a 32-bit value within the initial sequence number (ISN) of the server's SYN-ACK response, designed to embed connection state without allocating server resources. This structure typically consists of a 5-bit counter (incrementing every 64 seconds), 3 bits encoding one of eight predefined (MSS) values from a sorted table of common options, and 24 bits derived from a cryptographic to prevent forgery. The ensures time-bound validity, limiting replay attacks, while the MSS encoding allows the server to reconstruct essential parameters upon verification. Cookie generation begins with the server computing a hash over a concatenation of a server-side secret, the client IP address, client port, server IP address, server port, and a timestamp t (representing 64-second intervals). A common formulation uses MD5 for this purpose: let saddr, sport, daddr, dport denote source and destination addresses and ports, and sec1, sec2 two secret keys; let counter be the 32-bit timestamp value and x the client's SYN ISN. The value z is computed as z = \text{MD5}(sec1 || saddr || sport || daddr || dport || sec1) + x + (counter \ll 24) + \left( \text{MD5}(sec2 || counter || saddr || sport || daddr || dport || sec2) \mod 2^{24} \right). The full ISN is then \text{ISN} = (i \ll 29) + (z \mod 2^{29}), with i the 3-bit MSS index shifted left by 29 bits, ensuring the value fits TCP's 32-bit sequence space and adheres to randomness requirements for security. An alternative cryptographic primitive, such as Rijndael () applied to a 16-byte input of the same elements with a secret key, yields the initial 24 bits directly for the hash portion. Upon receiving the client's , verification recomputes the expected using the ACK's acknowledgment number (which echoes the server's ISN), the same connection tuple, and recent values (typically checking the current and previous intervals to account for ). If the recomputed matches the lower bits of the ISN (adjusted for the and MSS fields), and the is valid (not expired, e.g., within 2^5 = 32 intervals or about 34 minutes), the connection proceeds with state allocation; otherwise, the packet is discarded. This stateless check confirms the client's commitment without prior queue storage. Server-side secret key management involves periodic rotation of the keys (e.g., every few hours or ) to mitigate long-term exposure risks from potential key compromise, ensuring that even collected invalid cookies cannot be reused for forging future connections. Keys are kept constant within short windows but refreshed to security and performance. Edge cases include hash overflows or invalid MSS encodings, where the server falls back to a default MSS (e.g., 536 bytes) or drops the connection if reconstruction fails, preventing denial-of-service from malformed inputs while maintaining robustness.

Implementation

In Linux Kernel

SYN cookies were integrated into the Linux kernel starting with version 2.1.44 in 1997 as a mechanism to mitigate SYN flood attacks, with subsequent refinements enhancing its functionality across later versions. The primary control for SYN cookies in the Linux kernel is the net.ipv4.tcp_syncookies sysctl parameter, which requires the kernel to be compiled with CONFIG_SYN_COOKIES enabled. This parameter supports three settings: 0 to disable the feature entirely (the documented default), 1 to activate SYN cookies only when the SYN backlog queue overflows, and 2 to enable them unconditionally for testing purposes. When set to 1, the kernel logs messages like "Possible SYN flooding on port" upon triggering cookies, indicating potential attacks without dropping legitimate connections. Integration with the netfilter framework allows SYN cookies to be applied at the level via extensions, such as the SYNPROXY , which operates in the PREROUTING before connection tracking to proxy SYN packets and generate cookies on behalf of protected servers. Additional modules like synsanity provide high-performance, lockless SYN cookie handling within netfilter for environments facing heavy traffic. Version-specific enhancements include support for the TCP timestamps option (RFC 1323) added in kernels post-2.6.25, enabling the encoding of additional connection details into the timestamp field to preserve timing accuracy while using cookies; this was fully integrated in kernel 2.6.26 via patches that improved response times under flood conditions. SYN cookies also handle Selective Acknowledgment (SACK) options, along with window scaling and Explicit Congestion Notification (ECN), though support remains limited to these TCP extensions to avoid bloating the cookie value. For , SYN cookies interact closely with limits like net.ipv4.tcp_max_syn_backlog (default 1024 for IPv4, controlling the maximum pending SYN_RECV ) and somaxconn (default 128, capping the post-accept queue for established sockets). Exceeding tcp_max_syn_backlog triggers cookies if enabled, but increasing these values alongside tcp_synack_retries can reduce cookie usage during legitimate high-load scenarios, balancing resource consumption without relying on the fallback mechanism. As of 2025, enhancements in the Linux kernel 6.x series addressed vulnerabilities related to CALIPSO (Common Architecture for Label/IPsec Policies) extensions in SYN cookie processing, specifically fixing null pointer dereferences in calipso_req_setattr and calipso_req_delattr functions (CVE-2025-38181) by returning errors during SYN cookie scenarios to prevent uninitialized structure access and improve hash function robustness.

In Other Systems

FreeBSD introduced SYN cookies as part of its SYN cache mechanism to mitigate attacks, with the syncache implementation first appearing in FreeBSD 4.5 in 2002. The feature uses hash-based cookies generated via the parameter net.inet.tcp.syncookies, which is enabled by default (value 1) to encode connection details in the initial sequence number of SYN-ACK packets, avoiding until a valid is received. This approach mirrors the cryptographic principles of SYN cookies while integrating with FreeBSD's SYN queue management for efficient handling of half-open connections. In , SYN flood protection is provided through the TCP/IP stack's SynAttackProtect registry key, introduced in as an optional measure that dynamically adjusts thresholds based on system resources like CPU cores and memory. When enabled (Tcpip\Parameters\SynAttackProtect set to 1), it employs a lightweight SYN_TCB structure during detected attacks to verify connections without allocating full resources for uncompleted handshakes, reducing vulnerability to backlog exhaustion. Enhancements in improved SynAttackProtect integration and default enabling for better resilience against higher attack volumes, while preserving options like window scaling outside attack conditions. Cisco IOS routers address SYN floods primarily through the TCP Intercept feature rather than native cookies, but include the ip tcp synwait-time command to mitigate attacks by shortening the wait time (default 30 seconds, adjustable to 5-300) for TCP connections to complete, preventing resource tie-up from incomplete handshakes. In intercept mode, the router proxies SYN packets, validating them before forwarding to the server, effectively reducing exposure on edge devices. Cloud providers integrate SYN cookie-like protections in their load balancing services; for example, AWS Elastic Load Balancing uses a SYN proxy mechanism in AWS Shield Standard, which sends SYN cookies to challenge incoming connections and blocks floods before they reach backend instances, ensuring scalability for high-volume traffic. Similarly, Azure Load Balancer employs SYN cookies as part of its DDoS Protection Standard, applying rate limiting and cookie validation to filter malicious SYN packets at the network layer. Cross-platform web server software like and typically relies on the underlying operating system's SYN cookie implementation for TCP-level protection, without dedicated modules for cookie generation. NGINX can enhance resilience through configuration directives like worker_connections and kernel tweaks, while Apache modules such as mod_reqtimeout indirectly aid by limiting request rates, but core SYN flood mitigation defers to the host kernel's features.

Advantages and Drawbacks

Advantages

SYN cookies provide significant resource efficiency by eliminating the need for memory allocation to store state for half-open connections during the three-way . Instead of maintaining a SYN queue that can be exhausted by flood attacks, the encodes necessary connection information into a cryptographic embedded in the initial sequence number of the SYN-ACK response, allowing it to respond without reserving resources. This enables the to continue and accepting legitimate connections even under heavy conditions, preventing denial-of-service impacts on availability. The technique operates transparently to clients, requiring no modifications to client-side TCP implementations and fully complying with the TCP protocol specification. Servers using SYN cookies can interoperate seamlessly with standard TCP endpoints, as the cookie mechanism is invisible to legitimate users and only affects how the server handles potential floods internally. This ensures broad deployability without ecosystem-wide changes. SYN cookies enhance scalability against high-volume distributed denial-of-service (DDoS) attacks, with certain implementations, such as load balancers using SYN cookies, demonstrated to handle up to 10 million SYN packets per second under attack while maintaining service for legitimate traffic. By avoiding state storage, servers can scale response rates limited primarily by network and CPU capacity rather than memory constraints, making it suitable for environments facing intense flooding scenarios. The computational overhead of SYN cookies remains low, as the primary cost involves lightweight hash computations—such as or similar—for cookie generation and validation, which are far less resource-intensive than managing and timing out numerous half-open states. These operations add minimal to legitimate handshakes and are negligible compared to the benefits during attacks. Finally, SYN cookies complement other network defenses effectively, integrating well with mechanisms like SYN caches for hybrid protection or external tools such as firewalls and rate limiters to provide layered without conflicts. This modular approach allows administrators to tune defenses based on specific profiles while leveraging SYN cookies for core resilience.

Drawbacks

One significant limitation of SYN cookies is the inability to negotiate certain extensions during the when operating in cookie mode. Specifically, options such as window scaling, selective acknowledgments (), and timestamps cannot be reliably supported because the initial SYN-ACK encodes only a limited amount of state—typically just 3 bits to select from eight predefined (MSS) values—leaving no space for additional option data. This restriction can reduce connection performance by preventing optimal buffer sizing or efficient retransmission handling, particularly in high-bandwidth environments where these extensions are essential. Another drawback is the increased computational overhead imposed on the server. Generating the cookie requires hashing operations, such as , for every incoming packet, and verifying the subsequent demands recomputing this to match the initial sequence number (ISN). While modern hardware mitigates this to some extent, it still elevates CPU usage during periods when cookies are active, especially on resource-constrained devices like embedded systems or mobile gateways. This added load applies only when the queue overflows and cookies are used as fallback (default) or if enabled unconditionally, and can degrade overall system responsiveness compared to standard connection queuing during such conditions. SYN cookies function as a fallback , activating only when the server's SYN queue reaches capacity; otherwise, normal queuing with full option support applies. However, under a sustained flood that keeps the queue perpetually full, all incoming connections—legitimate and malicious alike—must use cookies, eliminating the benefits of standard handling and potentially amplifying the performance hits across the board. Finally, SYN cookies address only the SYN flood variant of denial-of-service attacks and offer no protection against fully open floods or higher-layer exploits like application-level DDoS, where attackers bypass the entirely. This makes them an incomplete standalone defense, necessitating complementary measures for comprehensive network resilience.

Security Considerations

Effectiveness Against Attacks

SYN cookies have demonstrated high effectiveness in mitigating attacks by eliminating the need to allocate memory for half-open connections, thereby preventing backlog queue exhaustion. In benchmarks on systems under simulated attacks of 15,000 SYN packets per second, unmodified stacks with large backlogs achieved only 2.5% connection completion within 500 milliseconds, whereas stateless defenses like SYN cache maintained nearly 100% connection establishment within 1 second, with SYN cookies offering similar or better performance by avoiding any state allocation. This approach shifts the computational burden to cryptographic hashing during the SYN-ACK phase, with negligible overall CPU impact on modern servers. In real-world scenarios, SYN cookies have enabled systems to remain operational during SYN flood components of major DDoS incidents. Empirical studies confirm their practical efficacy, showing 100% reduction in half-open state storage compared to traditional queuing (e.g., 0 bytes vs. 368-736 bytes per ), enabling to handle floods that would otherwise consume significant memory. However, SYN cookies exhibit limitations in against extremely large-scale or highly distributed attacks. They excel at countering volumetric resource-exhaustion floods but falter when attack volumes exceed processing thresholds, such as beyond 1.3 million packets per second, where CPU overload from computations can degrade ; in such cases, distributed botnets can induce effective through sheer scale. Additionally, since SYN cookies do not filter incoming traffic, they offer no protection against bandwidth saturation in pure volumetric DDoS scenarios. The technique's protective value increases significantly when integrated with complementary strategies like SYN proxies, which offload initial handshakes to intermediate devices, or , which caps SYN arrivals per source IP; combined deployments have shown to sustain throughput under attacks that overwhelm standalone SYN cookies alone. In 2025, amid escalating DDoS volumes, SYN floods continue to comprise a major share of Layer 3/4 attacks—ranking second to DNS floods and accounting for a substantial portion of mitigated incidents—affirming SYN cookies' ongoing relevance in modern defense stacks.

Potential Vulnerabilities

While SYN cookies rely on cryptographic hashing to encode connection details into the initial sequence number, they are theoretically susceptible to hash collision attacks where an attacker attempts to guess or brute-force valid cookies. In implementations using non-cryptographic hashes like CRC32, attackers can induce collisions by crafting SYN packets that exploit the hash's linearity, allowing them to bypass cookie validation and forge connections without knowing the full secret. This vulnerability arises because weaker hashes enable side-channel attacks, such as observing server responses to probe packets and deduce nonces or induce collisions that overwhelm the defense. Stronger cryptographic hashes, like those recommended in modern designs (e.g., HalfSipHash), mitigate this by providing resistance to collision induction, though side-channel leaks of the secret key could still expose patterns if an attacker monitors timing or power consumption during hash computations. The inclusion of a in SYN cookies, typically encoded in a few bits to represent 32-second intervals, introduces a potential for if the server's clock is or predictable. Attackers could predict future cookies by synchronizing with the server's coarse-grained windows, especially in scenarios where prior legitimate reveals timing patterns, enabling the crafting of valid-looking ACKs for replay or flooding attacks. This risk is heightened in environments with network latency or if the does not rotate timestamps frequently enough, though the design's time dependence generally prevents long-term reuse of collected cookies from public systems. A specific in implementations of SYN cookies was disclosed in CVE-2025-38181, affecting () tag handling during connection setup. When SYN cookies are enabled, the kernel's request structure (reqsk->rsk_listener) can be , leading to a null-pointer dereference in functions like calipso_req_setattr() and calipso_req_delattr() when processing options. This flaw, reported via , causes kernel crashes or general protection faults, potentially enabling denial-of-service by triggering instability during scenarios with -enabled traffic, as seen in kernels like 6.14.0 on distributions. The issue stems from uninitialized structures post-commit a1a5344ddbe8 in SYN cookie handling, and mitigations involve returning errors for operations in SYN cookie contexts to disable incompatible features. Even with valid cookie encoding, SYN cookies can suffer from denial-of-service during the verification phase if attackers flood the with guessed packets. Each incoming requires the to perform a cryptographic to check the encoded number against the connection and secret, which is computationally intensive at ; an attacker could send up to 2^24 possible s per SYN-ACK (limited by the cookie's ) to force repeated checks, exhausting CPU resources without completing handshakes. This " flooding" exploits the stateless nature of SYN cookies, where invalid s still incur costs, potentially amplifying under high-volume attacks despite avoiding exhaustion. Compromise of the secret key used in SYN cookie generation poses a severe , as it would allow attackers to forge arbitrary cookies and bypass the entire protection mechanism. Poor , such as infrequent or storage in vulnerable , can lead to exposure through dumps via tools like /proc filesystem or panics, where secrets are inadvertently included in crash logs. In , where keys are generated and stored in space, exploits targeting disclosure (e.g., via or side-channels) could leak these values, enabling prediction of all cookies until . Best practices recommend periodic key changes (e.g., every few minutes) and hardened configurations to prevent such leaks.

History

Invention and Early Development

The development of SYN cookies was driven by the increasing prevalence of attacks in the mid-1990s, which exploited the TCP three-way handshake to overwhelm server resources by sending numerous SYN packets without completing connections. A notable incident occurred on September 6, 1996, when Panix, one of New York's oldest Internet service providers, suffered a that shut down its mail service for several days, highlighting the vulnerability of early Internet infrastructure. This attack, covered in the RISKS Digest and major news outlets, underscored the need for stateless defenses against denial-of-service threats. The conceptual foundations of SYN cookies trace back to earlier ideas on cookie-based protocols to mitigate resource exhaustion in network handshakes. In 1994, Phil Karn proposed cookie mechanisms in the Photuris session-key management protocol to prevent clogging attacks during Diffie-Hellman key exchanges, avoiding server state accumulation by encoding verification data in cookies generated via cryptographic hashes. These cookies, dependent on IP addresses, ports, and secrets, provided a lightweight anti-flooding measure that influenced subsequent TCP-specific adaptations. SYN cookies were formally invented by Daniel J. Bernstein in September 1996, who specified them as particular choices of initial sequence numbers (ISNs) in SYN-ACK packets to encode connection details cryptographically without allocating server state. Working with Eric Schenk, Bernstein detailed the technique on his cr.yp.to website, using a hash function to compute the ISN from the client's IP, port, server's timestamp, and a secret key, allowing validation upon ACK receipt. This approach ensured resistance to spoofed SYNs while preserving TCP compatibility. Early prototypes emerged rapidly following Bernstein's proposal. In October 1996, Jeff Weisberg released an implementation for SunOS, demonstrating practical deployment. For Linux, Eric Schenk provided an initial kernel implementation in February 1997, integrated into development versions like 2.1.x by Andi Kleen, enabling SYN cookies as an optional defense. Key publications included Bernstein's 1996 specification and related archives on cr.yp.to, which served as the primary technical reference. These ideas also informed early IETF discussions in the TCP Maintenance and Minor Extensions (TCPM) working group, where SYN cookies were analyzed as a mitigation prior to formal documentation in RFC 4987 (2007), though not standardized earlier due to concerns over TCP compliance.

Adoption and Evolution

SYN cookies gained widespread adoption in major operating systems during the early 2000s as a defense against attacks. They were integrated into the with version 2.4, released in 2001, allowing kernel builders to enable generation and analysis of SYN cookies for stateless connection handling. Similarly, incorporated SYN cookies into its SYN caching mechanism starting with version 4.5 in January 2002, where they are used in combination with SYN cache to mitigate denial-of-service attacks by default. By the mid-2000s, SYN cookies had become a standard feature in most systems, including variants of BSD, reflecting their recognition as an essential tool. Standardization efforts further solidified their role in network protocols. In 2007, RFC 4987 formally documented SYN cookies as a common mitigation technique for TCP SYN flooding attacks, outlining their implementation to avoid server resource exhaustion without altering the TCP specification. Evolutions in SYN cookie implementations addressed emerging protocol needs. During the 2000s, enhancements added IPv6 support, with Linux patches in 2008 enabling cookie generation for IPv6 flows to protect against floods in dual-stack environments. In the 2010s, improvements focused on better handling of TCP options, such as encoding them into the timestamp field to preserve functionality like window scaling during stateless SYN-ACK responses, reducing compatibility issues in modern networks. As of 2025, SYN cookies remain a default-enabled feature in many distributions, including 24.04, where the kernel parameter net.ipv4.tcp_syncookies is set to activate them automatically during detected SYN floods. They are also integral to cloud infrastructure, such as AWS Application Load Balancers, which employ SYN cookies to counter state table exhaustion from SYN floods at scale. Concurrently, alternatives have emerged, including hardware offloading to network interface cards (NICs) and smart switches, which perform SYN cookie validation in programmable data planes to reduce software overhead and enhance performance in high-throughput environments.

References

  1. [1]
    RFC 4987 - TCP SYN Flooding Attacks and Common Mitigations
    The SYN flooding attack is a denial-of-service method affecting hosts that run TCP server processes. The attack takes advantage of the state retention TCP ...
  2. [2]
    SYN cookies
    SYN cookies ``do not allow to use TCP extensions'' such as large windows. Reality: SYN cookies don't hurt TCP extensions. A connection saved by SYN cookies ...
  3. [3]
    RFC 793 - Transmission Control Protocol - IETF Datatracker
    ... three-way handshake" is the procedure used to establish a connection. This procedure normally is initiated by one TCP and responded to by another TCP. The ...
  4. [4]
    SYN packet handling in the wild - The Cloudflare Blog
    Jan 15, 2018 · The backlog value controls the SYN Queue size. This effectively can be read as "ACK packets in flight". The larger the average round trip time ...
  5. [5]
    TCP SYN Flooding Attacks and Common Mitigations
    Attack Description This section describes both the history and the technical basis of the SYN flooding attack. 2.1. History The TCP SYN flooding weakness ...
  6. [6]
  7. [7]
  8. [8]
    RFC 4987: TCP SYN Flooding Attacks and Common Mitigations
    The SYN flooding attack is a denial-of-service method affecting hosts that run TCP server processes. The attack takes advantage of the state retention TCP ...
  9. [9]
  10. [10]
    kernel: Possible SYN flooding on port #. Sending cookies.
    Oct 16, 2024 · SYN cookies are not part of any RFC, though they do conform to the TCP standard. A full description of the calculation to create a cookie is ...
  11. [11]
    [RFC] netfilter: iptables target SYNPROXY - Patchwork - OzLabs
    iptables target SYNPROXY. This patch implements an iptables target SYNPROXY, which works in the raw table of the PREROUTING chain, before conntracking ...
  12. [12]
    github/synsanity: netfilter (iptables) target for high performance ...
    Jun 22, 2018 · synsanity is a netfilter (iptables) target for high performance lockless SYN cookies for SYN flood mitigation, as used in production at GitHub. ...
  13. [13]
    Improving syncookies - LWN.net
    Apr 9, 2008 · A first line defense against SYN floods is the syncookie. The syncookie was not designed for Linux specifically but found its way into kernel ...Missing: paper | Show results with:paper
  14. [14]
    linux - What is the difference between tcp_max_syn_backlog and ...
    Jun 29, 2020 · tcp_max_syn_backlog represents the maximal number of connections in SYN_RECV queue. Ie when your server received SYN, sent SYN-ACK and haven't received ACK yet.High CPU load on SYN flood - linux kernel - Stack OverflowWhat's "tcp-backlog" in redis.conf - Stack OverflowMore results from stackoverflow.com
  15. [15]
    CVE-2025-38181 Detail - NVD
    Jul 4, 2025 · In the Linux kernel, the following vulnerability has been resolved: calipso: Fix null-ptr-deref in calipso_req_{set,del}attr().
  16. [16]
  17. [17]
  18. [18]
    Brief Analysis of Windows SynAttackProtection Mechanism
    Jun 26, 2019 · In this article, we'll explore SynAttackProtection in detail to understand how it can cause connection problems for application services built on Windows ...Missing: enhancements | Show results with:enhancements
  19. [19]
    Security Vulnerability in the TCP Implementation of Solaris Systems ...
    A security vulnerability in the TCP implementation of Solaris 8, 9 and 10 may allow a remote unprivileged user to cause a Solaris system which is undergoing a ...Missing: cookies tcp_syn_cookies_enable
  20. [20]
    Defining Strategies to Protect Against TCP SYN Denial of Service ...
    This paper contains a technical description of how the potential TCP SYN attack occurs and suggested methods for using Cisco IOS software to defend against it.Abstract · The TCP SYN AttackMissing: synwait- | Show results with:synwait-
  21. [21]
    IP Application Services Configuration Guide, Cisco IOS XE Fuji 16.9.x
    Jul 20, 2018 · (Optional) Sets the amount of time the Cisco software will wait before attempting to establish a TCP connection. The default is 30 seconds.Missing: flood | Show results with:flood
  22. [22]
    SYN flood attacks - AWS Best Practices for DDoS Resiliency
    Modern operating systems all implement SYN cookies by default as a mechanism to counter state table exhaustion from SYN flood attacks.
  23. [23]
    List of AWS Shield DDoS mitigation features
    TCP SYN proxy – This provides protection against TCP SYN floods by sending TCP SYN cookies to challenge new connections before allowing them to pass to the ...
  24. [24]
    Microsoft DDoS protection response guide | Microsoft Azure Blog
    Mar 4, 2022 · Microsoft uses standard detection and mitigation techniques such as SYN cookies, rate limiting, and connection limits to protect against DDoS ...Microsoft Ddos Platform · Recent Incidents · Protect Your Applications In...
  25. [25]
    Apache Security: Chapter 5. Denial of Service Attacks - Feisty Duck
    Linux comes with an effective defense against SYN flood attacks called SYN cookies. Instead of allocating space in the connection queue after receiving the ...
  26. [26]
    None
    ### Advantages of SYN Cookies (D.J. Bernstein)
  27. [27]
    [PDF] Hardware SYN Attack Protection For High Performance Load ...
    When we started this research, we hoped to mitigate an attack of one million SYNs per second on a single VIP, while not affecting the one million connections ...
  28. [28]
    [PDF] Resisting SYN flood DoS attacks with a SYN cache - FreeBSD
    SYN flood attacks overwhelm servers with TCP requests. SYN caches allocate state to resist, while SYN cookies store state in the network.
  29. [29]
    ip-sysctl.txt - The Linux Kernel Archives
    syncookies seriously violate TCP protocol, do not allow to use TCP extensions, can result in serious degradation of some services (f.e. SMTP relaying), visible ...
  30. [30]
    The DDoS Attack on Dyn's DNS Infrastructure | ThousandEyes
    Dyn suffered a DDoS attack from the Mirai botnet on its managed DNS infrastructure, which impacted the performance of more than 1200 domains globally.
  31. [31]
    [PDF] SmartCookie: Blocking Large-Scale SYN Floods with a Split-Proxy ...
    Aug 16, 2024 · Jaqen Mode 2, SYN Flood. SmartCookie, ACK Flood. SmartCookie, SYN Flood. Baseline (No Attack) ... umetric attacks, with mechanisms like those ...
  32. [32]
    What Are SYN Flood DDoS Attacks? - Akamai
    A SYN flood attack exploits TCP/IP to conduct a distributed denial-of-service (DDoS) attack. Learn how to spot, prevent, and mitigate these attacks.Missing: SYNs | Show results with:SYNs
  33. [33]
    Hyper-volumetric DDoS attacks skyrocket: Cloudflare's 2025 Q2 ...
    Jul 15, 2025 · In Q2 2025, DNS flood attacks were the top L3/4 attack vector accounting for almost a third of all L3/4 DDoS attacks. SYN floods was the ...Key Ddos Insights · L3/4 Attack Vectors · Emerging Threats
  34. [34]
    Using SYN cookies to perform a DOS attack
    Mar 14, 2012 · SYN cookies are a way to mitigate SYN flood attacks. The gist of SYN floods is that keeping state for an opening connection is expensive.<|separator|>
  35. [35]
  36. [36]
    RFC 2522 - Photuris: Session-Key Management Protocol
    Photuris is a session-key management protocol intended for use with the IP Security Protocols (AH and ESP). This document defines the basic protocol mechanisms.
  37. [37]
    [PDF] IMPROVING THE FUNCTIONALITY OF SYN COOKIES
    In this paper we present an improvement of the SYN cookie protocol, using all the current mech- anisms for generating and validating cookies while allowing ...
  38. [38]
    syncookies - FreeBSD Manual Pages
    ... HISTORY The existing syncache implementation first appeared in FreeBSD 4.5. The original concept of a syncache originally appeared in BSD/OS, and was later ...
  39. [39]
    RFC 4987 - TCP SYN Flooding Attacks and Common Mitigations
    Jul 30, 2022 · This use of Timestamps to improve the compromises inherent in SYN cookies ... Linux kernel for several years previous to 2.6.5. When a SYN cache ...
  40. [40]
    Security/Features - Ubuntu Wiki
    Oct 10, 2025 · When a system is overwhelmed by new network connections, SYN cookie use is activated, which helps mitigate a SYN-flood attack. Automatic ...Configuration · Subsystems · Mandatory Access Control... · Userspace Hardening