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

BypassAV : Techniques To Evade Antivirus And EDR Systems

BypassAV refers to the collection of techniques and tools used to bypass antivirus (AV) and…

11 hours ago

ComDotNetExploit : Exploiting Windows Protected Process Light (PPL)

ComDotNetExploit is a Proof of Concept (PoC) tool designed to demonstrate the exploitation of Windows…

11 hours ago

Trigon : A Revolutionary Kernel Exploit For iOS

Trigon is a sophisticated deterministic kernel exploit targeting Apple’s iOS devices, leveraging the CVE-2023-32434 vulnerability.…

11 hours ago

Bug Bounty Report Templates : Enhancing Efficiency In Vulnerability Reporting

Bug bounty report templates are essential tools for streamlining the process of documenting vulnerabilities. They…

11 hours ago

FullBypass : A Tool For AMSI And PowerShell CLM Bypass

FullBypass is a tool designed to circumvent Microsoft's Antimalware Scan Interface (AMSI) and PowerShell's Constrained…

12 hours ago

Carseat : A Python Implementation Of Seatbelt

Carseat is a Python-based tool that replicates the functionality of the well-known security auditing tool,…

16 hours ago