Skip to content
Misconfiguration Write-up Intermediate

RAX30 Patch Diff Analysis & Nday Exploit for ZDI-23-496

The lighttpd configuration on the Netgear RAX30 allowed execution of PHP files from a mounted USB drive and followed symlinks, enabling an attacker with physical access to read files outside the USB filesystem and execute arbitrary commands as root.

hyper Follow

Published on blog.coffinsec.com

The description of this bug says the flaw occurs because “when parsing SOAP message headers, the process does not properly validate user supplied data before copying it to a fixed-length stack buffer.” Based on my previous experience with Netgear and specifically their SOAP server implementations, I had a pretty good…

hyper, on blog.coffinsec.com

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

Likely the lighttpd configuration did not disable symlink following and did not clear the global FastCGI handler for the /shares path, so files on the USB drive were served and executed.

Impact

An attacker with physical access could read files outside the USB filesystem and execute code as root, though the attack requires plugging in a USB drive.

What the attacker needed

Physical access to the router; a USB drive; vulnerable firmware version

The fix

The configuration was fixed by disabling symlink following and clearing the FastCGI handler for the /shares path.

How it was found

  1. Create an ext2-formatted USB drive and downgrade the router to the vulnerable firmware.
  2. Create a symlink on the USB drive pointing to /var/passwd.
  3. Connect the USB drive to the router and access the symlink via http://<routerip>/shares/ to download the password file.
  4. Create a PHP file on the USB drive that calls phpinfo() to confirm execution.
  5. Create a PHP file that runs shell commands from a URL parameter.
  6. Use the PHP shell to download and run a script that opens a reverse shell.

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.

A router's web server was set up to run PHP files from a USB stick and to follow shortcuts (symlinks) that point to other files on the device. Someone who could plug in a USB stick could therefore run their own code as the most powerful user and read sensitive files.

What is Misconfiguration?

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.

More by hyper

View all

7 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Security misconfiguration

The lesson behind this report.

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.