/

CVE-2026-13528

Severity:

HIGH RISK

(7.3)

Path Traversal (CWE-22) in ruoyi-vue-pro Upload Endpoint

CVE-2026-13528

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Arbitrary File Write and Filesystem Access

Severity:

HIGH RISK

(7.3)

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

A path traversal flaw in the ruoyi-vue-pro AppFileController upload endpoint allows attackers to manipulate the generated upload path and escape intended storage directories.

When user-supplied file paths or names are not properly normalized and validated, a remote attacker can potentially write files to arbitrary locations on the server filesystem.

Affected context

The vulnerability occurs in deployments of the ruoyi-vue-pro application that expose the AppFileController file upload endpoint and rely on FileServiceImpl.generateUploadPath to determine where uploaded content is stored.

It becomes relevant when the upload path or filename incorporates user-controlled input without robust normalization or directory constraints, and when the application runs with permissions that allow writing beyond the intended upload directory.

In typical setups, this affects environments where file uploads are accepted from remote clients as part of application functionality.

Exploit preconditions

  • Attack surface: HTTP file upload endpoint exposed by AppFileController.
  • Required access: Ability to send crafted upload requests (e.g., authenticated or unauthenticated user, depending on deployment configuration).
  • Trigger point: Invocation of generateUploadPath when processing an upload request, using data influenced by user-controlled fields (such as filename or path segments).
  • Why exploitation is possible: The path generation logic does not sufficiently sanitize or normalize input to prevent directory traversal sequences (e.g., ../), allowing constructed paths to escape the intended upload root.

Why this happens

This vulnerability stems from improper validation of file paths derived from user input, aligning with CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').

The generateUploadPath function builds filesystem paths without strictly enforcing that the final resolved path remains within a designated upload directory.

By failing to canonicalize and validate paths before use, the application allows user-controlled segments to influence directory navigation, enabling traversal outside the expected storage area in an abstract sense.

Potential impact

  • Attackers may write files to unexpected locations on the server filesystem.
  • Malicious uploads could overwrite or replace existing application or configuration files.
  • Uploaded content can be placed in web-accessible locations, potentially enabling code or script execution depending on server configuration.
  • Sensitive data may be exposed or corrupted if application logs or other files are targeted.
  • The overall integrity of the application environment could be undermined through filesystem abuse.

General mitigation guidance

Effective mitigation focuses on constraining filesystem operations to well-defined, trusted directories and minimizing reliance on user-controlled path components.

Common defensive patterns include:

  • Constructing upload paths from server-side identifiers (such as UUIDs) instead of raw client-provided filenames or subpaths.
  • Canonicalizing the computed path and verifying that it resides within a preconfigured upload root before any write operation.
  • Stripping or rejecting directory traversal patterns and illegal characters from filenames and path segments.
  • Applying least-privilege file system permissions so the application process can only write to designated upload directories.
  • Using storage abstractions (such as object stores) that reduce direct interaction with the server's local filesystem.

These patterns collectively reduce the risk of path traversal and make file handling more robust by default.

How teams detect issues like this

Organizations can detect path traversal risks by combining code-level analysis with operational monitoring:

  • Static analysis rules that flag uses of user-controlled input in filesystem APIs (File, Paths, FileOutputStream) without prior normalization and directory checks.
  • Code review guidelines focusing on any method that constructs paths from request parameters or uploaded filenames, checking for canonicalization and root directory enforcement.
  • Runtime security controls or WAF rules that inspect upload requests for traversal sequences (such as ../, encoded variants, or suspicious path patterns).
  • Logging and alerting around file write operations, particularly when writes occur outside the expected upload directory structure.

Automated code review tools and SAST solutions can help consistently surface these patterns during development.

Sources

SourceLink
gitee.comgitee.com/zhijiantianya/ruoyi-vue-pro/commit/4ae3f6b2c9883978837638c14e3d18419819eeb0
github.comgithub.com/YunaiV/ruoyi-vue-pro/
github.comgithub.com/YunaiV/ruoyi-vue-pro/issues/1146
github.comgithub.com/YunaiV/ruoyi-vue-pro/issues/1146#issuecomment-4583281212
vuldb.comvuldb.com/cve/CVE-2026-13528
vuldb.comvuldb.com/submit/840617
vuldb.comvuldb.com/vuln/374536
vuldb.comvuldb.com/vuln/374536/cti

Frequently asked

questions

Exploitation is generally feasible wherever the file upload endpoint is reachable and the application uses the vulnerable path generation logic. The presence of a public exploit increases practical risk, but actual impact still depends on server configuration and filesystem permissions.

The attacker needs the ability to submit file upload requests to the affected endpoint. Whether this requires authentication depends on how the application is deployed; in some configurations, user registration or specific roles may gate access, while in others the endpoint may be more open.

Enforce strict directory confinement for uploads by generating paths entirely on the server side, canonicalizing the resulting path, and verifying that it remains inside a predefined upload root before writing. Additionally, treat filenames as data only—sanitized and stored separately—rather than as direct filesystem path components.

Adopt a consistent file handling strategy that minimizes trust in client input: use server-generated identifiers for storage locations, apply centralized utilities for path normalization and validation, incorporate static analysis checks for filesystem operations, and document security requirements for file upload features in your development guidelines.

Find out what's already
exploitable in your codebase.