Email Forgery through Mandrillapp SPF
The domain's SPF record authorised Mandrill's mail servers even though the owner had not completed Mandrill's domain registration, so any Mandrill user could claim the domain and send mail that appeared to come from it. An attacker could use this to send convincing phishing email from the organisation's address.
Originally disclosed on HackerOne
- Triaged in 8 hours
- Fixed in 12 hours
- Paid in 12 hours
- Disclosed after 31 days
Description :- The SPF record of gratipay.com include Mandrillapp which you are not using right now, i'm able to add gratipay.com in my account, although a further verification of domain is required but you should know that Mandrillapp allow to send email from a domain if its SPF records point Mandrill server. I have attached a screenshot to proof my concept 1 SPF record found for the domain gratipay.com : "" v=spf1 include:email.freshdesk.com include:spf.mandrillapp.com include:_spf.google.com -all " This is useful in phishing, and this type of vulnerability is news worthy (http://bits.blogs.nytimes.com/2015/04/09/sendgrid-email-breach-was-used-to-attack-coinbase-a-bitcoin-exchange/) Vulnerability Impact Scenario :- Using my own mandrill account I can send email which appears to originate from @gratipay.com Patch :- The patch is pretty simple. Complete your mandrill registration process. This will lock out other mandrill users from sending email that originates from *@gratipay.com. Let me know if you have any other questions. Check Screenshot. Thanks.
Attachments

Context
Gratipay is the target of this report, filed on HackerOne and disclosed on 19 March 2016. The weakness was classified as improper authentication (generic), rated medium severity, and paid a bounty of 10.00 USD. The researcher is bugdiscloseguys.
The issue is not in an application endpoint but in the domain's email authentication configuration. Gratipay's SPF record authorises several third-party mail senders, and one of them, Mandrill, was included even though the domain owner had not completed Mandrill's domain registration. Because Mandrill will send mail on behalf of a domain whose SPF record points at Mandrill's servers, anyone with a Mandrill account could send email that appears to come from @gratipay.com.
Setup
The researcher needed a Mandrill account of their own and the ability to add gratipay.com as a sending domain in that account, though Mandrill asks for a further verification of the domain. No access to Gratipay infrastructure was required. The report notes that Mandrill asks for a further verification of the domain, but that this verification is not what gates sending: the SPF record is.
Finding it
The starting point was a DNS lookup of the SPF record for gratipay.com. The researcher found one SPF record:
v=spf1 include:email.freshdesk.com include:spf.mandrillapp.com include:_spf.google.com -all
The record authorises three include mechanisms: Freshdesk, Mandrill (spf.mandrillapp.com) and Google, with a hard fail for everything else. The researcher's observation was that Mandrill was listed in the SPF record but was not actually in use by Gratipay at that time. That mismatch is what made the record interesting: an SPF include is a statement that the listed provider's servers may send mail for the domain, and Mandrill honours that statement when deciding whether to let one of its customers send as the domain.
Exploitation
Step 1: Add the domain to a Mandrill account
The researcher added gratipay.com as a sending domain in their own Mandrill account. Mandrill requires a further verification of the domain, but the researcher points out that this does not prevent sending: Mandrill allows a customer to send email from a domain if that domain's SPF records point at Mandrill's servers. The SPF record above does exactly that.
Step 2: Send mail as the domain
With the domain added, the researcher used their own Mandrill account to send email that appears to originate from @gratipay.com. The report does not include the API call or the message itself; it states the result and backs it with a screenshot.

