Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2025-6108 Overview
CVE-2025-6108 is a path traversal vulnerability [CWE-22] in the hansonwang99 Spring-Boot-In-Action project. The flaw resides in the watermarkTest function of /springbt_watermark/src/main/java/cn/codesheep/springbt_watermark/service/ImageUploadService.java within the File Upload component. Attackers can manipulate the filename argument to traverse directories outside the intended upload path. The attack is launchable remotely and requires low privileges. A public exploit has been disclosed, and the project uses a rolling-release model, meaning no fixed version boundary is published. The vendor was contacted but did not respond.
Critical Impact
Remote attackers with low privileges can read or write files outside the intended directory by injecting traversal sequences into the filename parameter of the file upload endpoint.
Affected Products
- hansonwang99 Spring-Boot-In-Action (all revisions up to commit 807fd37643aa774b94fd004cc3adbd29ca17e9aa)
- springbt_watermark module, specifically ImageUploadService.java
- Downstream forks and derivatives that reuse the vulnerable watermarkTest logic
Discovery Timeline
- 2025-06-16 - CVE-2025-6108 published to NVD
- 2026-06-17 - Last updated in NVD database
Technical Details for CVE-2025-6108
Vulnerability Analysis
The vulnerability exists in the watermarkTest handler of ImageUploadService.java, part of the springbt_watermark demo module. The service accepts a user-controlled filename value during image upload processing without validating or canonicalizing the path. Attackers submit sequences such as ../ within the filename to escape the upload directory. Successful exploitation leads to writing files to arbitrary locations on the host filesystem, with corresponding impact on confidentiality, integrity, and availability. Because the project ships as a continuously updated reference application, administrators often integrate the code directly into derivative Spring Boot services, propagating the flaw. The exploit prediction score places this issue in the 42nd EPSS percentile.
Root Cause
The handler trusts the client-supplied filename and concatenates it into a server-side path without applying java.nio.file.Path normalization, allow-listing, or rejection of parent-directory tokens. This is a textbook [CWE-22] Improper Limitation of a Pathname to a Restricted Directory flaw.
Attack Vector
An authenticated remote attacker sends a crafted multipart upload to the watermark endpoint, placing traversal sequences in the filename field. The server resolves the path relative to the upload directory and writes the uploaded content to the attacker-chosen location, which may include web-accessible directories or application configuration paths.
// No verified exploit code available. See the public PoC for request details:
// https://github.com/ShenxiuSec/cve-proofs/blob/main/POC-20250607-01.md
Source: GitHub PoC Repository
Detection Methods for CVE-2025-6108
Indicators of Compromise
- Upload requests to the watermark endpoint containing ../, ..\, URL-encoded %2e%2e%2f, or absolute paths in the filename field.
- Newly created files in directories outside the configured watermark upload path, especially in web roots or application resource folders.
- Access log entries referencing ImageUploadService with abnormally long or encoded filename parameters.
Detection Strategies
- Inspect multipart form data at the application gateway or WAF for traversal tokens in the filename parameter.
- Enable Spring Boot request logging and alert on Content-Disposition headers containing path separators.
- Perform file-integrity monitoring on application directories to detect unauthorized file writes originating from the Java process.
Monitoring Recommendations
- Forward application and web server logs to a centralized analytics platform to correlate upload activity with file-system changes.
- Baseline normal upload filenames and alert on deviations such as traversal characters, null bytes, or binary extensions in unexpected contexts.
- Monitor process execution from directories writable by the Spring Boot service account to catch post-upload code execution attempts.
How to Mitigate CVE-2025-6108
Immediate Actions Required
- Remove or disable the springbt_watermark demo module in any production or internet-facing deployment.
- Audit forks and internal projects that imported ImageUploadService.java and patch the watermarkTest function to validate filenames.
- Restrict the service account running the Spring Boot application to a minimal, non-writable filesystem scope outside the upload directory.
Patch Information
No vendor patch is available. The maintainer did not respond to the disclosure, and the project uses a rolling-release model without versioned fixes. Consumers must apply a code-level fix locally, replacing the vulnerable concatenation with a canonicalized path check that rejects any resolved path falling outside the configured upload root.
Workarounds
- Replace the client-supplied filename with a server-generated identifier such as a UUID before writing to disk.
- Validate the resolved path using Path.normalize() and verify it starts with the canonical upload directory prefix.
- Deploy a web application firewall rule that blocks filename values containing .., forward slashes, backslashes, or encoded equivalents.
# Example WAF rule concept (ModSecurity) to block traversal in multipart filename
SecRule MULTIPART_FILENAME "@rx (\.\.|/|\\|%2e%2e|%2f|%5c)" \
"id:1006108,phase:2,deny,status:400,log,msg:'CVE-2025-6108 path traversal attempt in filename'"
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

