CVE-2025-6108

6.3 MEDIUM

📋 TL;DR

This critical vulnerability in Spring-Boot-In-Action allows attackers to perform path traversal attacks via the filename parameter in the watermarkTest function. Remote attackers can potentially access, modify, or delete files outside the intended directory. All users of affected versions are at risk.

💻 Affected Systems

Products:
  • hansonwang99 Spring-Boot-In-Action
Versions: All versions up to commit 807fd37643aa774b94fd004cc3adbd29ca17e9aa
Operating Systems: All platforms running Java/Spring Boot
Default Config Vulnerable: ⚠️ Yes
Notes: Affects the File Upload component specifically. Rolling release model means exact version numbers are not available.

⚠️ Manual Verification Required

This CVE does not have specific version information in our database, so automatic vulnerability detection cannot determine if your system is affected.

Why? The CVE database entry doesn't specify which versions are vulnerable (no version ranges provided by the vendor/NVD).

🔒 Custom verification scripts are available for registered users. Sign up free to download automated test scripts.

Recommended Actions:
  1. Review the CVE details at NVD
  2. Check vendor security advisories for your specific version
  3. Test if the vulnerability is exploitable in your environment
  4. Consider updating to the latest version as a precaution

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete system compromise through arbitrary file read/write/delete, potentially leading to sensitive data exposure, system takeover, or ransomware deployment.

🟠

Likely Case

Unauthorized file access leading to information disclosure, configuration file tampering, or denial of service through critical file deletion.

🟢

If Mitigated

Limited impact with proper file permission restrictions and input validation in place.

🌐 Internet-Facing: HIGH - Attack can be launched remotely without authentication, making internet-facing instances particularly vulnerable.
🏢 Internal Only: MEDIUM - Internal systems are still vulnerable but require network access, reducing exposure surface.

🎯 Exploit Status

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

Proof of concept is publicly available on GitHub. The vulnerability is straightforward to exploit with basic path traversal techniques.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Not available

Vendor Advisory: Not available - vendor did not respond to disclosure

Restart Required: No

Instructions:

No official patch available. Consider migrating to a maintained fork or implementing workarounds.

🔧 Temporary Workarounds

Input Validation and Sanitization

all

Implement strict input validation to reject filenames containing path traversal sequences

Implement filename validation in ImageUploadService.java to reject ../, ..\, and similar sequences

File Path Canonicalization

all

Use canonical paths and ensure uploaded files stay within designated directories

Use Path.normalize() and Path.toAbsolutePath() in Java to prevent directory traversal

🧯 If You Can't Patch

  • Implement WAF rules to block requests containing path traversal patterns in filename parameters
  • Restrict file system permissions for the application to limit potential damage scope

🔍 How to Verify

Check if Vulnerable:

Check if your Spring-Boot-In-Action version includes commit 807fd37643aa774b94fd004cc3adbd29ca17e9aa or earlier. Review ImageUploadService.java for filename parameter handling.

Check Version:

git log --oneline | grep -i 'spring-boot-in-action' or check project commit history

Verify Fix Applied:

Test file upload functionality with malicious filenames containing ../ sequences to ensure they are rejected.

📡 Detection & Monitoring

Log Indicators:

  • Multiple failed file upload attempts with suspicious filenames
  • Access to files outside expected upload directories
  • Error logs showing path traversal attempts

Network Indicators:

  • HTTP requests with ../ or ..\ in filename parameters
  • Unusual file access patterns from single IPs

SIEM Query:

source="web_logs" AND (filename="*../*" OR filename="*..\\*") AND status=200

🔗 References

📤 Share & Export