Security/Citrix NetScaler

Data is not code: SQL injection to NetScaler log poisoning

SQL injection has had a standard fix since 2004. NetScaler's CVE-2026-88771 repeats the mistake in a trusted shell script. What developers should change.

Illustration of a loose piece of paper turning into a machine gear as it is fed into a mechanism, a metaphor for data becoming code.

A root-level flaw in NetScaler, patched in late September 2026, comes down to the same mistake that gave us SQL injection in the 2000s. Text an attacker controlled ended up inside a command that an interpreter then ran. This time the interpreter was a shell, not a database. The code that did it was internal and trusted, which is why it got through.

If you write software, this should bother you more than a headline zero-day normally would. Nothing about the bug is exotic. It is a lesson we claimed to have learned twenty years ago.

The fix has been around since 2004

SQL injection happens when a program builds a database query by gluing user-supplied text into it. The database cannot tell which part was written by the developer and which part by the attacker, so it runs the lot.

The cure is the parameterised query, also called a prepared statement. You send the query’s structure and the values separately, so a value can never turn into code. Server-side prepared statements arrived in MySQL 4.1, which reached production release in October 2004. Other databases had the idea earlier: one 2004 write-up notes that Oracle had offered prepared statements for years.

Yet in March 2024, CISA and the FBI had to issue an alert. They pointed to widespread knowledge and documentation of SQL injection over two decades, plus effective mitigations, and said manufacturers still ship the defect. The alert was prompted by a well-publicised attack on a managed file transfer product that affected thousands of organisations.

Their diagnosis is blunt. As SecurityWeek reports the alert, SQL injection succeeds because developers fail to treat user-supplied content as potentially malicious. The root cause is mixing queries with user data.

Notice what that sentence does not say. It does not say “databases”. The failure is mixing data into something that gets interpreted.

NetScaler: the same mistake, one step removed

Now to CVE-2026-88771. It is a pre-authentication command injection in NetScaler ADC and Gateway that gives root command execution. Pre-authentication means the attacker needs no login. According to Playciso’s write-up of Citrix bulletin CTX697096, the bulletin was published on 27 September 2026 and fixed eight flaws, two of them already exploited as zero-days (attacks that begin before a fix exists). It rates CVE-2026-88771 at 9.5 on the CVSS 4.0 scale and says it affects the default configuration. Picus reports that CISA added it to its Known Exploited Vulnerabilities catalogue on the same day.

The interesting part is where the bug lives. It is not in a login handler or a parser. It sits in a background Perl maintenance script that reads the appliance’s own log files and passes part of a log line to the shell. The script’s job is to find the core dump of a crashed packet engine. To do that it builds a file name from a log line, then drops that name into a find command.

The script never checks that the extracted text is really an engine name and a process ID. In effect it asked “what did the log say?” and treated the answer as safe. A semicolon in the text splits the command, and the attacker’s command runs as root.

The mistake looks like this, in a simplified example rather than Citrix’s code:

# Untrusted text from a log, pasted into a shell string
my $name = extract_name_from_log();
my $found = `find /var/core -name ${name}* -print`;

It is the old SQL string concatenation with a different interpreter.

How the attacker gets text into the log

The attacker only needs to get a line into the log. Picus says a crafted username in an unauthenticated login request is enough, because NetScaler logs the failed attempt. Playciso adds that other logged inputs such as the User-Agent header can also carry the payload, so there are many trigger paths, not one endpoint.

Playciso also says the script runs on a schedule, so execution can come up to about 24 hours later. This is a stored, or second-order, injection. The data is harmless when it arrives and dangerous when something trusted reads it back.

That is the part many developers still miss. “User data” is not only what is in the current request. It is anything an outsider could have influenced: a log line, a filename, a database row, a queue message, a header.

The fix mirrors the parameterised query

The fix is instructive. According to Playciso’s reading of the patched build, Citrix replaced the shell pipeline with ordinary Perl file handling. It extracts values only through strictly validated patterns, and it runs find with an argument list instead of a shell string. That means shell metacharacters (the characters a shell treats as commands, such as ;) can never be interpreted. A final allow-list on the resulting path adds a second layer.

In the simplified example above, the safe shape looks like this:

# Arguments are passed as a list, so no shell ever parses them
open(my $fh, '-|', 'find', '/var/core', '-name', "$name*") or die $!;

That is the same principle as the prepared statement: keep the instruction and the data on separate channels, and validate the data anyway.

What needs to change: every interpreter boundary

The lesson is bigger than “use prepared statements”. An interpreter is anything that reads a string and decides what to do with it. That includes:

  • Shells, whether through backticks, system() or exec() with a single string.
  • Log processors, which read text that outsiders helped write.
  • Cron jobs and maintenance scripts, which are easy to dismiss as internal.
  • Query languages, template engines and file paths, wherever strings are assembled.

Three habits follow from the NetScaler fix.

  1. Do not build instructions from strings. Use the list or parameter form your language offers, so data never reaches a parser that can mistake it for code.
  2. Validate what you extract against the exact shape you expect. An engine name followed by a number is a shape. “Whatever follows this word” is not.
  3. Treat stored data as untrusted when it is read back. Writing it safely into the log is not enough. The script that reads it later needs the same discipline.

None of this is new. It is the SQL injection lesson applied at every boundary rather than only the database one.

PHP2Shell: where this is a different story

PHP2Shell is also in the news and it is easy to lump it in. It does not belong in this argument, and treating it as another input-handling failure would be wrong.

The two flaws, CVE-2026-109618 and CVE-2026-109619, both involve PHP’s handling of memory and internal request state. One is corruption after an out-of-memory error. The other is a use-after-free, where the runtime keeps references to request data after its memory has been released. They sit in the PHP runtime, not in application code. Qualys says updating is the only complete fix.

You cannot sanitise your way out of a memory-safety bug in the engine. As Wiz put it, a flaw in the core engine can affect sites even when their own application code is secure. Wiz also says the underlying flaws had been present for decades and that frontier AI models lowered the barrier to exploiting them. That is Wiz’s account, and it is not a story of developers neglecting basic hygiene.

Fixes shipped on 21 October 2026. The fixed releases are PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35. Qualys’s analysis of customer data found that 71% of PHP installations with a known version run end-of-life branches, most of which will never get a vendor patch. That is a different lesson, about knowing what you run and keeping it supported. It is worth learning, but it is not the lesson of this article.

So what’s changed?

I think we have not moved on as far as we like to believe. SQL injection became the cautionary tale everyone knows, and the fix has been available for twenty years. Then a root script inside a major security appliance does the same thing with a shell, because it was internal and so nobody thought of its input as user data.

I would like developers to stop thinking of “user input” as the form field and start thinking of it as anything a stranger could have touched on its way to your code. If a string will be interpreted, keep the data out of it. If the data has to be parsed, check it against the exact shape you expect. And do not wave a script through because it runs on a schedule and nobody sees it. That is the part I think we keep getting wrong.

Create your amazing blog on bloggy.space

Report abuse