Craft CMS Vulnerable to Server-Side Template Injection

craftcms/cms Updated 02 Oct 2025

Summary

13/05/2022
No i
High
7.2

CVE-2018-20465: Craft CMS Vulnerable to Server-Side Template Injection. Affects craftcms/cms versions < 3.0.34. No fix is published. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

Craft CMS is an open-source content management system that allows users to create and manage websites. It provides a flexible and customizable platform for developers and content creators. Craft CMS versions up to 3.0.34 are affected by a server-side template injection vulnerability. This vulnerability allows remote authenticated administrators to read sensitive information by injecting malicious code into the URI Format of the Site Settings.

Vulnerability Detail

The server-side template injection vulnerability in Craft CMS allows an attacker to execute arbitrary code on the server. By injecting a specific string into the URI Format of the Site Settings, an attacker can retrieve sensitive information such as the cleartext username and password for the database. This can lead to unauthorized access to the database and potential exposure of sensitive data. The vulnerability has a CVSS score of 7.2, indicating a high severity level.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

If upgrading to the latest version is not immediately possible, a temporary workaround is to sanitize user input and validate the URI Format field in the Site Settings. This can be done by implementing input validation and filtering techniques to prevent the execution of malicious code. Here is an example of how to sanitize the input in PHP:

$uriFormat = filter_input(INPUT_POST, 'uriFormat', FILTER_SANITIZE_STRING);

Conclusion

Craft CMS versions up to 3.0.34 are vulnerable to a server-side template injection vulnerability. This vulnerability allows remote authenticated administrators to read sensitive information by injecting malicious code into the URI Format of the Site Settings. To mitigate the vulnerability, it is advised to upgrade Craft CMS to version 3.0.35 or later. For further assistance and support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for craftcms/cms →

Share this vulnerability

FAQ

Craft CMS is an open-source content management system that provides a flexible and customizable platform for creating and managing websites.

Server-side template injection is a vulnerability that allows an attacker to inject malicious code into a server-side template, which is then executed on the server. This can lead to arbitrary code execution and potential data exposure.

The Craft CMS vulnerability allows remote authenticated administrators to read sensitive information, such as database credentials, by injecting malicious code into the URI Format of the Site Settings. This can lead to unauthorized access to the database and potential exposure of sensitive data.

The vulnerability has a CVSS score of 7.2, indicating a high severity level.

To fix the vulnerability, it is recommended to upgrade Craft CMS to version 3.0.35 or later. The latest version includes a patch that addresses the server-side template injection issue.

Related vulnerabilities

Recent vulnerabilities recorded for craftcms/cms.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback