Skip to content
Path traversal Advisory Intermediate CVE-2022-38451

FreshTomato httpd update.cgi directory traversal vulnerability

The update.cgi endpoint in FreshTomato's httpd allows an attacker to read arbitrary files by supplying a crafted filename to the notice API, which is used without sanitisation to build a file path. An authenticated attacker can exploit this to read any file on the device.

Francesco Benvenuto Follow

Originally disclosed on Cisco Talos

Medium 6.8 View original

A directory traversal vulnerability exists in the httpd update.cgi functionality of FreshTomato 2022.5. A specially crafted HTTP request can lead to arbitrary file read.

Francesco Benvenuto, on Cisco Talos

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 report has not been written yet. The Original tab links to the source.

How it worked

Root cause

The filename parameter passed to the notice API is used directly to build a file path without any sanitisation, allowing directory traversal.

Impact

An authenticated attacker could read arbitrary files on the device, potentially exposing sensitive information.

What the attacker needed

Authentication to the router's web interface

The fix

The vendor released a patch, but the text does not describe the fix details.

How it was found

  1. Send an HTTP request to update.cgi with the exec parameter set to 'notice'.
  2. Include an argument that contains a path traversal sequence to point outside /var/notice.
  3. The server reads the file and returns its contents.

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 report has not been written yet. The Original tab links to the source.

This router's web interface has a feature that reads a file from a fixed folder and shows its contents. The code that builds the file path does not check for special characters like '../', which let you climb out of that folder. So someone who can log in to the router can trick it into reading any file on the device, such as password files.

What is Path traversal?

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.

More by Francesco Benvenuto

View all

152 more disclosed reports, best first.

More from Cisco Talos

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Path traversal and file inclusion

The lesson behind this report.

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.