/

CVE-2026-36760

Severity:

CRITICAL RISK

(9.6)

Path Traversal in JeeSite upload Endpoint

CVE-2026-36760

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Arbitrary File Write to Server Filesystem

Severity:

CRITICAL RISK

(9.6)

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 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/upload endpoint accessible to authenticated users,
  • Enable chunked file uploads, and
  • Use the fileMd5 parameter 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/upload endpoint.
  • 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 fileMd5 to construct file paths or filenames.
  • Trigger point: Submission of upload requests (including chunked upload operations) where fileMd5 contains path traversal sequences or filesystem-relevant components.
  • Why exploitation is possible: The server-side upload logic trusts fileMd5 as 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 fileMd5 as 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 like fileMd5 in 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.

Sources

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

Frequently asked

questions

Exploitation is limited to authenticated users who have file upload permissions and access to the /a/file/upload endpoint while chunked upload is enabled. Within that scope, it is typically straightforward to abuse because it relies on manipulating a single request parameter.

No direct filesystem or OS-level access is required. The attacker only needs an application account with permission to perform file uploads. The vulnerability arises because the application performs privileged filesystem operations on behalf of the user without sufficiently constraining the paths.

The most robust pattern is to decouple user-controlled identifiers from filesystem paths completely: generate server-side filenames, store uploads in a dedicated, non-executable directory, and enforce that all paths are resolved and validated against a single upload root. User-supplied values like fileMd5 should never be trusted to influence directory traversal or path construction.

Adopt secure file handling guidelines that mandate path normalization, directory whitelisting, and controlled mapping from user input to storage locations. Enforce these rules via reusable storage utilities, static analysis policies, and code review checklists. Regularly exercise upload endpoints with security tests that attempt path traversal and arbitrary file write scenarios.

Find out what's already
exploitable in your codebase.