Skip to main content
Live Webinar with SANS (June 25)— Agentic CTI Automation for Fun & ProfitRegister Free
Mallory
HighPublic exploit

Strapi Authenticated SSTI in Email Templates

IdentifiersCVE-2023-22621CWE-1336

CVE-2023-22621 is an authenticated server-side template injection vulnerability in Strapi affecting versions through 4.5.5. The issue exists in Strapi email template handling used by the Users-Permissions functionality and related email plugin logic, where a user with access to the Strapi admin panel can inject a crafted payload into an email template. The provided context indicates that validation intended to prevent code execution can be bypassed, allowing malicious lodash _.template() expressions to be stored in templates such as reset_password. When Strapi later renders the modified template, the attacker-controlled server-side template code is evaluated, resulting in arbitrary command or code execution on the Strapi server.

Share:
For your environment

Are you exposed to this one?

Mallory correlates every CVE against your assets, your vendors, and active adversary campaigns. Know which vulnerabilities matter for you, not just which ones are loud.

ANALYST BRIEF

Impact, mitigation & remediation

What it means. What to do now. Patch path, mitigations, and the assume-compromise checklist.

Impact

What an attacker gets, and what they’ve been doing with it.

Successful exploitation results in remote code execution on the Strapi host in the security context of the Strapi application. An attacker can execute arbitrary commands, modify application state, access environment variables and secrets, interact with the backing database and Redis, alter authentication or password-reset workflows, and use the compromised CMS as a foothold for broader post-exploitation and lateral movement.

Mitigation

If you can’t patch tonight, do this now.

If immediate patching is not possible, restrict and closely monitor access to the Strapi admin panel and investigate any suspicious modifications to email templates. Review request logs for PUT requests to /users-permissions/email-templates, inspect stored templates and database backups for unexpected lodash template delimiters such as <% ... %> containing JavaScript, and treat any unrecognized code in template bodies as potentially malicious. Because exploitation can yield code execution, perform post-compromise review of the host, application secrets, and connected services.

Remediation

Patch, then assume compromise.

Upgrade Strapi to a fixed release. Based on the provided advisory, affected deployments should update @strapi/plugin-email and @strapi/plugin-users-permissions to version 4.5.6 or later; Strapi 4.5.6 contains the fix for this issue. After patching, review email templates for unauthorized modifications, especially password-reset templates, and rotate any credentials or secrets that may have been exposed if compromise is suspected.
PUBLIC EXPLOITS

Exploits

1 valid exploit after Mallory filtered fakes, detection scripts, and README-only repos.

VALID 1 / 1 TOTALView more in app
CVE-2023-22621-POCMaturityPoCVerified exploit

This repository provides a proof-of-concept exploit for CVE-2023-22621, a server-side template injection (SSTI) vulnerability in Strapi versions <= 4.5.5. The exploit leverages the 'sendTemplatedEmail' function, which uses lodash's template engine to render email templates, allowing arbitrary JavaScript execution. The main exploit script (poc.py) is a Python3 tool that automates the attack: it authenticates as an admin, enables email confirmation, injects a malicious template containing a payload (by default, a bash reverse shell), and triggers the payload by registering a new user. The script supports custom payloads and allows the attacker to specify the target Strapi URL, admin credentials, attacker's IP/port, and other options. The README provides usage instructions and background on the vulnerability. The repository is structured with a single exploit script and a README, and is operational, providing a working RCE exploit against vulnerable Strapi instances.

sofianeelhorDisclosed Apr 25, 2023pythonnetwork
EXPOSURE SURFACE

Affected products & vendors

Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.

VendorProductType
StrapiPlugin-Emailapplication
StrapiPlugin-Users-Permissionsapplication
StrapiStrapiapplication

Vendor-confirmed product mapping. Mallory continuously reconciles this list against your asset inventory.

What this page doesn’t show

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, which detections to deploy, and what to do tonight.
Exposure mapping

Query your assets running an affected version, and investigate the blast radius.

Threat actor evidence

Every observed campaign linking this CVE to a named adversary.

Associated malware1

Malware families riding this exploit, with evidence and IOCs.

Detection signatures

YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.

Vendor-by-vendor mapping

Cross-references every affected SKU, including bundled OEM variants.

Social activity2

Community discussion across Reddit, Mastodon, and other social sources.