Summary
JeeSite v5.15.1 contains a path traversal flaw in the fileMd5 parameter of the /a/file/upload endpoint when chunked uploads are enabled.
An authenticated user with file upload permissions can abuse this to write files with allowed suffixes to arbitrary locations on the server's filesystem, enabling scenarios such as web shell placement or configuration tampering depending on server setup.
Affected context
The vulnerability appears in JeeSite deployments that:
- Run version 5.15.1 (or code with equivalent upload logic),
- Have the
/a/file/uploadendpoint accessible to authenticated users, - Enable chunked file uploads, and
- Use the
fileMd5parameter to build or influence server-side file paths.
In such environments, the upload implementation does not sufficiently neutralize path components derived from user input, allowing crafted values to influence where chunks and final files are stored.
Exploit preconditions
- Attack surface: HTTP(S) interface exposed by the JeeSite application, specifically the
/a/file/uploadendpoint. - Required access: Valid authenticated account with file upload permissions; no direct filesystem access required.
- Configuration predicates:
- Chunked upload functionality must be enabled.
- Upload handler must accept and use
fileMd5to construct file paths or filenames. - Trigger point: Submission of upload requests (including chunked upload operations) where
fileMd5contains path traversal sequences or filesystem-relevant components. - Why exploitation is possible: The server-side upload logic trusts
fileMd5as a safe identifier and incorporates it into filesystem paths without robust normalization and validation, so directory traversal sequences or crafted path fragments are honored by the filesystem.
Why this happens
This issue is rooted in improper input validation and path handling when constructing filesystem paths in the upload pipeline.
The application appears to treat the fileMd5 parameter as a benign identifier but uses it directly (or after insufficient checks) in directory or filename construction.
When user-controllable data is concatenated into filesystem paths without strict normalization, canonicalization, and enforcement of an allowed directory scope, attackers can inject ../ or equivalent traversal patterns to escape the intended upload directory.
This behavior aligns with CWE-22: Improper Limitation of a Pathname to a Restricted Directory, where an application fails to restrict pathnames to a safe base directory and improperly trusts user-controllable data for path assembly.
Potential impact
- Placement of files with whitelisted suffixes in arbitrary directories writable by the application.
- Potential upload of executable scripts or templates into web-accessible directories, which may enable remote code execution depending on server configuration.
- Overwriting or shadowing application resources, logs, or configuration files that share allowed suffixes, leading to application misbehavior or denial of service.
- Planting files that facilitate privilege escalation or lateral movement in multi-tenant or shared-hosting environments.
- Bypassing intended upload storage policies and integrity controls.
General mitigation guidance
Effective mitigation focuses on constraining how user-controlled values influence filesystem paths and on hardening the upload pipeline:
- Strict path construction:
- Derive all filesystem paths from server-side constants and controlled identifiers, not directly from client-supplied parameters like
fileMd5. - Treat
fileMd5as data only (e.g., a key in a database), not as a path segment.
- Canonicalization and validation:
- Normalize paths before use and verify that the resolved path remains under an intended base upload directory.
- Reject any input that, after normalization, would escape or reference locations outside the designated storage root.
- Whitelist-based naming:
- Map user-supplied identifiers to server-generated filenames (e.g., random UUIDs or hashed names) while storing original metadata separately.
- Maintain a strict whitelist of allowed file extensions and validate them on the server, independent of client-supplied names.
- Filesystem and runtime hardening:
- Run the application with least-privilege filesystem permissions, limiting write access to a dedicated uploads directory.
- Consider using non-executable storage locations for uploaded files and separating them from code directories.
- Defensive coding patterns:
- Centralize file operations behind a safe abstraction that consistently enforces directory bounds and normalization.
- Avoid ad-hoc string concatenation for paths; instead use framework or language APIs that provide safer path joining and validation.
How teams detect issues like this
Detection typically involves a mix of code-centric and operational controls:
- Static analysis and code scanning:
- Search for file and directory operations that combine user-controlled variables (like request parameters) with base paths using simple concatenation.
- Add rules to static analysis tools to flag path constructions involving
.., absolute path prefixes, or trust of identifiers likefileMd5in paths.
- Code review practices:
- During reviews, specifically scrutinize upload handlers and storage utilities for:
- Direct usage of request parameters in path assembly.
- Missing checks that enforce a single, immutable upload root directory.
- Lack of path normalization and canonicalization before filesystem access.
- Verify that upload endpoints do not store files in or near executable code directories.
- Runtime and logging signals:
- Enable detailed logging for upload operations, including resolved paths and rejected attempts, while avoiding sensitive data exposure.
- Monitor logs and SIEM dashboards for upload requests with suspicious patterns in metadata or repeated failed uploads.
- Security testing:
- Integrate path traversal-focused tests into regular application security testing (DAST), specifically targeting file upload flows and chunked upload paths.

