Bug Bounty: Fastmail
The report describes two server-side request forgery (SSRF) vulnerabilities in Fastmail's web application. An attacker could make the server send requests to arbitrary internal or external hosts, potentially accessing internal services or leaking partial response data.
Published on medium.com
{{media:0}}
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.
Context
Fastmail runs a bug bounty program, and this write-up covers two separate findings in their web application. The first is a server-side request forgery (SSRF) in a feature that fetches iCal files, which let the researcher make HTTP requests to arbitrary hosts and ports, including internal IP addresses. The second is a blind SSRF combined with blind XXE in an area of the site that asked for an email address. The first paid $1,000 and the second paid $2,000, for $3,000 in total.
The researcher notes at the outset that Fastmail's program is well run and that the team cares about the security of their services and customers. He started looking at the program a few months before the report and came across the iCal feature while browsing the web application.
Setup
No accounts, roles or tool versions are described. The preconditions that matter are:
- Access to the iCal fetch feature in the web application.
- A server the researcher controls that can receive and log inbound HTTP requests. For the second finding, an Amazon EC2 instance running a webserver, referred to in the report as a VPS, whose access logs were the main source of evidence.
Finding it
The entry point was a feature that takes a URL and fetches an iCal file from it:
Using this feature, the researcher found he could make HTTP requests to any website on any port, including internal IP addresses. Two behaviours made the issue visible rather than blind:
- If the target server did not return a valid iCal file, the application returned an error that included partial contents of the response body. That turned the SSRF into a partial read of whatever the server fetched.
- Including
\r\nin the URL path allowed custom headers to be added, which in theory could be used for protocol smuggling.
The researcher did not find an internal service that could be leveraged to remote code execution. He did, however, find a reference to an internal IP address in the source of the website. That address was running a webserver, and he was able to pull partial contents of the internal web application:
This first vulnerability was reported to the security team and rewarded with $1,000.
Exploitation
Step 1: Confirm the iCal fetch is an SSRF
Requesting a server that does not return a valid iCal file produces an error containing partial response body content, which confirms that data comes back to the user.
Step 2: Try header injection through the URL path
Include \r\n in the URL path to add custom headers to the outbound request. The report describes this as a theoretical route to protocol smuggling; no working exploitation of it is shown.
Step 3: Reach an internal webserver
While reading the source of the website, the researcher found a reference to an internal IP address running a webserver. Fetching it through the iCal feature returned partial contents of the internal web application, as shown above.
Step 4: Find the second injection point
The second vulnerability was found by entering the hostname of the researcher's Amazon EC2 instance, which was running a webserver, into an area of the website that requested an email address:

Requests from Fastmail arriving at the VPS webserver confirmed a blind SSRF: the response contained no contents of the requested file, so the researcher could not read anything back directly. He also could not specify a port number or a custom filepath.
Step 5: Use redirects to regain control
The SSRF followed redirects given in the Location header. He first tried gopher:// to craft custom requests to internal services and interact with protocols other than HTTP and HTTPS. That failed: the only successful requests were redirects to HTTP or HTTPS.
Step 6: Notice the XML request and add an XXE payload
Looking back at the VPS access logs, the researcher saw that the initial request was for an XML file. He placed a blind XXE payload at the exact file path their servers were requesting, and it worked:
The first request in the log is the file the server initially asked for. The XXE payload then tried to request success.txt. Because that file did not exist, the webserver redirected to the root directory. In the root directory was a PHP file that redirected to /example-test-redirect.txt using the Location header. This chain of outbound requests, visible in the logs, demonstrated that the XML parser was resolving external entities and that the resulting requests were being made from Fastmail's infrastructure.
This second vulnerability was reported and rewarded with $2,000.
Root cause
Two separate design mistakes are implied by the behaviour observed.
In the iCal feature, user-supplied URLs were fetched server-side without restricting the destination host or port, so internal addresses were reachable. The error path then leaked partial response bodies, turning a blind SSRF into a partial read. Accepting \r\n in the URL path allowed header injection into the outbound request, which is a sign that the URL was being assembled into a raw request rather than validated and encoded.
In the email-address feature, the input was used to build a request for an XML file, and the XML parser resolved external entities. The absence of response content in the error path made the SSRF blind, but redirect following in the fetcher gave the researcher a way to steer requests, and the XXE payload gave him a way to make the parser issue further requests. The report does not describe the validation or filtering that was in place.
Impact
For the first finding, an authenticated user of the iCal feature could make the server issue HTTP requests to arbitrary hosts and ports, including internal IP addresses, and read partial response bodies through error messages. The researcher reached an internal webserver and pulled partial contents of an internal web application. He did not find an internal service that could be leveraged to remote code execution, and the header injection via \r\n was not developed into a working attack.
For the second finding, the SSRF was blind: no response contents came back. The researcher could not choose the port or the filepath. What he could do was control the hostname, follow redirects to HTTP and HTTPS destinations, and serve an XML file containing an XXE payload at the path the server requested. That gave him a way to make Fastmail's infrastructure issue requests driven by the XML parser, with the limits above.
Fix
The report does not describe the patches themselves. It states that Fastmail's security team responded quickly and rolled out a patch within 24 hours of each report.
Variants to test
- iCal or feed importers. Submit URLs pointing at internal addresses and unusual ports. A positive result is a request arriving from the target's infrastructure, or an error message containing fragments of an internal response.
- URL path header injection. Insert
\r\nfollowed by a header name and value into the path of a fetched URL. A positive result is the extra header appearing in the request received by your server. - Email address fields that trigger server-side fetches. Enter a hostname you control into fields that request an email address. A positive result is an inbound request from the target's infrastructure to your webserver.
- Redirect following in blind SSRF. Serve a
302with aLocationheader pointing at another host or scheme. A positive result is a follow-up request to the redirect target; a negative result forgopher://matches what happened here. - XML parsing of fetched files. Place an XML file with an external entity at the exact path the server requests. A positive result is a request for the entity's target appearing in your logs, as with the
success.txtrequest here. - Redirect chains from the entity target. Have the entity target a missing file so your server redirects to a directory containing a script that redirects again. A positive result is the full chain of requests in your access logs, proving the parser and fetcher are both under your influence.
Closing
The researcher describes Fastmail's program positively: quick responses, patches within 24 hours of each report, and a place in their Hall of Fame alongside the bounties.

