Vulnerability Analysis

Understanding And Utilizing The Tomcat – CVE-2024-50379 Proof-of-Concept (PoC)

The Tomcat-CVE-2024-50379-PoC is a proof-of-concept tool designed to demonstrate the exploitation of a critical vulnerability in Apache Tomcat, identified as CVE-2024-50379.

This vulnerability, with a CVSS score of 9.8, arises from a Time-of-check Time-of-use (TOCTOU) race condition during JavaServer Pages (JSP) compilation.

Under specific configurations, this flaw can lead to Remote Code Execution (RCE), posing significant risks to systems running vulnerable versions of Apache Tomcat.

CVE-2024-50379 exploits a race condition in case-insensitive file systems (e.g., Windows). The vulnerability occurs when:

  1. Tomcat checks if it is safe to compile or use a JSP file (time-of-check).
  2. An attacker uploads a malicious JSP file with a different case (e.g., file.jsp vs. FILE.JSP) during this narrow time window.
  3. The malicious file is executed due to inconsistencies in file system handling.

For exploitation, the default servlet must be configured to allow write operations—a non-default setting.

PoC Functionality

The PoC script simulates this attack by automating the exploitation process. It enables users to:

  • Test individual or batch URLs for vulnerability.
  • Exploit the race condition by uploading and executing malicious JSP files.

To run the PoC:

go run main.go -u http://localhost:8080/

Replace http://localhost:8080/ with the target URL.

Features:

  • Demonstrates RCE via the race condition.
  • Provides a basis for testing server configurations against CVE-2024-50379.

Limitations:

  • Requires specific conditions (e.g., case-insensitive file systems and write-enabled default servlet).
  • Does not include robust mechanisms to confirm successful exploitation yet.

To secure systems against CVE-2024-50379:

  1. Upgrade Apache Tomcat: Use patched versions 9.0.98, 10.1.34, or 11.0.2.
  2. Disable Write Access: Ensure the default servlet does not allow write operations.
  3. Secure File Uploads: Avoid allowing JSP files to be uploaded directly into directories served by the application.

This PoC serves as an educational tool for understanding and addressing critical vulnerabilities in Apache Tomcat environments.

It should only be used for legitimate security research and testing purposes, as unauthorized use is illegal and unethical.

Varshini

Varshini is a Cyber Security expert in Threat Analysis, Vulnerability Assessment, and Research. Passionate about staying ahead of emerging Threats and Technologies.

Recent Posts

Relocatable : A Tool For Position Independent Code

Relocatable is an innovative tool designed to simplify the creation of Position Independent Code (PIC)…

2 hours ago

Understanding Vulnerability And Its Tools In Cybersecurity

In cybersecurity, a vulnerability refers to a flaw or weakness in a system, application, or…

2 hours ago

BOF WinRM Client : Advancing Stealth And Efficiency In Remote System Management

The BOF WinRM Client is a Beacon Object File (BOF) extension for Cobalt Strike that…

2 hours ago

Dioxus : Revolutionizing Cross-Platform Development With Rust

Dioxus is a cutting-edge framework for building cross-platform applications using the Rust programming language. It…

2 hours ago

Modrinth : A Comprehensive Overview Of Tools And Functions

Modrinth is a cutting-edge platform designed to revolutionize the world of Minecraft modding. Focused primarily…

4 hours ago

Deno : The Next Generation JavaScript Runtime For Modern Web Development

Deno is a modern runtime for JavaScript, TypeScript, and WebAssembly, designed to address some of…

4 hours ago