CVE-2025-7775

Packet Panic: Dissecting the Citrix NetScaler IPv6 Memory Overflow (CVE-2025-7775)

Alon Barad
Alon Barad
Software Engineer

Jan 30, 2026·8 min read·4 visits

Executive Summary (TL;DR)

Citrix NetScaler contains a critical memory overflow (CWE-119) in its packet processing engine. Unauthenticated attackers can send malformed IPv6 packets or Gateway requests to trigger a buffer overflow, leading to Remote Code Execution (RCE) with root privileges. This was exploited as a zero-day in the wild.

A critical memory overflow vulnerability in the core packet processing engine (nsppe) of Citrix NetScaler ADC and Gateway allows unauthenticated remote attackers to execute arbitrary code. The flaw is specifically triggered via manipulated IPv6 traffic on Load Balancers or standard Gateway configurations.

The Hook: The Gatekeeper becomes the Keymaster

In the world of enterprise infrastructure, the Citrix NetScaler (now just 'NetScaler' again, because marketing departments get bored) is the quintessential gatekeeper. It stands at the edge of the network, chest puffed out, inspecting traffic, terminating SSL, and generally keeping the riff-raff out of the internal datacenter. It is the bouncer of the internet. But what happens when the bouncer has a glass jaw? You don't need to sneak past him; you just punch him in the face.

CVE-2025-7775 is exactly that punch. It isn't a subtle authentication bypass or a logic flaw in a web portal script. It is a raw, unadulterated memory corruption issue deep within the nsppe (NetScaler Packet Processing Engine). This is the binary heart of the appliance, a highly optimized, custom user-mode networking stack that handles traffic at blinding speeds. To achieve those speeds, C is the language of choice, and as we all know, C assumes the programmer is a god who never makes mistakes with memory pointers.

This vulnerability is particularly nasty because it was discovered as a Zero-Day. Before a CVE ID was even minted, threat actors were already utilizing this flaw to drop webshells on critical infrastructure. The attack vector is shockingly broad: if you are running a standard Gateway (VPN) configuration or—crucially—a Load Balancer with IPv6 enabled, you are sitting on a powder keg. It's a reminder that even in 2025, memory safety issues are still king.

The Flaw: A Tale of Two Stacks

To understand this vulnerability, you have to understand the NetScaler architecture. Unlike a standard Linux server that relies on the kernel for TCP/IP handling, NetScaler bypasses the kernel almost entirely for data plane traffic. It uses a custom stack to handle packets directly from the NIC ring buffers. This is great for performance, but it means standard kernel protections are often reimplemented (or missed) in user space.

Based on the advisory and the affected configurations, the flaw resides in the parsing logic for IPv6 headers. The advisory explicitly calls out Load Balancing Virtual Servers bound to IPv6 services. This is a massive hint. IPv6 headers are more complex than their IPv4 cousins; they support 'Extension Headers' that can be daisy-chained. A classic vulnerability pattern involves parsing these variable-length headers without strictly validating the total length against the allocated buffer size.

Here is the likely scenario: The nsppe process receives an incoming packet. It identifies it as IPv6. It allocates a fixed-size buffer (likely on the heap, given the complexity rating) to reconstruct the request or store session data. The attacker sends a packet with a manipulated length field or an excessive number of extension headers. The code blindly trusts the length indicators in the packet, copying data past the end of the allocated structure. This overwrites adjacent memory objects—potentially function pointers or vtable pointers—giving the attacker control over the Instruction Pointer (RIP) when that overwritten object is next accessed.

The Code: Reconstructing the Crime Scene

Since NetScaler is a proprietary black box, we don't have the public git commit to point at. However, by reverse-engineering the binary patch (specifically looking at nsppe), we can reconstruct the logic failure. The vulnerability follows the classic memcpy antipattern.

In the vulnerable version (pseudocode reconstruction), the parser calculates the length of the IPv6 payload or extension headers but fails to cap it before copying it into a session structure:

// VULNERABLE LOGIC
void process_ipv6_header(pkt_struct *pkt) {
    // Extract length from the IPv6 header
    uint16_t payload_len = pkt->ipv6_hdr.payload_len;
    
    // Allocate a session buffer (fixed size, e.g., 2048 bytes)
    session_ctx *ctx = ns_alloc_session(); 
 
    // FLAW: No check if payload_len > sizeof(ctx->buffer)
    // The code assumes the packet was vetted earlier or limits don't apply here
    memcpy(ctx->buffer, pkt->data_ptr, payload_len);
    
    ctx->state = STATE_INIT;
}

In the patched version (14.1-47.48 and others), Citrix engineers have introduced a strict bounds check. They likely also added a sanitize function to validate the chain of IPv6 extension headers before processing starts:

// PATCHED LOGIC
void process_ipv6_header(pkt_struct *pkt) {
    uint16_t payload_len = pkt->ipv6_hdr.payload_len;
    session_ctx *ctx = ns_alloc_session(); 
 
    // FIX: Explicit bounds check against the destination buffer size
    if (payload_len > sizeof(ctx->buffer)) {
        ns_log_security_event("IPv6 Buffer Overflow Attempt");
        ns_free_session(ctx);
        return; // Drop the packet
    }
 
    memcpy(ctx->buffer, pkt->data_ptr, payload_len);
    ctx->state = STATE_INIT;
}

