/

CVE-2026-130674

Severity:

CRITICAL RISK

(9.8)

Code Injection (CWE-94) in Craft CMS Title Formats

CVE-2026-130674

Awaiting Analysis

Vulnerability type

Category:

Code Injection

CWE:

CWE-94

Impact:

Arbitrary File Write and Remote Code Execution

Severity:

CRITICAL RISK

(9.8)

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

Craft CMS contains an incomplete blocklist in the handling of entry type title formats, allowing an attacker with the ability to author those formats to abuse the non-sandboxed template renderer. This can enable arbitrary file writes to the web document root and may lead to remote code execution.

Affected context

The issue affects Craft CMS versions from 5.0.0 up to, but not including, 5.11.4. It occurs when entry type title formats are rendered through the non-sandboxed renderObjectTemplate() renderer and the incomplete blocklist permits use of file-writing functionality such as ZipArchive or XMLWriter.

Exploit preconditions

  • Attack surface: Entry type title format authoring and subsequent template rendering
  • Required access: Ability to author or modify an entry type title format
  • Trigger point: Rendering the affected title format
  • Why exploitation is possible: The renderer is not sandboxed, and the incomplete blocklist does not prevent access to classes that can write files

Why this happens

The underlying issue is insufficient restriction of functionality available to an attacker-influenced template. Because renderObjectTemplate() is non-sandboxed, and the blocklist does not fully exclude file-writing classes, crafted title formats can cause attacker-controlled content to be written to files. This is a code injection weakness mapped to CWE-94.

Potential impact

  • An attacker may write or overwrite files in the web document root.
  • Attacker-controlled files could enable remote code execution.
  • The application and its data could be compromised.
  • Compromise of the application could provide a foothold for further attacks, depending on deployment permissions.

General mitigation guidance

Defensive patterns include isolating template rendering from powerful runtime capabilities and using a sandbox or restricted template language by default. Treat authored title formats as untrusted input, enforce narrow allowlists of permitted operations, and avoid relying on incomplete blocklists. Limit the application process's filesystem write access, especially within the web document root, and apply least privilege to runtime components.

How teams detect issues like this

  • Review template-rendering paths for non-sandboxed evaluation of user- or author-controlled content.
  • Use static analysis and code review to identify blocklists that govern access to file-writing or other sensitive classes.
  • Monitor application and filesystem activity for unexpected writes to web-accessible directories.
  • Enforce policies that restrict template capabilities and filesystem permissions.

Automated code review tools may help flag unsafe rendering patterns and sensitive class access.

Sources

SourceLink
github.comgithub.com/craftcms/cms/security/advisories/GHSA-6m9q-c5q4-3732

Frequently asked

questions

It affects Craft CMS deployments in the stated version range when entry type title formats are rendered through the vulnerable non-sandboxed path.

The attacker needs the ability to author or modify an entry type title format and have it rendered.

Use a sandboxed renderer with narrowly scoped capabilities, and prevent the rendering process from writing to web-accessible locations.

Treat authored templates as untrusted, prefer allowlisted operations over blocklists, and apply least-privilege filesystem and runtime controls.

Find out what's already
exploitable in your codebase.