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

CVE-2026-105862: Payload CMS SVG Upload XSS Vulnerability

CVE-2026-105862 is a cross-site scripting vulnerability in Payload CMS that allows attackers to upload malicious SVG files that execute JavaScript. 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-105862 Overview

CVE-2026-105862 is a stored Cross-Site Scripting (XSS) vulnerability in Payload, an open source headless content management system (CMS). The flaw affects Payload versions prior to 3.90.0 and canary versions before 4.0.0-canary.34. Collections configured to allow downloadable SVG uploads can store a malicious SVG that bypasses sanitization. When a user downloads and opens the file, attacker-controlled JavaScript executes in the browser context. The weakness is tracked as CWE-79: Improper Neutralization of Input During Web Page Generation.

Critical Impact

An authenticated low-privileged user with upload permissions can store a weaponized SVG that executes arbitrary JavaScript in another user's browser session, enabling session theft, account takeover, and lateral movement within the CMS.

Affected Products

  • Payload CMS versions prior to 3.90.0
  • Payload CMS canary versions prior to 4.0.0-canary.34
  • Payload Cloud static handler (packages/payload-cloud/src/staticHandler.ts)

Discovery Timeline

  • 2026-10-06 - CVE-2026-105862 published to the National Vulnerability Database (NVD)
  • 2026-10-06 - Last updated in NVD database
  • Fix released - Payload maintainers published versions 3.90.0 and 4.0.0-canary.34 via GitHub Security Advisory GHSA-2pwp-2369-8fg3

Technical Details for CVE-2026-105862

Vulnerability Analysis

Payload collections that accept SVG uploads previously relied on sanitization that did not fully strip executable content from Scalable Vector Graphics (SVG) files. SVG is XML-based and natively supports <script> elements, event handlers, and foreign objects. An attacker with upload rights can craft an SVG embedding JavaScript payloads that survive the server-side filter. When the file is served back for download and the victim opens it in a browser, the script runs under the application origin or in a context the victim trusts. User interaction is required, which is reflected in the attack prerequisites.

Root Cause

The root cause is insufficient validation of upload identity and improper handling of XML-based media delivery. The patch introduces explicit MIME type identity checks (isSvgMimeType, isXmlMimeType), a dedicated upload Content Security Policy (UPLOAD_CONTENT_SECURITY_POLICY), and client upload assertions (assertClientUploadAllowed, assertClientUploadFileSize). The prior pipeline treated SVG as a benign image rather than active XML content.

Attack Vector

Exploitation requires an authenticated user with permissions to upload to an SVG-enabled collection. The attacker uploads a malicious SVG. A second user then downloads and opens the file, triggering script execution with scope-changed privileges. This yields high confidentiality and integrity impact without affecting availability.

typescript
// Patch excerpt: packages/payload-cloud/src/staticHandler.ts
 import type { CollectionConfig } from 'payload'
 import type { Readable } from 'stream'

+import { isXmlMimeType, UPLOAD_CONTENT_SECURITY_POLICY } from 'payload/internal'
+
 import type { CollectionCachingConfig, PluginOptions, StaticHandler } from './types.js'

 import { createKey } from './utilities/createKey.js'

// Patch excerpt: packages/payload/src/exports/internal.ts
+export {
+  assertClientUploadAllowed,
+  assertClientUploadFileSize,
+} from '../uploads/assertClientUploadAllowed.js'
 export { getExternalFile } from '../uploads/getExternalFile.js'
+export { isSvgMimeType, isXmlMimeType } from '../uploads/getFileTypeIdentity.js'
+export { UPLOAD_CONTENT_SECURITY_POLICY } from '../uploads/uploadContentSecurityPolicy.js'

Source: GitHub Commit a8c3a8e

Detection Methods for CVE-2026-105862

Indicators of Compromise

  • SVG files in upload collections containing <script> tags, onload=, onerror=, or javascript: URI schemes
  • Static handler responses returning Content-Type: image/svg+xml without a restrictive Content-Security-Policy header
  • Audit log entries showing SVG uploads from low-privileged accounts shortly before anomalous session activity

Detection Strategies

  • Scan existing upload storage for stored SVGs and parse the XML for scripting constructs, event handler attributes, or external entity references
  • Review Payload collection configurations to identify any that accept the image/svg+xml MIME type
  • Correlate browser error telemetry and administrator-session anomalies with recent SVG file downloads

Monitoring Recommendations

  • Enable upload audit logging and alert on uploads where filename extension or declared MIME type is svg
  • Monitor outbound requests from admin browser sessions to unexpected domains, which may indicate exfiltration via XSS
  • Track changes to collection upload configurations, especially additions to allowed MIME type lists

How to Mitigate CVE-2026-105862

Immediate Actions Required

  • Upgrade to Payload 3.90.0 or Payload 4.0.0-canary.34 immediately
  • Audit all collections for SVG upload permissions and restrict them to trusted roles only
  • Enumerate existing SVG uploads and remove or quarantine files containing scripting content
  • Rotate administrator sessions and credentials if suspicious SVG uploads are discovered

Patch Information

The fix is published in Payload v3.90.0 and the canary line 4.0.0-canary.34. The patch adds MIME identity validation (isSvgMimeType, isXmlMimeType), enforces an upload-specific Content Security Policy via UPLOAD_CONTENT_SECURITY_POLICY, and introduces client upload assertions. Full technical context is available in GHSA-2pwp-2369-8fg3.

Workarounds

  • Disable SVG uploads in affected collections until the patched version is deployed
  • Serve user-uploaded files from a sandboxed origin isolated from the main application domain
  • Force a Content-Disposition: attachment header and apply a restrictive Content-Security-Policy on static upload routes
bash
# Upgrade Payload to the patched release
npm install payload@3.90.0

# Or install the canary line
npm install payload@4.0.0-canary.34

# Verify installed version
npm ls payload

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.