VOOZH about

URL: https://thenewstack.io/saas-rootkit-attack-to-create-hidden-rules-in-office-365/

⇱ SaaS RootKit: Attack to Create Hidden Rules in Office 365 - The New Stack


TNS
SUBSCRIBE
Join our community of software engineering leaders and aspirational developers. Always stay in-the-know by getting the most important news and exclusive content delivered fresh to your inbox to learn more about at-scale software development.
REQUIRED
It seems that you've previously unsubscribed from our newsletter in the past. Click the button below to open the re-subscribe form in a new tab. When you're done, simply close that tab and continue with this form to complete your subscription.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.
Welcome and thank you for joining The New Stack community!
Please answer a few simple questions to help us deliver the news and resources you are interested in.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Great to meet you!
Tell us a bit about your job so we can cover the topics you find most relevant.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Welcome!

We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.

What’s next?

Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.

Follow TNS on your favorite social media networks.

Become a TNS follower on LinkedIn.

Check out the latest featured and trending stories while you wait for your first TNS newsletter.

PREV
1 of 2
NEXT
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
Thanks for your opinion! Subscribe below to get the final results, published exclusively in our TNS Update newsletter:
NEW! Try Stackie AI
From clobbered drafts to real-time sync
Apr 14th 2026 10:00am, by David Moore
TypeScript 6.0 RC arrives as a bridge to a faster future
Mar 14th 2026 9:00am, by Darryl K. Taft
Mastra empowers web devs to build AI agents in TypeScript
Jan 28th 2026 11:00am, by Loraine Lawson
2023-02-14 08:02:05
SaaS RootKit: Attack to Create Hidden Rules in Office 365
sponsor-adaptive-shield,sponsored-post-contributed,
Cloud Services / Security

SaaS RootKit: Attack to Create Hidden Rules in Office 365

Through this vulnerability, an attack can use Exchange’s legacy API to create hidden forwarding rules in Microsoft 365 mailboxes.
Feb 14th, 2023 8:02am by Maor Bin
👁 Featued image for: SaaS RootKit: Attack to Create Hidden Rules in Office 365
Adaptive Shield sponsored this post. Insight Partners is an investor in Adaptive Shield and TNS.

Bad actors are always on the search for new methods of attack, making it our job to always stay two steps ahead of them. Keeping organizations secure doesn’t stop at hardening security settings. It also means staying on top of changing or emerging weak points that can be exploited.

Adaptive Shield security researchers have discovered a new attack vector due to a vulnerability within Microsoft’s OAuth application registration. Through this vulnerability, an attack can use Exchange’s legacy API to create hidden forwarding rules in Microsoft 365 mailboxes. This blog will take a look at how these hidden forwarding rules are created and the threat they pose.

SaaS-to-SaaS Access Through OAuth 2.0

For companies to protect themselves from this new attack vector, there must first be a foundational understanding of third-party app access. Third-party apps connect to other apps by gaining access and permission to different information and settings. These apps are incredibly valuable to businesses. When connecting a third-party app, the app requests one or more scopes. To enable these privileges, a user must first verify their identity and then grant permissions that allow the app to execute code to perform logic within their environment but still behind the scenes.

👁 Image

Figure 1. Connecting third-party apps

The OAuth 2.0 mechanism simplifies the process of authentication and authorizations to offer a fine-grained delegation of access rights. OAuth doesn’t share password data, but instead uses authorization tokens to prove an identity between consumers and service providers to provide an authorization flow for apps. Represented in the form of scopes, an application asks for the user’s authorization for specific permissions. Third-party apps can be completely harmless and a valuable tool to business, but they can also be an executable file and a big threat.

Learn more about the top use cases to secure your entire SaaS stack.

Adaptive Shield, the leading SSPM company, enables security teams to gain complete control over their SaaS app stack. Adaptive Shield works with many Fortune 500 enterprises and has been named a 2022 Gartner® Cool Vendor™. Visit us at www.adaptive-shield.com or follow us on LinkedIn. Insight Partners is an investor in Adaptive Shield and TNS.
Learn More

Inbox Rules

So what are inbox rules in Microsoft 365? Simply put, they are actions that occur based on preset conditions within a Microsoft mailbox. For example: auto-marking the importance level of incoming messages, automatically deleting outgoing emails, automatically forwarding incoming emails and so on. Forwarding rules can be set up by a company that wants emails forwarded for a specific user’s mailbox. To configure this setting, admins typically use `ForwardingSMTPAddress` or `ForwardingAddress`. Alternatively, users can set them up themselves using Mail-Flow Rules or Inbox Rules, which trigger different forwarding rules based on different attributes of the user’s inbox.

Below is an example of how users can create an inbox rule.

👁 Image

Figure 2. Creating forwarding rules in Microsoft

👁 Image

Figure 3. Creating forwarding rules in Microsoft

Hidden Forwarding Rules

