Offensive Security

The Patch Does Not Log Them Out

Tomas FerreiraTomas FerreiraHead of Offensive Security31 Oct 20235 min read1384 views
Editorial cover for “The Patch Does Not Log Them Out”

October produced two edge-device emergencies inside a fortnight, from two different vendors, with one lesson in common. Applying the fix closed the hole. It did nothing about whoever had already come through it.

Our advisory at the start of the month argued for a 48-hour patch path for anything internet-facing. We stand by every word of it. This month showed what has to happen in the hours after the patch, and why so many organizations will skip it.

Citrix Bleed: the session is the credential

On October 10, Citrix published fixes for CVE-2023-4966 in NetScaler ADC and NetScaler Gateway, rated 9.4. The flaw is an unauthenticated information disclosure affecting appliances configured as a gateway — VPN, ICA Proxy, clientless VPN, RDP Proxy — or as an AAA virtual server. In plain terms: a remote request could cause the appliance to hand back memory it should not, and that memory could contain valid session tokens.

A week later, Mandiant reported that it had seen zero-day exploitation going back to late August. It described hijacking of existing authenticated sessions, which bypasses multi-factor authentication and other strong authentication, at professional services, technology and government organizations. And it made the point this post is named after: sessions stolen before the update may persist after it. On October 23, Citrix added an explicit recommendation to kill all active and persistent sessions alongside the upgrade. By the last week of the month, public technical analysis was out and exploitation attempts against unpatched appliances had climbed sharply.

Think about what a session token is. It is a credential that has already passed MFA. Patching the appliance stops new tokens leaking; it does nothing to tokens that already leaked. Until they expire or are killed, they work. The unit of remediation is not the device. It is the device plus every session it issued while it was vulnerable.

IOS XE: the implant leaves, the account stays

On October 16, Cisco disclosed CVE-2023-20198, a maximum-severity flaw in the web interface of IOS XE, and CISA added it to the Known Exploited Vulnerabilities catalog the same day. Cisco Talos described attackers using it to gain the highest privilege level on the device and create local administrator accounts, then using a second flaw, CVE-2023-20273, to write an implant to the file system. Fixed software began rolling out on October 22.

The numbers were striking. By October 18, Censys counted close to 42,000 compromised devices. A few days later public scans showed somewhere between about a hundred and 1,200, depending on who was scanning, and for a moment it looked like a mass clean-up. It was not. Researchers at Fox-IT found that the implant had been altered to stop answering the public check, and an updated check still found nearly 38,000 implanted devices.

Talos made one more observation worth pinning to the wall: the implant does not survive a reboot, but the local accounts the attackers created do. A rebooted router could look clean, pass the check, and still carry an administrator account that nobody on the network team created.

Why the scanner said you were fine

The collapse in the IOS XE count is the most useful thing that happened this month, because it shows exactly how much a negative result from an outside check is worth. The counts fell mostly because the attackers changed their tooling, not because victims fixed anything.

An external check tells you what the attacker is willing to show you. Verification has to happen from the inside: the configuration compared against a known-good copy, the local account list compared against the accounts you actually issued, the authentication logs compared against the people who actually work for you.

What "remediated" should mean for an edge device

This is the definition we now use with clients. A device is remediated when all six are true, not when the first one is:

  1. Fixed or isolated. On a fixed version, or with the vulnerable interface removed from the internet.
  2. Sessions invalidated. Every session issued while the device was vulnerable has been terminated, persistent sessions included.
  3. Credentials rotated. Accounts that authenticated through the device during the exposure window — privileged accounts first — and any service credentials stored on it.
  4. Configuration verified. Local users, authentication settings and running configuration checked against a known-good copy. That presumes you keep one.
  5. Downstream hunted. A hijacked VPN session leads somewhere. Review what was reached from the device's address pool during the window.
  6. Evidence kept. Where you can, capture logs and configuration before rebooting. On many appliances, a reboot erases the most useful evidence you had.

Why management interfaces still face the internet

Cisco's own advice was to disable the HTTP server feature on internet-facing systems. That should prompt a harder question: why was it reachable at all? The usual answers are convenience, a factory default, or a contractor who needed access once in 2019. In our onboarding assessments, an exposed management interface on an edge device is one of the most common findings we write up, and one of the cheapest to fix.

A management plane belongs on a management network, reachable through something that requires its own strong authentication. If the only way to manage a device is from the internet, that is a design decision worth revisiting before the next advisory forces it.

What to do this quarter

  • List every edge device, its management exposure, its owner and its config backup location. If a device has no owner, it has no patch path.
  • Rewrite the patch ticket template for edge devices to include session termination, credential rotation and configuration verification as required steps, not optional follow-ups.
  • Keep configuration backups on a schedule, so that "compare against known-good" is a five-minute task rather than an archaeology project.
  • Shorten gateway session lifetimes where the business can tolerate it. A token that expires in hours is a smaller prize than one that lasts a week.
  • Watch the KEV catalog and vendor advisories against that inventory, and treat an exploited edge flaw as an incident until the six checks above are done.

The patch closes the door. It does not check who is already in the hallway.

Sources

#edge devices#Citrix#Cisco#session hijacking#patching#MFA
Tomas Ferreira

About the author

Tomas FerreiraHead of Offensive Security

Tomas cut his teeth doing penetration testing for banks across Brazil and the US, and has a wall of CVE credits from responsibly disclosed findings in enterprise software. OSCP, OSEP, and a stubborn belief that a pentest report nobody acts on is just expensive fiction. He runs our Analysis arm engagements from scoping through the readout call.

Penetration testingApplication securityVulnerability researchPurple team exercises

Discussion(0)

No comments yet — the floor is yours.

Join the discussion

Your email stays private; we only use it to distinguish real readers from bots.

open a channel

The best time to harden your defenses was yesterday.

The second-best time is right now. Tell us what keeps you up at night — we answer within one business day.