Skip to main content
Vulnerability Database/CVE-2026-105865

CVE-2026-105865: Payload CMS Path Traversal Vulnerability

CVE-2026-105865 is a path traversal flaw in Payload CMS allowing authenticated users to delete files outside upload directories, causing data loss. This article covers technical details, affected versions, and mitigation.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-105865 Overview

CVE-2026-105865 is a path traversal vulnerability [CWE-22] in Payload, an open source headless content management system (CMS). In versions before 3.90.0 and canary versions before 4.0.0-canary.34, an authenticated user with permission to update or delete locally stored uploads can trigger file cleanup operations that remove files outside the configured upload directory. The resulting unintended deletions cause data loss and service disruption. Deployments that restrict upload management to trusted users have reduced exposure. The issue is fixed in Payload 3.90.0 and 4.0.0-canary.34.

Critical Impact

An authenticated attacker with upload modification rights can delete arbitrary files on the host, impacting application integrity and availability.

Affected Products

  • Payload CMS versions prior to 3.90.0
  • Payload CMS canary versions prior to 4.0.0-canary.34
  • Deployments using the local file storage adapter for uploads

Discovery Timeline

  • 2026-10-06 - CVE CVE-2026-105865 published to the National Vulnerability Database (NVD)
  • 2026-10-06 - Last updated in NVD database

Technical Details for CVE-2026-105865

Vulnerability Analysis

The vulnerability resides in Payload's upload lifecycle, specifically the logic that cleans up files associated with an upload document when it is updated or deleted. The deletion routine in packages/payload/src/uploads/deleteAssociatedFiles.ts resolves file paths from stored filename metadata without constraining the resulting path to the configured upload directory. A user able to update an upload record can therefore influence the filename value and cause fs operations to target files outside the intended folder. Combined with a lack of filename validation during base field generation in getBaseFields.ts, the system accepts filenames that traverse directories using sequences such as ../.

The impact is loss of integrity and availability on the host filesystem. Depending on the process user's privileges, deletion can affect application binaries, configuration files, or sibling tenant data.

Root Cause

The root cause is improper limitation of a pathname to a restricted directory [CWE-22]. Upload filenames were trusted when constructing filesystem paths for cleanup, and no canonicalization or boundary check verified that the resolved path remained inside the configured upload destination.

Attack Vector

Exploitation requires network access to the Payload admin API and authenticated credentials with permission to update or delete uploads in a collection that uses the local storage adapter. The attacker submits a crafted filename value through the upload update flow. When Payload performs associated file cleanup, the derived absolute path escapes the upload directory and the server deletes the targeted file.

typescript
// Patch excerpt: packages/payload/src/uploads/deleteAssociatedFiles.ts
 import fs from 'fs/promises'
+import path from 'path'

 import type { SanitizedCollectionConfig } from '../collections/config/types.js'
 import type { SanitizedConfig } from '../config/types.js'
typescript
// Patch excerpt: packages/payload/src/uploads/getBaseFields.ts
 import { generateFilePathOrURL } from './generateFilePathOrURL.js'
 import { mimeTypeValidator } from './mimeTypeValidator.js'
+import { validateUploadFilename } from './validateUploadFilename.js'

 type Options = {
   collection: CollectionConfig

Source: Payload commit 6b74418. The fix introduces a dedicated validateUploadFilename helper and uses path module routines to constrain deletion paths to the configured upload directory.

Detection Methods for CVE-2026-105865

Indicators of Compromise

  • Upload documents whose stored filename field contains traversal sequences such as ../ or absolute paths.
  • Unexpected deletions of files on the Payload host that reside outside the configured staticDir upload directory.
  • Application error logs referencing ENOENT or missing assets after update or delete operations on upload collections.

Detection Strategies

  • Audit the Payload database for upload records containing suspicious filename values and compare against on-disk inventory.
  • Review HTTP access logs for PATCH and DELETE requests to upload collection endpoints originating from low-trust accounts.
  • Monitor filesystem telemetry for the Node.js process performing unlink calls on paths outside the configured upload destination.

Monitoring Recommendations

  • Enable file integrity monitoring on directories adjacent to the Payload upload folder, including application source and configuration paths.
  • Alert on bulk file deletions by the Payload service account within short time windows.
  • Correlate authenticated admin API activity with filesystem change events to attribute unexpected deletions.

How to Mitigate CVE-2026-105865

Immediate Actions Required

  • Upgrade Payload to version 3.90.0 or 4.0.0-canary.34 or later without delay.
  • Restrict upload update and delete permissions to a minimal set of trusted administrators until the patch is applied.
  • Review existing upload records for filenames containing path traversal characters and remediate before upgrading.

Patch Information

The fix is published in the Payload GHSA-p223-2wr2-j562 advisory and included in Payload v3.90.0. The code change adds a validateUploadFilename function and uses path resolution to ensure deletion targets remain within the configured upload directory. Review the upstream commit for implementation detail.

Workarounds

  • Limit the roles and users permitted to update or delete upload documents to vetted administrators only.
  • Run the Payload process under a dedicated low-privilege user with filesystem access scoped strictly to the upload directory.
  • Place the upload directory on a separate filesystem or volume to limit blast radius from unintended deletions.
bash
# Upgrade Payload to a patched release
npm install payload@^3.90.0
# or for the canary channel
npm install payload@4.0.0-canary.34

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.