Skip to content
KitploitKITPLOIT
工具漏洞利用博客
Log in
提交
工具漏洞利用博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

订阅源联系隐私© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
Apache-Tomcat-CVE-2020-9484 — Analysis of CVE-2020-9484 in Apache Tomcat: patch diff review, lab setup with PersistentManager/FileStore, and JDWP debugging to trace the session path traversal to deserialization RCE. | Kitploit
工具/GitHubGitHub/crieheiki/apache-tomcat-cve-2020-9484
Vulnerability AnalysisCode AnalysisExploitationWeb Application ExploitationDebuggersWeb SecurityPapers & ResearchLearning & EducationLabs & Practice
GitHubcrieheiki/apache-tomcat-cve-2020-9484

Apache-Tomcat-CVE-2020-9484

Analysis of CVE-2020-9484 in Apache Tomcat: patch diff review, lab setup with PersistentManager/FileStore, and JDWP debugging to trace the session path traversal to deserialization RCE.

2026年12月4日尚未审核
查看仓库
分享
内容在请求的语言中不可用。显示英文版本。

Apache-Tomcat-CVE-2020-9484

Introduction

CVE-2020-9484 is a security vulnerability belonging to the Insecure Deserialization class, present in Apache Tomcat's session persistence mechanism. This vulnerability can allow an attacker to achieve Remote Code Execution (RCE) under certain conditions.

The affected Apache Tomcat versions include:

  • Apache Tomcat 10.0.0-M1 to 10.0.0-M4
  • Apache Tomcat 9.0.0.M1 to 9.0.34
  • Apache Tomcat 8.5.0 to 8.5.54
  • Apache Tomcat 7.0.0 to 7.0.103

To successfully exploit the vulnerability, the following conditions must be met simultaneously:

  • The attacker is able to control the content and name of a file that exists on the server (for example, through a File Upload feature that is not strictly validated).
  • The server is configured to use PersistentManager in combination with FileStore.
  • PersistentManager is configured with sessionAttributeValueClassNameFilter="null" or a filter loose enough to allow deserialization of attacker-supplied objects.
  • The attacker knows the relative path from the FileStore session storage directory to the file controlled by the attacker.

The root cause of CVE-2020-9484 lies in the fact that FileStore uses the client-controlled Session ID to construct the path to the session file without fully validating the storage directory boundary. When PersistentManager attempts to restore a session that does not exist in memory, an attacker can leverage Path Traversal to cause Tomcat to read and deserialize a malicious file located outside the session-store, thereby leading to RCE if the exploitation conditions are met.

Patch Analysis

The CVE-2020-9484 patch adds a file path validation mechanism in the file(String id) method of the FileStore class.

