Vulnerability6 min read

Citrix ADC: the gateway flaw that opened internal networks

In December 2019, a flaw in Citrix's remote access gateways let attackers in without a password, with no fix for 33 days. How it worked, who was hit.

Illustration: a ring showing the CVSS score 9.8, with the title Citrix ADC

What to do now

  1. Run a supported NetScaler release such as 14.1 with all current updates. The affected versions 10.5 to 13.0 get no more security fixes; 13.0 reached its end of life on July 15, 2024.
  2. If a gateway ran without the fix or the workaround in January 2020, have it checked for signs of attack: an update does not remove a backdoor planted before it. If it was compromised, set it up anew and replace its certificates.
  3. Install security updates for remote access gateways within days: in January 2020, mass attacks began within a day of the attack code’s release.
Year
2019
CVSS 3.1 score
9.8 critical
vulnerable servers worldwide in December 2019 (estimate from a scan; DIVD)
128,777
servers with known signs of attack by June 2020 (Fox-IT)
3,332
Why it is on the list
  • Reach met

    A worldwide scan in December 2019 found an estimated 128,777 vulnerable servers (DIVD case report, 2020).

  • Mass exploitation met

    Fox-IT found known signs of compromise on 3,332 servers by June 2020 (Fox-IT, July 2020). Agencies of the US, the UK and Australia called it the most exploited flaw of 2020 (CISA advisory AA21-209A, July 2021).

  • Damage met

    Attackers who had come in through the Citrix gateway encrypted about 30 servers of Düsseldorf University Hospital in September 2020 (NRW Ministry of Justice, September 2020). The hospital had to stay off emergency care for 13 days (BSI, 2021).

  • Extraordinary response met

    The Dutch NCSC raised its rating to the highest level. It urged the government and operators of vital services to switch off their Citrix servers until a fix existed (Dutch government's letter to parliament, January 23, 2020).

How a vulnerability gets on this list

The record
AffectedCitrix ADC and Citrix Gateway (today again called NetScaler), devices for remote access to internal networks
CVECVE-2019-19781
CVSS vectorCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Weakness (CWE)CWE-22
Fixed inCitrix ADC and Gateway 11.1 build 63.15 and 12.0 build 63.13 (January 19, 2020), 12.1 build 55.18 and 13.0 build 47.24 (January 23), 10.5 build 70.12 (January 24, 2020)
On CISA's list of exploited vulnerabilities sinceNovember 3, 2021
Found byPositive Technologies
Timeline
  1. 1Made public
  2. 2First attacks seen+25 days
  3. 3The Dutch NCSC advises switching off Citrix servers until a fix exists+31 days
  4. 4Fix available+33 days
  5. 5With version 10.5, the last affected version gets its fix+38 days
  6. 6Ransomware that came in through a Citrix gateway hits Düsseldorf University Hospital+268 days
  7. 7Agencies of the US, the UK and Australia name it the most exploited flaw of 2020+589 days
  8. 8Added to CISA's list of exploited vulnerabilities+687 days

On December 17, 2019, Citrix warned of a flaw in Citrix ADC and Citrix Gateway. It let anyone on the internet run commands on these devices without a password. The devices stand at the edge of many company and government networks. They let staff reach internal applications from outside and spread incoming traffic across servers. At first Citrix had no fix, only a workaround. The first fixes came 33 days later, on January 19, 2020. By then, attack code was public and attacks were under way around the world.

How it worked

Citrix Gateway has a built-in web server that shows users the login page. Behind it lies a folder named /vpns/ with small programs, Perl scripts, that should be reachable only after logging in. The flaw, CVE-2019-19781, is a path traversal. An attacker puts “../” into the address of a request, as in /vpn/../vpns/. This lets the attacker climb out of the public area and reach these scripts without logging in.

The CERT Coordination Center at Carnegie Mellon University described one way to use this. A first request makes one of the scripts write a file with hidden commands onto the device. A second request makes the device read that file as a template for a web page, and the commands run. The attacker then controls a device that sits between the internet and the internal network.

  1. Attackerputs ../ into the address of a request
  2. Citrix gatewaylets it reach scripts meant for logged-in users
  3. Scriptwrites a file with hidden commands
  4. Gatewayruns the commands
  5. Internal networklies open behind the gateway
Two requests without a password were enough to take over the gateway.

Citrix’s workaround was a rule that rejects requests containing “/../” or aimed at /vpns/. On some builds of version 12.1, a separate bug kept the rule from working. The flaw affected versions 10.5 to 13.0. In January 2020, Citrix found that its SD-WAN WANOP appliances were affected too. They contain Citrix ADC. Citrix ADC was formerly called NetScaler ADC, and today it is sold under that name again.

Reach and damage

The Dutch volunteer group DIVD searches the internet for vulnerable systems and warns their owners. According to DIVD, a worldwide scan in December 2019 found an estimated 128,777 vulnerable servers. The security company Positive Technologies, which had found the flaw, put the number of companies at risk at 80,000 in 158 countries. In Germany, the federal cyber security agency BSI had reported almost 5,000 vulnerable systems to network operators since January 7, 2020. On January 16, about 1,500 of them were still open, and the BSI had numerous reports of successful attacks.

On the night of January 10 to 11, 2020, several groups published working attack code. The SANS Internet Storm Center, an early warning service of the SANS Institute, saw “heavy exploitation” the next day. The security company FireEye found successful attacks by several groups before January 12. One of them deleted other attackers’ tools and blocked further attacks. But it kept a backdoor, a hidden way back in that only it could open with a secret key.

The update did not remove such backdoors. The Dutch security company Fox-IT found known signs of compromise on 1,030 servers in January 2020. By June 2020, it found them on 3,332, including servers of government organizations and Fortune 500 companies. Of the compromised servers in June, 23 % had been patched but still had a backdoor. In July 2021, agencies of the United States, the United Kingdom and Australia called CVE-2019-19781 the most exploited flaw of 2020.

Servers with known signs of compromise
January 20201,030
June 20203,332

Fox-IT counted only the backdoors and traces it knew. Source: Fox-IT (July 2020).

The worst documented damage came months later. In September 2020, attackers encrypted about 30 servers of Düsseldorf University Hospital with ransomware. This malware locks data and demands money for its release. According to the BSI, they had entered through the hospital’s Citrix gateway. They had compromised it before the update was installed. The fixes were installed there from January 27, 2020. The hospital could not admit emergency patients for 13 days in a row. Its central emergency department reopened on September 23, 2020. The ransom note was addressed to the university to which the hospital belongs. The police told the attackers that they had hit a hospital. The attackers then handed over a key to restore the data.

On the night of September 11 to 12, a critically ill woman was to be brought to the hospital by ambulance. She was taken to a hospital further away in Wuppertal instead, with a delay of about 20 to 25 minutes, and died. Prosecutors concluded in January 2021 that she would very likely have died even with earlier treatment. So a link between the attack and her death could not be proven.

The fix and the response

Citrix released the fixes version by version:

Days from Citrix's warning to the fix
Versions 11.1 and 12.033
SD-WAN WANOP36
Versions 12.1 and 13.037
Version 10.538

Counted from the warning of December 17, 2019, to the fixes of January 19 to 24, 2020. Source: CISA.

Before the fixes, governments went further than usual. The Dutch National Cyber Security Centre (NCSC) raised its rating of the flaw to the highest level on December 24, 2019. It became unclear whether Citrix’s workaround was effective in all cases. On January 17, 2020, the NCSC urgently advised the government and operators of vital services to switch off their Citrix servers until a fix existed. The chief information officer of the Dutch government asked ministries to do the same unless strict conditions were met. According to the government, the first fixes covered about half of the vulnerable systems in the Netherlands.

In the United States, CISA, the federal agency for cyber security, released a free tool on January 13, 2020. It checks whether a device is vulnerable. On January 22, Citrix and FireEye released a scanner that looks for signs of attack. On January 31, CISA warned that unknown attackers had compromised numerous organizations. It also warned that a patch does not clean up an already compromised device. The BSI repeated this warning after the attack on the hospital in September 2020. On November 3, 2021, CISA added the flaw to its catalog of exploited vulnerabilities.

The National Vulnerability Database rates CVE-2019-19781 9.8 out of 10, “critical”. An attacker needs neither a password nor help from a user and can take full control of the device.