What happened, in plain words
Fastmail is an email service. Like many companies, it runs a bug bounty program: it pays outside people, called security researchers, to look for mistakes in its website and report them privately instead of abusing them. This article is about two separate mistakes that one researcher found in Fastmail's web application, and about the $3,000 he was paid for them: $1,000 for the first and $2,000 for the second.
Both mistakes belong to a family called SSRF, short for server-side request forgery. To understand the name, imagine a hotel concierge. Guests can ask the concierge to fetch things from outside the hotel, and that is normal. SSRF is when a guest writes a request that makes the concierge walk into the staff-only corridors and fetch something from a locked room, then hand it back. The guest never entered the corridor; the concierge did it on their behalf. In web terms, the "concierge" is the company's server, and the "guest" is a user of a feature that makes the server fetch something from a web address the user supplies.
The second mistake also involves XXE, short for XML External Entity. XML is a text format for structured data, a bit like a very strict form with labelled boxes. One of its older features lets a document say "wherever you see this label, go and read the contents of that other file or address and paste them here". XXE is when an attacker supplies an XML document that abuses that feature to make the server fetch something it should not. "Blind" in both names means the attacker cannot see the fetched content directly; they only see side effects, such as a request arriving on a server they control.
The researcher starts by praising Fastmail's program: he says the team cares about the security of their services and customers. He began looking at the program a few months before writing this up, and came across the first feature while browsing the web application.
The first finding: the iCal fetcher
What the feature does
An iCal file is a calendar file: a plain text file describing events, which calendar apps can import. Fastmail's feature let a user give a web address, and Fastmail's server would go and fetch the iCal file from that address so it could be imported into the user's calendar.
That design is convenient, but it means the server makes a request to a destination chosen by the user. The question a researcher asks is: does the server check where it is allowed to go?
What the researcher found
Using this feature, the researcher discovered he could make HTTP requests to any website using any port, including internal IP addresses. Two details made the problem visible rather than hidden:
- If the target server did not return a valid iCal file, Fastmail returned an error that included partial contents of the response body. In other words, the error message carried back a piece of whatever the server had fetched, even when it was not a calendar file.
- If he included
\r\nin the URL path, he could add custom headers to the outgoing request. In theory this could have been used as a way to protocol smuggle.
Some terms from that paragraph, from zero:
- HTTP is the language browsers and servers use to exchange web pages and data. A request asks for something; a response returns it, along with a status code saying whether it worked.
- A port is a numbered door on a server. One machine can run many services, each listening on its own number. Port 80 is the usual door for plain HTTP and 443 for HTTPS, the encrypted version. If a service is only meant to be reached from inside a company, its port is often blocked from the outside, but a server inside the company can still reach it.
- An internal IP address is the address of a machine on a private network, not reachable from the public internet. Think of it as an extension number inside an office: outsiders cannot dial it, but the receptionist can.
- A header is a labelled line attached to an HTTP request or response, carrying extra information such as what kind of content is being sent or who is asking. Headers are separated from each other by the two-character sequence
\r\n, which means "carriage return, line feed", the same thing as pressing Enter at the end of a line in a text file. - Protocol smuggling is the trick of slipping extra lines into a request so that the receiving server treats part of your input as a new, separate request or as extra headers you were not meant to set. It is like writing an extra line on the bottom of a form so the clerk processes an instruction that was never on the official form.
The researcher did not find any internal service he could use to leverage this into remote code execution, meaning he could not turn the ability to make requests into the ability to run his own programs on Fastmail's machines. But while looking through the source of their website, he found a reference to an internal IP address which was running a webserver, and he was able to pull partial contents of their internal web application.
He reported this vulnerability to Fastmail's security team and was rewarded $1,000.
Step by step, for a beginner
- Confirm the server is the one making the request. Point the iCal feature at a host and port you control, or at an arbitrary external site. If a request arrives from Fastmail's infrastructure, the fetching happens on their side, not in your browser. This matters because a request made by your own browser proves nothing about the server.
- Check whether data comes back. Request a server that does not return a valid iCal file. The error contains partial response body content, which confirms that what the server fetched is partly visible to you. Without that, the problem would be blind: you would know requests happen, but not what they return.
- Try adding headers through the URL path. Include
\r\nin the URL path to add custom headers to the outgoing request. The report describes this as a theoretical route to protocol smuggling; no working exploitation of it is shown. - Reach an internal webserver. While reading the source of the website, the researcher found a reference to an internal IP address running a webserver. Fetching it through the iCal feature returned partial contents of the internal web application, as shown above.
Why it worked
User-supplied URLs were fetched by the server without restricting the destination host or port, so internal addresses were reachable. The error path then leaked partial response bodies, turning a blind SSRF into a partial read. Accepting \r\n in the URL path allowed header injection into the outbound request, which suggests the URL was being assembled into a raw request rather than validated and encoded.
The second finding: blind SSRF plus blind XXE
The second vulnerability was a blind SSRF combined with a blind XXE. The researcher found it by including the hostname of his Amazon EC2 instance, which was running a webserver, in an area of the website that requested an email address.

