August 18, 2023
This article unveils an email-based vulnerability across digital platforms, demonstrating how it enables unauthorized access to company resources and suggests potential remedies for such security risks.
DeepStrike
During a security assessment, our team identified a vulnerability in the email-based invoice import functionality. By exploiting this weakness, we gained access to the organization's internal resources, including GitHub and Slack.
The platform (redacted.com
), offers a diverse range of accounting services. A particular feature that stood out was the ability to add expenses through email. To utilize this function, users are required to forward their email receipts to [email protected]
. However, before doing so, one needs to set a source email address with redacted.com
to ensure that the emails are recognized and accepted.
For illustration, if I receive an invoice at [email protected]
and need to upload it to the accounting website, I first need to set [email protected]
on redacted.com
as the source email to store the received mails from. Subsequently, I forward the invoice from [email protected]
to [email protected]
. The platform then processes this email, converting its HTML content into a PDF, which gets stored in the user's portal.
To leverage this vulnerability and infiltrate the company's workspace, our approach was to register on GitHub as example using the [email protected]
email. Here's a step-by-step breakdown of our exploitation process:
[email protected]
. It's essential to note that GitHub dispatches these confirmation emails from the address [email protected]
.[email protected]
, we modified the source email setting in our portal to [email protected]
. This meant any correspondence from [email protected]
directed to [email protected]
would be rerouted and stored in our account on the portal.[email protected]
. As anticipated, GitHub's confirmation email (originating from [email protected]
) was dispatched to [email protected]
.[email protected]
as our source, the PDF containing the confirmation code was deposited into our portal account.While exploiting GitHub was relatively straightforward given their consistent use of the static [email protected]
address, other platforms presented challenges. For instance, Slack employs dynamic emails in the form of no-reply-{{Random-Token}}@slack.com
, making it nearly impossible to predict the exact source email for our portal.
However, where there's a will, there's a way. We found an ingenious workaround by leveraging the trust relationships between third-party authentication providers and platforms:
[email protected]
as our source email.[email protected]
.[email protected]
was not only an active email on the target domain but also linked to a new Apple account.[email protected]
) was authenticated, Slack trusted this authentication and allowed us to proceed, giving us access to the company’s workspace without the traditional confirmation step.In essence, we managed to circumvent the dynamic email hurdle by harnessing the implicit trust platforms place in third-party authentication providers, exemplifying the potential risks inherent in such trust relationships.
Certain accounting platforms require the use of a single source email, specifically the one utilized during sign up. For instance, if you register with [email protected]
, only the emails forwarded from [email protected]
to [email protected]
will appear in your account. This implies you'd need to register with [email protected]
(in the context of GitHub) to successfully exploit the system. The trick lies in the fact that some applications mandate email confirmation, while others do not. We successfully circumvented the email confirmation in certain targets because some platforms underestimate the security implications of such a requirement.
The most effective method to rectify this problem is to offer users a completely distinct email domain. For instance, if your employees are using redacted.com
, establish a new domain for user emails like redacted.co
, or create a new subdomain, such as mail.redacted.com
. Consequently, the receipts email would change to [email protected]
or [email protected]
. This strategy effectively compartmentalizes different email functions, significantly reducing the risk of such vulnerabilities.
We initiated our search by looking for recurring patterns in email addresses and keywords that might indicate similar functionalities, such as "receipts@" and "expenses@" To aid in our search, we employed search dorks to comb through networks for comparable features, using search terms like "“receipt@" and "Forward" We then applied these discovered patterns to identify new potential targets. One notable example was within lifestyle and time management applications, where users are often required to forward specific emails to addresses like [email protected] We frequently found mentions of these functionalities in community forums, support sections, or official documentation, either as user queries or as described features.
Throughout our exhaustive research, we scrutinized over 75 platforms that employed similar email-based functionalities. The security landscape of these platforms is as follows:
[email protected]
or [email protected]
, further compartmentalizing their email roles and reducing risk.