Compass Security’s Damian Pflammater first discovered an undocumented method that can be used to hide these types of inbox rules. As seen in figure 3, these hidden forwarding rules are fully functional and can be seen on the backend. However, when a user searches for them through common interfaces such as email clients, admin dashboard or API, the rules are not visible (Figure 4).

👁 Image

Figure 4. Back-end of hidden forwarding rules

👁 Image

Figure 5. Hidden forwarding rules

Pflammater reported his discovery to Microsoft and received the following response.

“[…] Our engineering team investigated the behavior that you described. They determined that it is not considered a security issue because it requires control of the account to create these rules. However, they are considering ways to improve the software in the future.”

“[…] MSRC will not be tracking the issue and we won’t have future updates about it […]”

In other words, Microsoft said, “It’s not a bug, it’s a feature.”

The Next Evolution: An Attack Method Through SaaS

After reading about Pflammater’s discovery and Microsoft’s response, our researchers were intrigued enough to explore this behavior more. Third-party app access combined with hidden forwarding rules creates a sort of SaaS rootkit. A rootkit is a collection of computer software, typically malicious, designed to enable access to a computer or an area of its software that is not otherwise allowed and often masks its existence or the existence of other software. Rootkit detection is difficult, because a rootkit may be able to subvert the software that is intended to find it. An attacker’s hidden forwarding rules in Microsoft 365 act as a SaaS rootkit.

The SaaS rootkit allows attacks to create malware that lives as a software-as-a-service app and maintain access to the victim’s account while going unnoticed. An attack through these hidden forwarding rules should not be mistaken for a one-off, but rather the start of a new attack method through SaaS apps.

👁 Image

Figure 6. Fake app permissions request

The attacker’s job is simple: Create an app that looks credible to entice a user to accept and gain permissions. While a bad actor can’t find online permissions/scopes in the user interface (UI), they are able to add them through a terminal script. An attack creates an app, then sends an offer to users to connect to the app. After a user accepts and grants permission, the attacker can use it to create forwarding rules and hide them from the user interface like a rootkit. The user will see an OAuth app dialog box on the official Microsoft site and will likely accept it as they normally would. When a user accepts, they are giving the bad actor the token for the specific permissions access.

👁 Image

Figure 7. Terminal script of hidden rule

Now that the attacker has permissions, they can create the hidden forwarding rules. Rogue OAuth apps are equivalent to malware and operate no differently than sending a malicious executable file. This type of attack cannot be detected by endpoint detection and response tools.

Microsoft Response

After contacting Microsoft to bring the issue to their attention, we received the following response:

“We have gone over the report in detail, including all of your additional files. Unfortunately, it was determined that while the issue you reported is valid, it does not meet our bar for immediate servicing. In this case, we do think this can be improved upon, but due to the high requirements on the attacker, with the issue being post exploitation of an administrator, this would not be tracked by the security team for servicing.

That being said, this submission has been flagged for future review by the product team as an opportunity to improve the security of the affected product.”

How to Best Mitigate a SaaS Rootkit Attack

There’s no one bulletproof way to eliminate SaaS rootkit attacks, but there are a few best practices that can help keep organizations more protected.

  • Monitor third-party app access and their permissions to ensure that apps are legitimate and given only the access they require.
  • Track activities and be on the lookout for new inbox rules to identify any new connections from untrusted domains.
  • Disable third-party app registrations where possible to reduce risk.

Conclusion

Hidden forwarding rules are still a threat, even more so when they appear through the trusted Microsoft website. The traditional controls that were created to stop malware have struggled to keep up with the evolution of malware and the new attack vector that can exploit any SaaS app, from Microsoft 365 to Salesforce to Google Workspace, etc. Organizations should use native security configurations to control the OAuth application installations across SaaS apps to protect users from malicious attacks like these.

Get Forrester’s Report “Embrace A Paradigm Shift In SaaS Protection: SaaS Security Posture Management”.

Adaptive Shield, the leading SSPM company, enables security teams to gain complete control over their SaaS app stack. Adaptive Shield works with many Fortune 500 enterprises and has been named a 2022 Gartner® Cool Vendor™. Visit us at www.adaptive-shield.com or follow us on LinkedIn. Insight Partners is an investor in Adaptive Shield and TNS.
Learn More
TRENDING STORIES
Maor Bin is CEO and co-founder of Adaptive Shield. A former cybersecurity intelligence officer in the Israeli Defense Forces, he has over 16 years in cybersecurity leadership. In his career, he led SaaS threat detection research at Proofpoint and won...
Read more from Maor Bin
Adaptive Shield sponsored this post. Insight Partners is an investor in Adaptive Shield and TNS.
SHARE THIS STORY
TRENDING STORIES
TNS owner Insight Partners is an investor in: Simply, Adaptive Shield.
SHARE THIS STORY
TRENDING STORIES
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.