Skip to content
Info disclosure Write-up Advanced

CVE-2021-24122 Apache Tomcat Information Disclosure

When serving resources from a network location using the NTFS file system, Tomcat could bypass security constraints and/or allow viewing the source code of JSPs in some configurations. An attacker could potentially access protected resources or read JSP source code.

mail-archives.apache.org

Published on mail-archives.apache.org

Versions Affected: Apache Tomcat 10.0.0-M1 to 10.0.0-M9 Apache Tomcat 9.0.0.M1 to 9.0.39 Apache Tomcat 8.5.0 to 8.5.59 Apache Tomcat 7.0.0 to 7.0.106

The author, on mail-archives.apache.org

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

The root cause was the unexpected behaviour of the JRE API File.getCanonicalPath() which in turn was caused by the inconsistent behaviour of the Windows API (FindFirstFileW) in some circumstances.

What the attacker needed

Tomcat serving resources from a network location; NTFS file system; specific configuration

The fix

The issue was fixed by upgrading to Apache Tomcat 10.0.0-M10, 9.0.40, 8.5.60, or 7.0.107 or later.

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 web server that runs Java web applications. A security constraint is a rule that says who can access certain files. Because of a bug in how Windows reports file paths, Tomcat sometimes got the wrong path and let people see files they should not see, or read the source code of JSP pages (the code behind a web page).

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.