private File file(String id) throws IOException {
-    if (this.directory == null) {
+    File storageDir = directory();
+    if (storageDir == null) {
         return null;
     }

     String filename = id + FILE_EXT;
-    File file = new File(directory(), filename);
+    File file = new File(storageDir, filename);
+
+    // Check the file is within the storage directory
+    if (!file.getCanonicalPath().startsWith(storageDir.getCanonicalPath())) {
+        log.warn(sm.getString("fileStore.invalid", file.getPath(), id));
+        return null;
+    }

     return file;
}

Before being patched, FileStore.file(String id) used the Session ID directly to construct the path to the session file without checking whether the resulting path still resided within the storage directory. This allowed an attacker to use Path Traversal to access files outside the session-store.

To fix this, the patch adds a comparison of file.getCanonicalPath() with storageDir.getCanonicalPath(). If the file path does not start with the storage directory path, the method logs a warning and returns null.

Thus, the patch aims to prevent the Session ID from being used to reference files located outside the session storage directory.

Environment Setup

To analyze CVE-2020-9484, I built a test environment using Apache Tomcat 9.0.34, a version affected by the vulnerability. The environment was deployed on an Ubuntu Server virtual machine via VirtualBox, while a Windows 11 machine served to send HTTP requests and perform remote debugging with IntelliJ IDEA.

The components used in the test environment include:

ComponentConfiguration
Host OSWindows 11
VirtualizationVirtualBox
Guest OSUbuntu Server
Apache Tomcat9.0.34
JavaEclipse Temurin JDK 8u514
Build ToolApache Ant 1.10.18
DebuggerIntelliJ IDEA
NetworkNAT + Host-only
Target IP192.168.56.103
HTTP Port8080
Debug Port5005

1. Apache Tomcat Configuration

Apache Tomcat 9.0.34 was compiled directly from source code using Apache Ant to support source code analysis and breakpoint setting.

Tomcat is configured with two paths:

  • CATALINA_HOME=/opt/tomcat-lab/runtime/build
  • CATALINA_BASE=/opt/tomcat-lab/instance/cve-2020-9484

To meet the exploitation conditions for CVE-2020-9484, Tomcat is configured to use PersistentManager in combination with FileStore instead of the default session management mechanism.

The session storage directory is set at:

/opt/tomcat-lab/instance/cve-2020-9484/session-store

In addition, I deployed a simple web application named session-lab, accessible at:

http://192.168.56.103:8080/session-lab/

This application supports two functions:

  • action=set: Creates or accesses a session and stores a value in a session attribute.
  • action=read: Accesses an existing session and reads the stored session attribute value.

The application is used to generate HTTP requests for observing the session handling process inside Tomcat.

2. Attacker-Controlled File

Outside Tomcat's session storage directory, I planned to create a separate directory on the Ubuntu Server to hold a file named exploit.session.

For example, the directory structure in the lab is as follows:

/opt/tomcat-lab/
├── runtime/
│   └── build/
├── instance/
│   └── cve-2020-9484/
│       ├── conf/
│       ├── logs/
│       ├── webapps/
│       ├── work/
│       └── session-store/
└── attacker-files/
    └── exploit.session

Where:

  • session-store/: The directory configured in FileStore for storing application sessions.
  • attacker-files/: A separate directory simulating a location where an attacker could potentially control file contents on the system.
  • exploit.session: A file prepared to simulate attacker-controlled data, for researching deserialization behavior.

In this scenario, I assume the attacker already has the ability to place a file with a controlled name and content onto the server's filesystem, and that the file can be read by the Tomcat process. The process of uploading or writing the file to the server is outside the scope of the test.

Unlike the session files normally stored by Tomcat, exploit.session is placed outside the session-store directory. The purpose of this arrangement is to test whether a client-supplied Session ID can cause Tomcat to access a file located outside the configured session storage directory.

3. Remote Debugging

To monitor the execution process, Tomcat is started with Java Debug Wire Protocol (JDWP), using port 5005 on the Ubuntu Server.

The Windows machine connects to the debugger through an SSH tunnel, forwarding port 127.0.0.1:5005 on Windows to the JDWP port of the virtual machine.

Then, IntelliJ IDEA is configured with Remote JVM Debug to connect to the running Tomcat process.

With this environment, I can send HTTP requests from Windows to the session-lab application, while using breakpoints in IntelliJ IDEA to observe how Tomcat processes the Session ID and interacts with session files on the filesystem.

In particular, the separately placed exploit.session file serves the process of examining and identifying the root cause of CVE-2020-9484 in the Debugging & Root Cause Analysis section.

Understanding Session Persistence

CoyoteAdapter is the intermediary component between the HTTP protocol handling layer (Coyote) and the Servlet Container layer (Catalina) of Apache Tomcat. This class is responsible for preparing the HTTP request before it is passed into the Servlet Container's processing.

During request processing, the postParseRequest() method is responsible for determining the Session ID supplied by the client through the configured session tracking mechanisms, such as URL, Cookie, or SSL.

After the Session ID is extracted, this value is stored in the requestedSessionId attribute of the Request object. However, this does not mean that the corresponding session already exists or is valid.

When the application requests access to a session, Tomcat uses the doGetSession(boolean create) method in the Request class to look up or create a session.

下载工具

相关工具

  • nuclei

    基于 YAML 的快速漏洞扫描器,采用模板驱动的检测引擎,可对 Web 应用、API、网络、DNS 和云基础设施进行自动化安全测试。

  • zaproxy

    开源Web应用安全扫描器,支持自动化漏洞检测、手动渗透测试和API安全测试,并内置基于代理的拦截引擎。

  • openvas-scanner

    该仓库包含 Greenbone Community Edition 的扫描器组件。

最受欢迎

查看全部 →

发现我们社区最常用的工具。

  • 1

    Callisto

    jetp1ane/callisto

    自动化二进制漏洞分析工具,通过Ghidra反编译可执行文件,使用Semgrep扫描伪C代码,并利用GPT-3.5-Turbo验证发现以减少误报。

    796
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    针对 CVE-2026-43499 的一键式 Android 内核漏洞利用应用,通过内核模块加载实现权限提升,并提供偏移提取与设备端分析工具。

    735
  • 3

    IMSIcatcher

    28zaaky/imsicatcher

    IMSI Catcher 平台,可部署伪基站 GSM 小区以拦截短信、注入消息并追踪移动设备

    721
  • 4

    opencti

    opencti-platform/opencti

    开放式网络威胁情报平台

    535
  • 5

    ARTEX

    baarai/artex

    基于LLM的多智能体自主渗透测试平台,具备规划器/执行器智能体、资产与探索图谱、MITM流量记录以及漏洞复测功能。

    424
  • 6

    DFRoot

    a2333c/dfroot

    Android root tool for Samsung Galaxy S25 Ultra (SM-S938B) that chains DirtyFrag CVE-2026-43284 and CVE-2026-43499 to gain root automatically at boot via KernelSU.

    419

探索所有工具

浏览我们的工具集合

查看所有工具 →