Craft CMS Twig Template Injection RCE via FTP Templates Path
Title source: metasploitExploitation Summary
CVE-2024-56145 is actively exploited and listed in the CISA Known Exploited Vulnerabilities (KEV) catalog, added June 2, 2025.
EIP tracks 4 public exploits from researchers including Chocapikk, Sachinart, hmhlol, including a Metasploit module exploits/linux/http/craftcms_ftp_template.
A Nuclei detection template is also available.
AI-analyzed exploit summary This repository contains a functional exploit for CVE-2024-56145, targeting a Remote Code Execution (RCE) vulnerability in Craft CMS. The exploit leverages improper handling of user-supplied template paths to achieve RCE via a crafted FTP server and reverse shell payloads.
Description
Craft is a flexible, user-friendly CMS for creating custom digital experiences on the web and beyond. Users of affected versions are affected by this vulnerability if their php.ini configuration has `register_argc_argv` enabled. For these users an unspecified remote code execution vector is present. Users are advised to update to version 3.9.14, 4.13.2, or 5.5.2. Users unable to upgrade should disable `register_argc_argv` to mitigate the issue.
Exploits (4)
This repository contains a functional exploit for CVE-2024-56145, targeting a Remote Code Execution (RCE) vulnerability in Craft CMS. The exploit leverages improper handling of user-supplied template paths to achieve RCE via a crafted FTP server and reverse shell payloads.
This repository contains a functional exploit for CVE-2024-56145, targeting CraftCMS via template path manipulation and SSTI (Server-Side Template Injection). The PoC includes an FTP server to serve malicious templates and multiple payloads for command execution.
This repository provides a lab environment to reproduce CVE-2024-56145, an RCE vulnerability in CraftCMS when `register_argc_argv` is enabled in php.ini. It includes Docker setup and configuration files to simulate the vulnerable environment.
This Metasploit module exploits a Twig template injection vulnerability in Craft CMS by abusing the --templatesPath argument to load arbitrary templates via FTP, leading to Remote Code Execution (RCE). It sets up a fake FTP server to serve malicious Twig templates that execute system commands when rendered by the vulnerable Craft CMS instance.
Nuclei Templates (1)
http.html:"craftcms" || http.favicon.hash:"-47932290"
icon_hash=-47932290 || body=craftcms
References (4)
Scores
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H