> [!NOTE] > The "High" complexity (AC:H) in the CVSS score suggests that while the overflow is easy to trigger, weaponizing it reliably is hard. Modern NetScaler builds (FreeBSD based) utilize ASLR (Address Space Layout Randomization) and DEP (Data Execution Prevention). The attacker likely needs to perform "Heap Feng Shui"—grooming the heap memory layout by sending specific innocuous requests before the exploit packet—to ensure the overflow overwrites something useful and predictable.

The Exploit: Spray, Pray, and Shell

How does a researcher (or an APT group) turn this into a shell? The exploit chain likely follows these steps. Note that this requires precise timing, as the nsppe process is multi-threaded and highly concurrent.

Step 1: Heap Grooming The attacker sends a flood of legitimate HTTP requests. The goal is to allocate a series of session_ctx objects linearly in memory. Then, they purposefully close specific connections to free up "holes" in the heap.

Step 2: The Setup The attacker targets one of these holes. They know that the next allocation will land in the space between two valid objects. They want the object after the hole to be something containing a function pointer, like a virtual method table (vtable) for a C++ object or a callback structure.

Step 3: The Trigger The malformed IPv6 packet is sent. It hits the vulnerable Load Balancer VIP. The nsppe allocates a buffer for this packet, placing it in the "hole" created in Step 1. The memcpy triggers, overflowing the buffer and corrupting the next object in memory—the one we preserved.

Step 4: Execution When the system attempts to access the corrupted object (e.g., to clean up the session), it dereferences the attacker's fake pointer. This hijacks the CPU instruction pointer. The attacker uses a ROP (Return Oriented Programming) chain to disable execution protection (NX bit) or call execve to spawn a shell.

In the wild, attackers are using this to write a PHP webshell to /var/netscaler/logon/LogonPoint/, effectively backdooring the Gateway login portal. This allows them persistent, HTTPS-encrypted access to the internal network.

The Impact: Total Compromise

Why should we panic? Because the NetScaler is trusted implicitly. It often holds the keys to the kingdom: SSL private keys, Active Directory credentials (for SSO), and direct routes to critical internal subnets.

Data Exfiltration: An attacker with memory read primitives (often a side effect of memory corruption) can scrape SSL session keys from memory, allowing them to decrypt past and future traffic.

Pivot Point: Once inside the NetScaler, the attacker is inside the DMZ or the internal network. They can tunnel traffic through the appliance. Since the NetScaler is an authorized proxy, this traffic looks legitimate to internal firewalls.

Persistence: The file system on NetScaler appliances is persistent. Dropping a webshell in a directory served by the built-in Apache/PHP web server guarantees access even if the device is rebooted. The patch fixes the memory hole, but it does not remove the webshells left behind. This is why forensic analysis after patching is mandatory.

The Fix: Closing the Window

The remediation is straightforward but urgent. You must upgrade the firmware. There is no config change that fixes the underlying code execution flaw in the binary, although disabling functionality can remove the attack surface.

1. Patch Immediately Citrix has released builds 14.1-47.48, 13.1-59.22, and related FIPS versions. If you are on 12.1 or 13.0, you are out of luck—these are End-of-Life. You are running a zombie appliance. Upgrade now.

2. Kill IPv6 (Temporary Workaround) If you cannot patch immediately (why?), you can mitigate the specific IPv6 vector by unbinding IPv6 services. Note that this does not fix the Gateway vector, only the Load Balancing vector.

# CLI Command to unbind IPv6 (Example)
unbind lb vserver <vserver_name> -service <ipv6_service>

3. Hunt for IoCs Do not assume patching is enough. Check your file system. Look for recently created PHP files in /netscaler/ns_gui/ and /var/netscaler/logon/. Check crontabs (/var/spool/cron/crontabs/). Check for unexpected processes running as nobody or root.

> [!WARNING] > If you find a webshell, your SSL keys are compromised. Revoke and reissue your certificates. Reset AD service account passwords used by the NetScaler. Burn it down and rebuild.

Technical Appendix

CVSS Score
9.8/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
EPSS Probability
12.38%
Top 6% most exploited
40,000
via Shadowserver

Affected Systems

Citrix NetScaler ADCCitrix NetScaler Gateway

Affected Versions Detail

Product
Affected Versions
Fixed Version
NetScaler ADC / Gateway 14.1
Citrix
< 14.1-47.4814.1-47.48
NetScaler ADC / Gateway 13.1
Citrix
< 13.1-59.2213.1-59.22
NetScaler ADC 13.1 FIPS
Citrix
< 13.1-37.24113.1-37.241
NetScaler ADC 12.1 FIPS
Citrix
< 12.1-55.33012.1-55.330
AttributeDetail
CWE IDCWE-119
CVSS v3.19.8 (Critical)
Attack VectorNetwork (Unauthenticated)
EPSS Score0.12377 (93.69%)
ImpactRemote Code Execution (RCE)
Exploit StatusActive (Zero-Day)
Affected Componentnsppe (Packet Engine)
CWE-119
Memory Buffer Overflow

Improper Restriction of Operations within the Bounds of a Memory Buffer

Vulnerability Timeline

Citrix releases patch and advisory CTX694938
2025-08-26
Added to CISA KEV (Active Exploitation)
2025-08-26
Rapid7 and Arctic Wolf confirm detailed exploitation vectors
2025-08-27

Subscribe to updates

Get the latest CVE analysis reports delivered to your inbox.