The screenshot is the proof of concept attached to the report.
Root cause
SPF is a sender-authorisation mechanism: a receiving mail server checks whether the sending IP is permitted by the domain's SPF record. Mandrill, as a shared sending provider, uses the same signal in the opposite direction. If a customer wants to send as a domain, Mandrill treats the presence of include:spf.mandrillapp.com in that domain's SPF record as evidence that the domain owner has authorised Mandrill to send on its behalf. The domain owner is expected to complete Mandrill's registration process, which locks the domain to that one account.
Gratipay had the include in its SPF record but had not completed that registration. The record therefore authorised Mandrill's infrastructure in general, while nothing tied the domain to a specific Mandrill account. Any Mandrill customer could claim it. The existing defence, the -all at the end of the record, does not help here: it rejects senders outside the listed includes, and Mandrill is inside them.
Impact
An attacker with a Mandrill account can send email that appears to originate from @gratipay.com. The researcher frames the impact as phishing: recipients see a sender address in the Gratipay domain, and the mail passes SPF checks because it genuinely leaves Mandrill's authorised infrastructure. The report does not describe DKIM or DMARC behaviour, so how the message fares against those checks is not established here.
The researcher also argues the class of issue is newsworthy, citing the 2015 SendGrid email breach that was used to attack Coinbase, a bitcoin exchange. The conditions are narrow: the attack depends on the target domain listing Mandrill in SPF without having completed Mandrill's domain registration, and on the attacker holding a Mandrill account.
Fix
The patch the researcher proposes is to complete the Mandrill registration process. That locks out other Mandrill users from sending email that originates from *@gratipay.com. The report does not say whether the registration was completed or the include removed; either way, the goal is that the SPF include no longer stands open to any Mandrill customer.
Variants to test
- Check other shared sending providers in a target's SPF record, such as transactional email and helpdesk services. A positive result is a provider whose onboarding lets any customer claim the domain on the strength of the SPF include alone.
- Look for includes that the organisation no longer uses. A stale include is a sender authorisation nobody is watching, and it is the precondition for this bug.
- Try adding the domain in the provider's own console and attempt a send before completing domain verification. A positive result is a message accepted for delivery as the target domain.
- Compare the SPF record against the organisation's actual mail flow. Any include with no corresponding account or configuration is a candidate.
Hunting notes
This kind of bug hides in DNS rather than in the application. The signal during recon is an SPF record that lists a shared sending provider the organisation does not appear to use, or one whose domain registration was never completed. A single dig for TXT records on the apex domain is enough to spot the candidates.
The researcher showed impact with a screenshot attached as proof of concept, which is the evidence a triager needs: not that the include exists, but that mail can actually be sent as the domain.
One limit worth remembering: the researcher states that Mandrill requires further verification of the domain, so the finding rests on sending being possible before that verification is complete, not on the absence of any verification step.
What happened, in plain words
Every email address has two parts: the part before the @ (like alice) and the part after it (like gratipay.com). The part after the @ is the domain, and it is the domain owner who decides who is allowed to send email that claims to come from it. When you receive an email, your mail provider can ask the domain's published rules whether the server that delivered the message was allowed to send on that domain's behalf. Those rules live in a public record called SPF.
Gratipay is the company whose domain was involved here. Its SPF record listed a mail-sending service called Mandrill as an allowed sender, even though Gratipay was not actually using Mandrill at the time. Mandrill is a shared service: many customers send mail through the same servers. Mandrill decides whether to let a customer send as a domain by looking at that domain's SPF record. If the record points at Mandrill, Mandrill treats that as the domain owner's permission.
Because Gratipay had never finished registering its domain with Mandrill, nothing tied gratipay.com to one particular Mandrill account. So the researcher opened their own Mandrill account, added gratipay.com as a sending domain, and sent email that appeared to come from @gratipay.com. That is email forgery, and it is useful for phishing: a message that looks like it comes from a company you trust, sent through a service that the domain itself has authorised.
The report was filed on HackerOne, a platform where security researchers report bugs to companies. It was disclosed on 19 March 2016, classified as improper authentication (generic), rated medium severity, and paid a bounty of 10.00 USD. The researcher is bugdiscloseguys.
The problem was not in any page or feature of Gratipay's website. It was in the domain's email configuration, which is stored in the public phone book of the internet, DNS.
Setup
The researcher needed two things, plus the further domain verification Mandrill asks for:
- A Mandrill account of their own.
- The ability to add
gratipay.comas a sending domain inside that account.
No access to Gratipay's servers, code or accounts was required. The report notes that Mandrill asks for a further verification of the domain, but that this verification is not what decides whether sending works: the SPF record is.
Finding it
The starting point was a DNS lookup of the SPF record for gratipay.com. DNS, the Domain Name System, is the internet's directory: it turns names like gratipay.com into addresses and also stores small text notes about a domain. An SPF record is one of those notes. It is a list of servers or services that are allowed to send email for the domain, plus a rule for what to do with everyone else.
The researcher found one SPF record:
v=spf1 include:email.freshdesk.com include:spf.mandrillapp.com include:_spf.google.com -all
Line by line, in plain words:
v=spf1says this is an SPF record, version 1. It is the label that tells mail servers what kind of note this is.include:email.freshdesk.comsays the servers of Freshdesk, a helpdesk service, are allowed to send mail for this domain.include:spf.mandrillapp.comsays the servers of Mandrill are allowed to send mail for this domain. This is the entry that matters for the bug.include:_spf.google.comsays Google's mail servers are allowed to send for this domain.-allis the catch-all rule: anything not covered by the includes above should be rejected outright. The minus sign means hard fail.
The record therefore authorises three services: Freshdesk, Mandrill and Google, and rejects everything else. The researcher's observation was that Mandrill was listed but was not actually in use by Gratipay at that time. That mismatch is what made the record interesting. An SPF include is a public statement that the listed provider's servers may send mail for the domain, and Mandrill reads that same statement when deciding whether to let one of its customers send as the domain.
Exploitation
Step 1: Add the domain to a Mandrill account
The researcher added gratipay.com as a sending domain in their own Mandrill account. Mandrill requires a further verification of the domain, but the researcher points out that this does not prevent sending: Mandrill allows a customer to send email from a domain if that domain's SPF records point at Mandrill's servers. The SPF record above does exactly that.
Think of it like a building's guest list. The SPF record is the list posted at the door saying which security companies may escort guests in. Mandrill is one of those security companies. Mandrill's own rule is: if a building has named us on its door list, we will escort anyone who asks us. The building owner was supposed to sign a separate form with Mandrill naming one specific escort, but never did, so any Mandrill customer could walk in.
Step 2: Send mail as the domain
With the domain added, the researcher used their own Mandrill account to send email that appears to originate from @gratipay.com. The report does not include the API call or the message itself; it states the result and backs it with a screenshot.

