/

CVE-2026-36762

Severity:

HIGH RISK

(8.8)

Path Traversal in JeeSite upload Endpoint

CVE-2026-36762

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Arbitrary File Write to Unintended Locations

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

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/upload endpoint
  • Required access: Valid authenticated account with permission to upload files
  • User-controlled input: fileEntityId parameter included with the file upload request
  • Trigger point: Server-side path construction when saving the uploaded file
  • Why exploitation is possible: The application incorporates fileEntityId directly 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 fileEntityId for 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.

Sources

SourceLink
github.comgithub.com/thinkgem/jeesite
github.comgithub.com/thinkgem/jeesite/issues/529

Frequently asked

questions

Yes, but only through authenticated access. An attacker must be able to send HTTP requests to the /a/file/upload endpoint and hold valid credentials with file upload permissions.

Not necessarily. Any account granted file upload rights can be sufficient, as long as it can control the fileEntityId parameter. Elevated application roles are not strictly required.

Remove reliance on user-controllable values for filesystem paths, introduce strict canonicalization, and enforce that all resolved paths remain under a predefined upload root. Combine this with non-executable upload directories and server-side controlled filenames.

Establish a standard file storage abstraction that always anchors paths to known safe roots, forbid direct concatenation of request parameters into paths, and enforce these patterns via code review and automated checks in the CI pipeline.

Find out what's already
exploitable in your codebase.