目标达成 感谢每一位支持者 — 我们达成了 100% 目标!

目标: 1000 元 · 已筹: 1325

100%

CVE-2024-50379 PoC — Apache Tomcat 安全漏洞

来源
关联漏洞
标题:Apache Tomcat 安全漏洞 (CVE-2024-50379)
Description:Apache Tomcat是美国阿帕奇(Apache)基金会的一款轻量级Web应用服务器。用于实现对Servlet和JavaServer Page(JSP)的支持。 Apache Tomcat存在安全漏洞。攻击者利用该漏洞可以在不区分大小写的文件系统上远程执行代码。以下版本受到影响:11.0.0-M1版本和11.0.1版本、10.1.0-M1版本至10.1.33版本和9.0.0.M1版本至9.0.97版本。
介绍
# CVE-2024-50379 Exploitation and POC

This repository contains a Proof of Concept (POC) for **CVE-2024-50379**, a vulnerability affecting Apache Tomcat. The issue involves a **Time-of-Check Time-of-Use (TOCTOU) race condition**, which can lead to **Remote Code Execution (RCE)**, especially on case-insensitive file systems like Windows.

---

## Table of Contents

- [Description](#description)
- [POC](#poc)
- [Usage](#usage)
- [Security Considerations](#security-considerations)
- [License](#license)

---

## Description

CVE-2024-50379 is a vulnerability in Apache Tomcat that allows attackers to execute arbitrary code through a TOCTOU race condition. On case-insensitive file systems (e.g., Windows or macOS) and improperly configured servlets, this issue can be exploited.

---

## POC

### Overview

The POC demonstrates the exploitation of CVE-2024-50379 by uploading a malicious JSP file that can replace existing files with a different case (`FILE.JSP` overwriting `file.jsp`) in a Windows-based environment.

### Steps:

1. **File Upload Exploit**:
    - On a Windows server, upload a JSP file (`file.jsp`).
    - Quickly replace it with a differently-cased file (`FILE.JSP`).
    - Due to the case-insensitive nature, the older file (`file.jsp`) will be overwritten.

2. **Changes in `web.xml`**:
    - Misconfigured permissions in `web.xml` can enable write access for the Default Servlet, making the exploitation possible.


## Usage

1. Deploy Apache Tomcat server.
2. Configure the Default Servlet with write permissions.
3. Use the provided POC to upload JSP files and exploit the TOCTOU race condition.

---

## Security Considerations

- This POC is for educational purposes only.
- **DO NOT USE** this in production without strict security measures.
- Ensure proper configuration of servlets and file systems to mitigate similar vulnerabilities.

---

## Blog

For more insights into **CVE-2024-50379**, check out my detailed blog:  
[Deep Dive & POC of CVE-2024-50379 in Apache Tomcat](https://medium.com/@patelvidhi4288/deep-dive-poc-of-cve-2024-50379-exploiting-tomcat-vulnerabilities-9-8-severity-694b1a65c4bd)

---

## License

This repository is provided under the [MIT License](LICENSE).
文件快照

登录后查看神龙缓存的 POC 文件快照

登录查看
备注
    1. 建议优先通过来源进行访问。
    2. 本地 POC 快照面向订阅用户开放;当原始来源失效或无法访问时,本地镜像作为订阅权益的一部分提供。
    3. 持续抓取、验证、维护这份 POC 档案需要不少投入,因此本地快照已纳入付费订阅。您的订阅是让这份资料能继续走下去的关键,由衷感谢。 查看订阅方案 →