The screenshot is the proof of concept attached to the report.
Root cause
SPF is a sender-authorisation mechanism: a receiving mail server checks whether the sending IP is permitted by the domain's SPF record. An IP address is the numeric address of a machine on the internet, the equivalent of a postal address for a server. When a message arrives, the receiving server looks up the domain in the From line, fetches that domain's SPF record, and asks: is the machine that just delivered this message on the list? If yes, the message passes the SPF check. If no, and the record ends in -all, it fails.
Mandrill, as a shared sending provider, uses the same signal in the opposite direction. If a customer wants to send as a domain, Mandrill treats the presence of include:spf.mandrillapp.com in that domain's SPF record as evidence that the domain owner has authorised Mandrill to send on its behalf. The domain owner is expected to complete Mandrill's registration process, which locks the domain to that one account.
Gratipay had the include in its SPF record but had not completed that registration. The record therefore authorised Mandrill's infrastructure in general, while nothing tied the domain to a specific Mandrill account. Any Mandrill customer could claim it. The existing defence, the -all at the end of the record, does not help here: it rejects senders outside the listed includes, and Mandrill is inside them.
Impact
An attacker with a Mandrill account can send email that appears to originate from @gratipay.com. The researcher frames the impact as phishing: recipients see a sender address in the Gratipay domain, and the mail passes SPF checks because it genuinely leaves Mandrill's authorised infrastructure. Phishing is the practice of sending a message that pretends to come from someone the recipient trusts, usually to trick them into clicking a link or handing over information. The report does not describe DKIM or DMARC behaviour, so how the message fares against those checks is not established here.
The researcher also argues the class of issue is newsworthy, citing the 2015 SendGrid email breach that was used to attack Coinbase, a bitcoin exchange. The conditions are narrow: the attack depends on the target domain listing Mandrill in SPF without having completed Mandrill's domain registration, and on the attacker holding a Mandrill account.
Fix
The patch the researcher proposes is to complete the Mandrill registration process. That locks out other Mandrill users from sending email that originates from *@gratipay.com. The report does not say whether the registration was completed or the include removed; either way, the goal is that the SPF include no longer stands open to any Mandrill customer.
Variants to test
- Check other shared sending providers in a target's SPF record, such as transactional email and helpdesk services. A positive result is a provider whose onboarding lets any customer claim the domain on the strength of the SPF include alone.
- Look for includes that the organisation no longer uses. A stale include is a sender authorisation nobody is watching, and it is the precondition for this bug.
- Try adding the domain in the provider's own console and attempt a send before completing domain verification. A positive result is a message accepted for delivery as the target domain.
- Compare the SPF record against the organisation's actual mail flow. Any include with no corresponding account or configuration is a candidate.
Hunting notes
This kind of bug hides in DNS rather than in the application. The signal during recon is an SPF record that lists a shared sending provider the organisation does not appear to use, or one whose domain registration was never completed. A single dig for TXT records on the apex domain is enough to spot the candidates. dig is a command-line tool that asks DNS for a record; TXT records are the type of DNS note that holds text such as SPF, and the apex domain is the bare domain name without any prefix like www.
The researcher showed impact with a screenshot attached as proof of concept, which is the evidence a triager needs: not that the include exists, but that mail can actually be sent as the domain. A triager is the person at the receiving company who reads a bug report and decides whether it is valid.
One limit worth remembering: the researcher states that Mandrill requires further verification of the domain, so the finding rests on sending being possible before that verification is complete, not on the absence of any verification step.
Glossary
- SPF (Sender Policy Framework): a public DNS record listing which servers or services may send email for a domain, and what to do with everyone else.
- DNS (Domain Name System): the internet's directory, which maps names to addresses and stores small text notes about domains.
- TXT record: a type of DNS note that holds free text, used to publish SPF among other things.
- Apex domain: the bare domain name, such as
gratipay.com, without any prefix likewww. - Include (in SPF): an entry that authorises another service's servers to send mail for the domain.
-all: the SPF rule meaning hard fail, rejecting any sender not covered by the record.- IP address: the numeric address of a machine on the internet.
- Domain: the part of an email address after the @, which identifies the organisation or person that owns it.
- Mandrill: a shared email-sending service used by many customers through the same infrastructure.
- Freshdesk: a helpdesk service named in the SPF record as an allowed sender.
- Phishing: sending a message that pretends to come from someone the recipient trusts, usually to trick them.
- Email forgery: sending a message with a sender address that belongs to someone else.
- Improper authentication: a weakness where a system accepts something as proof of identity when it should not.
- HackerOne: a platform where researchers report security bugs to companies.
- Bounty: a payment a company makes to a researcher for a valid report.
- Severity: a rating of how serious a bug is, here medium.
- API: an interface that lets one program talk to another over the network.
- Recon: the information-gathering phase of a security test.
- Triager: the person at a company who reads a bug report and decides whether it is valid.
dig: a command-line tool for querying DNS records.- Proof of concept: evidence, such as a screenshot or working demonstration, that a bug can actually be exploited.