Skip to content
Path traversal Write-up Intermediate

CVE-2025–24813: Apache Tomcat Path Equivalence Vulnerability $$

Apache Tomcat mishandles path equivalence for filenames containing internal dots, so a crafted PUT request can write files outside the intended upload directory. An attacker could overwrite configuration or session files, potentially leading to remote code execution if deserialisation or a JSP shell is used.

Ajay Naik Follow

Published on infosecwriteups.com

This exploit allows attackers to overwrite sensitive files outside the designated upload directory due to improper path normalization.

Ajay Naik, on infosecwriteups.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 improper normalisation of file paths containing internal dots, allowing path traversal during partial PUT writes.

Impact

An attacker could disclose information, modify files, and potentially achieve remote code execution, but this depends on the default servlet being writable and partial PUT being enabled.

What the attacker needed

Default servlet writable (readonly=false); partial PUT enabled (default)

The fix

Upgrade to a patched Tomcat version, or set the default servlet to read-only and disable partial PUT requests.

How it was found

  1. Ensure the default servlet has write permissions and partial PUT is enabled.
  2. Send a PUT request with a path containing internal dots to write outside the upload directory.
  3. For RCE, target session persistence files with a serialised payload or upload a JSP shell to a web-accessible directory.
  4. Access the uploaded shell via a web request to execute commands.

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.

Tomcat is a Java web server. It failed to clean up file paths properly when saving uploaded files, so a request could sneak a file into a folder it should not reach. If that folder holds configuration or session data, an attacker might take over the server.

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 Ajay Naik

View all

6 more disclosed reports, best first.

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.