Summary
JeeSite v5.15.1 contains a path traversal flaw in the fileEntityId parameter of the /a/file/upload endpoint that allows writing files outside the intended upload directory.
An authenticated attacker with file upload permissions can abuse this to place arbitrary files with allowed extensions into sensitive filesystem locations, enabling configuration tampering, data overwrite, or potential code execution depending on server setup.
Affected context
This vulnerability exists in JeeSite v5.15.1 deployments that expose the /a/file/upload endpoint and grant users file upload capabilities.
The issue manifests when the server constructs filesystem paths from the fileEntityId parameter without fully normalizing or constraining it to a dedicated upload directory.
Environments where uploaded files are later interpreted as configuration, templates, or executable code are particularly exposed, even though the server enforces a whitelist of file suffixes.
Exploit preconditions
- Attack surface: HTTP(S) interface on the
/a/file/uploadendpoint - Required access: Valid authenticated account with permission to upload files
- User-controlled input:
fileEntityIdparameter included with the file upload request - Trigger point: Server-side path construction when saving the uploaded file
- Why exploitation is possible: The application incorporates
fileEntityIddirectly or partially into filesystem paths without adequate canonicalization or enforcement of a fixed base directory, allowing../or similar traversal sequences to escape the intended upload location.
Why this happens
The root cause is improper restriction of a path used for file operations, aligning with CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
The backend logic relies on a user-supplied parameter (fileEntityId) to determine where an uploaded file is stored but does not strictly resolve and validate the resulting path against a known safe root.
Even though file extensions are constrained to a whitelist, the directory component remains attacker-controlled, making it possible to write allowed file types into arbitrary directories such as configuration folders, web roots, or application resource paths.
Potential impact
- Placement of attacker-controlled files (with whitelisted extensions) into sensitive directories
- Overwriting of existing files if naming collisions occur in traversed locations
- Introduction or modification of web-accessible resources that could enable indirect code execution in some configurations
- Tampering with application behavior by altering configuration, template, or data files
- Establishment of a persistent foothold by planting files that are subsequently loaded or trusted by the application or other processes
General mitigation guidance
Effective mitigation focuses on constraining all filesystem operations to controlled directories and removing trust from user-influenced path components.
Useful patterns include:
- Deriving storage paths solely from server-side identifiers and ignoring user-provided directory elements such as
fileEntityIdfor path composition. - Normalizing and canonicalizing any path before use, then enforcing that the resolved path starts with an expected upload root directory.
- Using fixed, segregated upload directories that are not within executable or configuration paths (e.g., outside the web root).
- Applying strict file naming strategies (e.g., random UUIDs) determined on the server, independent of client parameters.
- Restricting filesystem permissions so that the application process cannot write to configuration directories, code directories, or other sensitive locations.
How teams detect issues like this
Organizations can look for this class of issue through:
- Static analysis rules that flag uses of request parameters (like
fileEntityId) in filesystem APIs (e.g.,File,Path,FileOutputStream) without prior canonicalization and base-path checks. - Code reviews focused on upload handlers and storage utilities, verifying that all write paths are derived from trusted, server-side values and confined to known directories.
- Runtime logging and monitoring that captures unusual file write patterns, such as uploads creating or modifying files outside the expected upload tree.
- Security testing and DAST scans that attempt uploads using typical traversal patterns (
../,%2e%2e/, nested traversal chains) to detect unintended write locations.