An Amazon EC2 instance is a rented virtual machine in Amazon's cloud; the report also calls it a VPS, a virtual private server. It is simply a computer on the internet that the researcher controls, with a webserver on it that writes down every request it receives in an access log, a file listing who asked for what and when.
Step 1: Notice the requests arriving
After entering his hostname, the researcher saw HTTP requests made to his VPS's webserver that were coming from Fastmail. He immediately knew he had found a blind SSRF, because the response did not contain any contents of the file being requested. He could see that Fastmail's server had visited him, but nothing of what it fetched came back to him.
He also could not specify the port number or a custom filepath. So he controlled only the hostname, not the door number or the exact file.
Step 2: Use redirects to regain some control
He quickly discovered that this SSRF followed redirects specified in the Location header. A redirect is a response that says "not here, go there instead": the server answers with a status code such as 302 and a Location header holding the new address, and the client is expected to fetch that address next. Because the Fastmail server followed these redirects, the researcher could steer it to a new destination of his choosing, even though he could not choose the port or path directly.
He first tried to use gopher:// to craft custom requests in an attempt to interact with internal services and with protocols other than HTTP and HTTPS. That was unsuccessful: the only requests that were successful were redirects to HTTP or HTTPS. Gopher is an old internet protocol, and researchers like it because it lets you send almost arbitrary text to a server, which is handy for talking to services that do not speak HTTP. Here it was blocked.
Step 3: Read the logs and spot the XML request
Shortly after, he looked back at the access logs on his VPS and noticed that the initial request was requesting an XML file. That is a strong hint: if the server is fetching XML, then an XML parser on Fastmail's side is processing it, and XML parsers are where XXE lives.
He next placed a blind XXE payload at the exact file path being requested by their servers, and it turned out to be successful.
The first request is the file the server initially requested. The XXE payload he used then tried to request success.txt. Because that file did not exist, his webserver redirected to the root directory. In the root directory was a PHP file that redirected to /example-test-redirect.txt using the Location header. PHP is a programming language commonly used for web pages; a PHP file here simply acts as a script that issues a redirect.
That chain of requests, visible in the logs, demonstrated two things: the XML parser was resolving external entities, and the resulting requests were being made from Fastmail's infrastructure.
He reported this vulnerability to Fastmail and received a $2,000 reward.
Step by step, for a beginner
- Find an input that makes the server fetch something. Enter a hostname you control into a field that asks for an email address. A request arriving from the target's infrastructure to your webserver is the positive result.
- Recognise that it is blind. No response contents come back, so you cannot read files directly. You can only observe that requests happen.
- Test redirect following. Serve a
302with aLocationheader pointing at another host or scheme. A follow-up request to the redirect target is a positive result. A negative result forgopher://matches what happened here. - Look at what the server asks for. The logs showed the initial request was for an XML file. Place an XML file with an external entity at the exact path the server requests. A request for the entity's target appearing in your logs, as with the
success.txtrequest here, is a positive result. - Build a redirect chain from the entity target. Have the entity target a missing file so your server redirects to a directory containing a script that redirects again. The full chain of requests in your access logs proves that both the parser and the fetcher are under your influence.
Why it worked
In the email-address feature, the input was used to build a request for an XML file, and the XML parser resolved external entities. The absence of response content in the error path made the SSRF blind, but redirect following in the fetcher gave the researcher a way to steer requests, and the XXE payload gave him a way to make the parser issue further requests. The report does not describe the validation or filtering that was in place. An allowlist is a list of destinations that are explicitly permitted, with everything else refused, the opposite of a blocklist that names only what is forbidden.
What the impact was
For the first finding, a logged-in user of the iCal feature could make the server issue HTTP requests to arbitrary hosts and ports, including internal IP addresses, and read partial response bodies through error messages. The researcher reached an internal webserver and pulled partial contents of an internal web application. He did not find an internal service that could be leveraged to remote code execution, and the header injection via \r\n was not developed into a working attack.
For the second finding, the SSRF was blind: no response contents came back. The researcher could not choose the port or the filepath. What he could do was control the hostname, follow redirects to HTTP and HTTPS destinations, and serve an XML file containing an XXE payload at the path the server requested. That gave him a way to make Fastmail's infrastructure issue requests driven by the XML parser, within those limits.
How it was fixed
The report does not describe the patches themselves. It states that Fastmail's security team responded quickly and rolled out a patch within 24 hours of each report.
Where else to look for the same patterns
- iCal or feed importers. Submit URLs pointing at internal addresses and unusual ports. A positive result is a request arriving from the target's infrastructure, or an error message containing fragments of an internal response.
- URL path header injection. Insert
\r\nfollowed by a header name and value into the path of a fetched URL. A positive result is the extra header appearing in the request received by your server. - Email address fields that trigger server-side fetches. Enter a hostname you control into fields that request an email address. A positive result is an inbound request from the target's infrastructure to your webserver.
- Redirect following in blind SSRF. Serve a
302with aLocationheader pointing at another host or scheme. A positive result is a follow-up request to the redirect target; a negative result forgopher://matches what happened here. - XML parsing of fetched files. Place an XML file with an external entity at the exact path the server requests. A positive result is a request for the entity's target appearing in your logs, as with the
success.txtrequest here. - Redirect chains from the entity target. Have the entity target a missing file so your server redirects to a directory containing a script that redirects again. A positive result is the full chain of requests in your access logs, proving the parser and fetcher are both under your influence.
Closing
The researcher describes Fastmail's program positively: quick responses, patches within 24 hours of each report, and a place in their Hall of Fame alongside the bounties.

