CVE-2025-66905

7.5 HIGH

📋 TL;DR

CVE-2025-66905 is a path traversal vulnerability in the Takes web framework that allows remote attackers to read arbitrary files from the host system by including directory traversal sequences (../) in HTTP request paths. This affects applications using Takes framework version 2.0-SNAPSHOT and earlier that serve files via TkFiles. The vulnerability enables unauthorized file access without proper path canonicalization.

💻 Affected Systems

Products:
  • Takes web framework
Versions: All versions through 2.0-SNAPSHOT
Operating Systems: All operating systems running Java
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects applications using TkFiles take to serve files. Applications not using file serving functionality are not vulnerable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete system compromise through reading sensitive files like /etc/passwd, SSH keys, configuration files, or database credentials, potentially leading to lateral movement and data exfiltration.

🟠

Likely Case

Unauthorized reading of application configuration files, source code, or sensitive data files stored on the same server as the web application.

🟢

If Mitigated

Limited impact if proper file system permissions restrict web user access and sensitive files are stored outside web-accessible directories.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Exploitation requires only HTTP requests with path traversal sequences. The public report includes demonstration of the vulnerability.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Not yet released

Vendor Advisory: https://github.com/yegor256/takes

Restart Required: Yes

Instructions:

1. Monitor the Takes GitHub repository for security updates. 2. Apply the patch when available. 3. Restart affected applications after patching.

🔧 Temporary Workarounds

Implement path validation middleware

all

Add custom request filtering to reject paths containing directory traversal sequences before they reach TkFiles.

Implement Java filter that checks request.getPath() for '../' sequences and returns 400 Bad Request if found

Use alternative file serving

all

Replace TkFiles with a different file serving component that properly canonicalizes paths.

Replace TkFiles usage with secure alternatives like properly configured static file handlers

🧯 If You Can't Patch

  • Implement web application firewall (WAF) rules to block requests containing directory traversal patterns
  • Restrict file system permissions for the web application user to limit accessible directories

🔍 How to Verify

Check if Vulnerable:

Test by sending HTTP requests with ../ sequences to file endpoints and checking if restricted files are accessible.

Check Version:

Check pom.xml or build.gradle for takes dependency version, or check runtime with: java -cp takes.jar org.takes.Version

Verify Fix Applied:

After applying workarounds, test that path traversal attempts return error responses instead of file contents.

📡 Detection & Monitoring

Log Indicators:

  • HTTP requests containing '../' or '..\' sequences in URLs
  • Unusual file access patterns from web application user

Network Indicators:

  • HTTP requests with encoded traversal sequences (%2e%2e%2f)
  • Multiple failed attempts followed by successful file reads

SIEM Query:

source="web_logs" AND (url="*../*" OR url="*..\\*" OR url="*%2e%2e%2f*")

🔗 References

📤 Share & Export