/

CVE-2026-105865

Severity:

HIGH RISK

(8.1)

Path Traversal (CWE-22) in Payload Upload Cleanup Logic

CVE-2026-105865

Analyzed

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22, CWE-73

Impact:

Unauthorized File Deletion and Service Disruption

Severity:

HIGH RISK

(8.1)

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

Payload contains a path traversal vulnerability in local upload cleanup handling. An authenticated user who can update or delete locally stored uploads may cause cleanup operations to affect files outside the configured upload directory, potentially resulting in data loss or service disruption.

Payload contains a path traversal vulnerability in local upload cleanup handling. An authenticated user who can update or delete locally stored uploads may cause cleanup operations to affect files outside the configured upload directory, potentially resulting in data loss or service disruption.

Affected context

The issue occurs in Payload deployments that store uploads locally and allow authenticated users to manage those uploads. Risk is higher when upload-management permissions are broadly granted or when cleanup paths are derived from user-influenced metadata without sufficiently constraining them to the configured upload directory.

The issue occurs in Payload deployments that store uploads locally and allow authenticated users to manage those uploads. Risk is higher when upload-management permissions are broadly granted or when cleanup paths are derived from user-influenced metadata without sufficiently constraining them to the configured upload directory.

Exploit preconditions

  • Attack surface: Local file cleanup performed by the CMS upload-management functionality
  • Required access: An authenticated account with permission to update or delete locally stored uploads
  • Trigger point: File cleanup after an upload update or deletion operation
  • Why exploitation is possible: Cleanup path handling may permit a derived file path to resolve outside the intended upload directory
  • Attack surface: Local file cleanup performed by the CMS upload-management functionality
  • Required access: An authenticated account with permission to update or delete locally stored uploads
  • Trigger point: File cleanup after an upload update or deletion operation
  • Why exploitation is possible: Cleanup path handling may permit a derived file path to resolve outside the intended upload directory

Why this happens

The underlying bug is improper validation and containment of file paths used during upload cleanup.

When application-controlled and user-influenced path components are combined without canonicalization and directory-boundary checks, a path may escape the configured storage location. This maps primarily to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, with a related connection to CWE-73: External Control of File Name or Path.

The underlying bug is improper validation and containment of file paths used during upload cleanup.

When application-controlled and user-influenced path components are combined without canonicalization and directory-boundary checks, a path may escape the configured storage location. This maps primarily to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, with a related connection to CWE-73: External Control of File Name or Path.

Potential impact

  • Attackers may delete files outside the configured upload directory
  • Application data or operational files could be lost
  • The service may become unavailable or unstable
  • Cleanup operations could disrupt related components sharing the same filesystem
  • Integrity and availability of hosted content may be affected
  • Attackers may delete files outside the configured upload directory
  • Application data or operational files could be lost
  • The service may become unavailable or unstable
  • Cleanup operations could disrupt related components sharing the same filesystem
  • Integrity and availability of hosted content may be affected

General mitigation guidance

Mitigation generally focuses on enforcing storage boundaries for every file operation and reducing trust in path-related input.

Defensive patterns include:

  • Resolve candidate paths canonically and verify that they remain beneath the intended upload directory
  • Prefer opaque storage identifiers and server-controlled metadata over user-provided file paths
  • Reject absolute paths, traversal components, symbolic-link escapes, and ambiguous path encodings
  • Apply the same containment checks to update, delete, rename, and cleanup workflows
  • Restrict upload-management permissions according to least privilege
  • Use dedicated storage locations and filesystem permissions that limit the impact of an unintended deletion
  • Preserve backups and recovery controls for locally stored content

Mitigation generally focuses on enforcing storage boundaries for every file operation and reducing trust in path-related input.

Defensive patterns include:

  • Resolve candidate paths canonically and verify that they remain beneath the intended upload directory
  • Prefer opaque storage identifiers and server-controlled metadata over user-provided file paths
  • Reject absolute paths, traversal components, symbolic-link escapes, and ambiguous path encodings
  • Apply the same containment checks to update, delete, rename, and cleanup workflows
  • Restrict upload-management permissions according to least privilege
  • Use dedicated storage locations and filesystem permissions that limit the impact of an unintended deletion
  • Preserve backups and recovery controls for locally stored content

How teams detect issues like this

Organizations can look for this class of issue through:

  • Static analysis rules identifying path construction from request data or upload metadata
  • Code review checks for canonicalization followed by directory-boundary validation
  • Tests that exercise relative paths, absolute paths, encoded separators, symbolic links, and nested cleanup targets
  • Runtime monitoring for deletion events outside approved upload roots
  • Policy enforcement requiring dedicated upload storage and least-privilege file permissions
  • Automated security review tools that flag unsafe file path handling and external control of filenames

Organizations can look for this class of issue through:

  • Static analysis rules identifying path construction from request data or upload metadata
  • Code review checks for canonicalization followed by directory-boundary validation
  • Tests that exercise relative paths, absolute paths, encoded separators, symbolic links, and nested cleanup targets
  • Runtime monitoring for deletion events outside approved upload roots
  • Policy enforcement requiring dedicated upload storage and least-privilege file permissions
  • Automated security review tools that flag unsafe file path handling and external control of filenames

Sources

SourceLink
github.comgithub.com/payloadcms/payload/commit/6b74418f628fa633c2f297e5919a9f91b383dc11
github.comgithub.com/payloadcms/payload/releases/tag/v3.90.0
github.comgithub.com/payloadcms/payload/security/advisories/GHSA-p223-2wr2-j562

Frequently asked

questions

It may be exploitable through the application's upload-management interface when that interface is reachable and the attacker has the required authenticated permissions. It is not generally an unauthenticated filesystem attack.

The attacker needs an authenticated account authorized to update or delete uploads stored locally. Deployments that limit these capabilities to trusted administrators are less exposed.

Enforce canonical path resolution and verify that every cleanup target remains within a dedicated, configured upload directory before performing file operations.

Use server-controlled file identifiers, reject unsafe path forms, test cleanup boundaries, apply least-privilege access controls, and monitor filesystem deletion activity.

It may be exploitable through the application's upload-management interface when that interface is reachable and the attacker has the required authenticated permissions. It is not generally an unauthenticated filesystem attack.

The attacker needs an authenticated account authorized to update or delete uploads stored locally. Deployments that limit these capabilities to trusted administrators are less exposed.

Enforce canonical path resolution and verify that every cleanup target remains within a dedicated, configured upload directory before performing file operations.

Use server-controlled file identifiers, reject unsafe path forms, test cleanup boundaries, apply least-privilege access controls, and monitor filesystem deletion activity.

Find out what's already
exploitable in your codebase.