Glossary
- Access log: a file on a webserver recording every request it received, with details such as the address it came from and the path requested.
- Allowlist: a list of things that are explicitly permitted, with everything else refused.
- Amazon EC2 instance: a rented virtual machine in Amazon's cloud, used here as a server the researcher controls.
- Blind: describes a vulnerability where the attacker cannot see the fetched content directly and must rely on side effects, such as requests arriving at their own server.
- Bug bounty program: a scheme where a company pays outside researchers for reporting security mistakes privately.
- Carriage return and line feed (
\r\n): the two characters that mark the end of a line in HTTP and many text formats, equivalent to pressing Enter. - Error message: the response a server sends when a request fails; here it leaked part of the fetched content.
- External entity: an XML feature that lets a document refer to outside content, such as a file or address, to be inserted where the reference appears.
- Gopher: an old internet protocol that lets a client send nearly arbitrary text to a server; it was tried here and did not work.
- Header: a labelled line of extra information attached to an HTTP request or response.
- HTTP: the language browsers and servers use to exchange web pages and data.
- HTTPS: HTTP with encryption.
- iCal file: a plain text calendar file that calendar apps can import.
- Internal IP address: the address of a machine on a private network, not reachable from the public internet.
Locationheader: the header in a redirect response that holds the address the client should go to next.- PHP: a programming language commonly used to build web pages and scripts.
- Port: a numbered door on a server, letting one machine run several services.
- Protocol smuggling: slipping extra lines into a request so the receiving server treats part of the input as a new request or as extra headers.
- Redirect: a response telling the client to fetch a different address instead.
- Remote code execution: the ability to make a server run programs of the attacker's choosing.
- Response body: the main content of an HTTP response, as opposed to its status code and headers.
- SSRF (server-side request forgery): making a company's server send a request to an address of the attacker's choosing.
- VPS (virtual private server): a rented computer on the internet that the researcher controls.
- XML: a text format for structured data, made of labelled elements.
- XXE (XML External Entity): abusing XML's external entity feature to make a server fetch something it should not.