Skip to content
RCE Write-up Advanced

Critical Zero-Day Vulnerability in Citrix NetScaler RCE

A pre-authentication remote code execution flaw in Citrix NetScaler ADC and Gateway allowed attackers to inject shell metacharacters into the username field of failed login attempts, which were logged and later processed by a root-owned maintenance script that passed the unsanitised log text into a shell command. This let unauthenticated attackers execute arbitrary commands as root on the appliance.

Pranav Khune Follow

Published on blog.securelayer7.net

CVE Technical Deep-Dives

Pranav Khune, on blog.securelayer7.net

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.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

The maintenance script treated log content as trusted data and interpolated an unvalidated filename derived from the log into a Perl backtick shell command, with no character allowlist and no privilege separation.

Impact

An unauthenticated attacker could execute arbitrary commands as root, leading to webshell deployment, rogue superuser accounts, credential and key theft, and a foothold in the internal network; the text notes the 24-hour delay and that attackers chained a SAML flaw to force a reboot and trigger execution sooner.

What the attacker needed

Network access to the login endpoint; No authentication required; Wait for scheduled maintenance script

The fix

Citrix fixed it in later firmware by replacing the shell pipeline with strict regex capture, using list-form open instead of backticks, adding path validation, and removing the daemon call path.

How it was found

  1. Send an unauthenticated login request with a username containing shell metacharacters.
  2. The failed login is written to the log file with the raw username preserved.
  3. Wait for the root-owned maintenance daemon to run its scheduled check.
  4. The script extracts the attacker-influenced text and interpolates it into a shell command, executing the payload as root.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

When you type a wrong username at a login page, the system writes that username into a log file. Here, the appliance later ran a cleanup script that read that log file and pasted part of the text straight into a system command, so a username containing special shell characters could make the appliance run extra commands. Because that script ran with the highest privileges, the attacker effectively got full control of the device.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More by Pranav Khune

View all

2 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.