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

Playwright-MCP : A Powerful Tool For Browser Automation

Playwright-MCP (Model Context Protocol) is a cutting-edge tool designed to bridge the gap between AI…

1 day ago

JBDev : A Tool For Jailbreak And TrollStore Development

JBDev is a specialized development tool designed to streamline the creation and debugging of jailbreak…

2 days ago

Kereva LLM Code Scanner : A Revolutionary Tool For Python Applications Using LLMs

The Kereva LLM Code Scanner is an innovative static analysis tool tailored for Python applications…

2 days ago

Nuclei-Templates-Labs : A Hands-On Security Testing Playground

Nuclei-Templates-Labs is a dynamic and comprehensive repository designed for security researchers, learners, and organizations to…

2 days ago

SSH-Stealer : The Stealthy Threat Of Advanced Credential Theft

SSH-Stealer and RunAs-Stealer are malicious tools designed to stealthily harvest SSH credentials, enabling attackers to…

2 days ago

ollvm-unflattener : A Tool For Reversing Control Flow Flattening In OLLVM

Control flow flattening is a common obfuscation technique used by OLLVM (Obfuscator-LLVM) to transform executable…

2 days ago