CVE-2025-66905
Executive Summary
CVE-2025-66905 is a critical path traversal vulnerability in the Takes web framework, specifically within the TkFiles component up to version 2.0-SNAPSHOT. The vulnerability arises from the framework's failure to canonicalize HTTP request paths before resolving them against the filesystem. This allows a remote, unauthenticated attacker to inject ../ sequences into the request path, escaping the configured base directory and reading arbitrary files from the host system. The vulnerability has a CVSS score of 0.0 (placeholder) but is assessed as high severity due to the potential for complete data exfiltration. No official patch has been released, and the vendor (Takes) has not provided a security advisory.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability affects the Takes web framework, which is distributed as a Java library (likely via Maven Central). Organizations using Takes as a dependency in their Java web applications are at risk. The lack of a patch means that any application using the vulnerable version is exposed. Supply chain risk is elevated because the vulnerability is in a core framework component (TkFiles) that handles static file serving. Developers should immediately audit their dependencies and consider replacing the vulnerable component with a secure alternative or implementing a Web Application Firewall (WAF) rule to block path traversal attempts.
CVSS Breakdown & Threat Level
CVSS Score: 0.0 (placeholder, assessed as 7.5 High) Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
- Attack Vector (AV): Network – The vulnerability can be exploited remotely over the network.
- Attack Complexity (AC): Low – No special conditions or race conditions are required.
- Privileges Required (PR): None – No authentication is needed.
- User Interaction (UI): None – The victim does not need to perform any action.
- Scope (S): Unchanged – The vulnerable component and the attacker are in the same security authority.
- Confidentiality (C): High – Arbitrary file read can expose sensitive data (e.g., configuration files, credentials, source code).
- Integrity (I): None – The vulnerability does not allow file modification.
- Availability (A): None – The vulnerability does not affect system availability.
Threat Level: High. The ease of exploitation and the potential for data exfiltration make this a critical risk for any exposed instance.
Deep Dive & Mechanics
The vulnerability exists in the TkFiles class of the Takes web framework. This class is responsible for serving static files from a configured base directory. The flaw is that the framework does not canonicalize the HTTP request path before using it to construct a filesystem path.
Normal Operation:
A request to /static/css/style.css would be resolved against the base directory (e.g., /var/www/static/) to read /var/www/static/css/style.css.
Exploitation:
An attacker can send a request like /static/../../etc/passwd. The framework fails to normalize the path, so it resolves to /var/www/static/../../etc/passwd, which simplifies to /etc/passwd. This allows the attacker to read any file on the filesystem that the web server process has read access to.
Root Cause:
The TkFiles class likely uses a simple string concatenation or File constructor without calling getCanonicalPath() or normalize() before serving the file. This is a classic path traversal vulnerability (CWE-22).
Vulnerable vs. Patched Code
Vulnerable Code (Conceptual):
// Vulnerable TkFiles implementation
public class TkFiles implements Take {
private final File base;
public TkFiles(File base) {
this.base = base;
}
@Override
public void act(Request req, Response res) throws IOException {
String path = req.path(); // e.g., "/static/../../etc/passwd"
File file = new File(this.base, path); // No canonicalization
if (file.exists() && !file.isDirectory()) {
// Serve the file
res.body(file);
} else {
res.status(404);
}
}
}
Patched Code (Conceptual):
// Patched TkFiles implementation
public class TkFiles implements Take {
private final File base;
public TkFiles(File base) {
this.base = base;
}
@Override
public void act(Request req, Response res) throws IOException {
String path = req.path();
File file = new File(this.base, path);
// Canonicalize to resolve ".." and symlinks
String canonicalPath = file.getCanonicalPath();
String baseCanonicalPath = this.base.getCanonicalPath();
// Ensure the resolved path is within the base directory
if (canonicalPath.startsWith(baseCanonicalPath)) {
if (file.exists() && !file.isDirectory()) {
res.body(file);
} else {
res.status(404);
}
} else {
res.status(403); // Forbidden
}
}
}
Key Difference: The patched version uses getCanonicalPath() to resolve the path and then checks that the resolved path starts with the canonical base directory path. This prevents directory traversal.
Exploitation & Lab Setup
Red Team (Offensive)
Lab Setup:
- Vulnerable Application: Deploy a Java web application using Takes 2.0-SNAPSHOT with
TkFilesconfigured to serve files from a directory (e.g.,/var/www/static). - Attacker Machine: Use a Linux machine with
curlor a web browser.
Exploitation Steps:
- Identify the endpoint: Find the URL path that serves static files (e.g.,
http://target:8080/static/). - Craft the payload: Use
../sequences to traverse directories.curl --path-as-is "http://target:8080/static/../../etc/passwd" - Read sensitive files:
# Read /etc/passwd curl --path-as-is "http://target:8080/static/../../etc/passwd" # Read application configuration curl --path-as-is "http://target:8080/static/../../WEB-INF/web.xml" # Read environment variables or secrets curl --path-as-is "http://target:8080/static/../../proc/self/environ"
Expected Output: The contents of the requested file will be returned in the HTTP response.
Blue Team (Defensive)
Detection:
- Monitor Web Server Logs: Look for requests containing
../or..%2f(URL-encoded) in the path. - File Integrity Monitoring (FIM): Monitor for unexpected reads of sensitive files (e.g.,
/etc/passwd,/etc/shadow). - WAF Rules: Deploy a Web Application Firewall with rules to block path traversal patterns.
Mitigation:
- Immediate: If possible, disable the
TkFilescomponent or restrict its usage to a non-sensitive directory. - Short-term: Implement a reverse proxy (e.g., Nginx, Apache) to serve static files instead of using
TkFiles. - Long-term: Upgrade to a patched version of Takes once available, or replace the framework with a secure alternative.
Indicators of Compromise (IOCs)
Network IOCs:
- HTTP requests with multiple
../sequences in the URL path. - Requests to paths like
/static/../../etc/passwd,/assets/../../../etc/shadow. - URL-encoded variants:
%2e%2e%2f(..%2f) or%2e%2e%5c(..%5c) for Windows. - Unusual file reads from
/etc/,/proc/,/WEB-INF/, or other sensitive directories.
File System IOCs:
- Unexpected access to
/etc/passwd,/etc/shadow,/etc/hosts,/proc/self/environ. - Access to application configuration files outside the web root (e.g.,
WEB-INF/web.xml,application.properties).
Log IOCs:
- Web server access logs showing
200responses for requests containing../. - Error logs showing
FileNotFoundExceptionfor paths that include../(if the file doesn't exist).
Detection Engineering
YARA Rule
rule CVE_2025_66905_Path_Traversal {
meta:
description = "Detects path traversal attempts targeting CVE-2025-66905 in Takes framework"
author = "Valters IT"
date = "2025-04-10"
severity = "high"
strings:
$path_traversal = /(\.\.\/|\.\.%2f|%2e%2e%2f|%2e%2e\/)/
$sensitive_file = /(etc\/passwd|etc\/shadow|proc\/self|WEB-INF|boot\.ini)/
condition:
any of ($path_traversal) and any of ($sensitive_file)
}
Sigma Rule
title: CVE-2025-66905 Path Traversal Attempt
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects HTTP requests with path traversal sequences targeting Takes TkFiles
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
service: access
detection:
selection:
cs-uri-query|contains:
- '..%2f'
- '..%5c'
- '../'
- '..\\'
condition: selection
falsepositives:
- Legitimate use of '..' in URL parameters (rare)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-66905 Path Traversal Attempt"; flow:to_server,established; content:"..%2f"; http_uri; nocase; sid:1000001; rev:1;)
alert http any any -> any any (msg:"CVE-2025-66905 Path Traversal Attempt"; flow:to_server,established; content:"../"; http_uri; nocase; sid:1000002; rev:1;)
alert http any any -> any any (msg:"CVE-2025-66905 Path Traversal Attempt"; flow:to_server,established; content:"..%5c"; http_uri; nocase; sid:1000003; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable TkFiles: If the application does not require static file serving, remove or disable the
TkFilescomponent. - Use a Reverse Proxy: Configure Nginx or Apache to serve static files directly, bypassing the vulnerable Java component.
- WAF Rules: Deploy a Web Application Firewall (e.g., ModSecurity, Cloudflare) with rules to block path traversal patterns.
Short-term Actions:
- Input Validation: If you must use
TkFiles, implement a custom filter that canonicalizes the path and rejects any request that attempts to escape the base directory. - Monitor Logs: Actively monitor web server logs for path traversal attempts.
Long-term Actions:
- Patch: Await an official patch from the Takes project. If none is forthcoming, consider forking the project and applying the fix yourself.
- Replace Framework: Migrate to a more secure web framework that properly handles path canonicalization (e.g., Spring Boot, Vert.x).
- Security Audit: Conduct a thorough security audit of all dependencies to identify similar vulnerabilities.
Valters IT Signature: This report was generated by Valters IT DevSecOps AI. For questions, contact security@valters-it.com.
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.