\

One Token to rule them all – Obtaining Global Admin in every Entra ID tenant

331 points - 09/17/2025

Source
  • Freak_NL

    09/18/2025

    The linked CVE has something that strikes me as odd. It marks this exploit's 'Attack Complexity' as 'High', meaning:

    > A successful attack depends on conditions beyond the attacker's control. That is, a successful attack cannot be accomplished at will, but requires the attacker to invest in some measurable amount of effort in preparation or execution against the vulnerable component before a successful attack can be expected. For example, a successful attack may require an attacker to: gather knowledge about the environment in which the vulnerable target/component exists; prepare the target environment to improve exploit reliability; or inject themselves into the logical network path between the target and the resource requested by the victim in order to read and/or modify network communications (e.g., a man in the middle attack).

    But reading Dirk-jan's article, really all you need is basic admin knowledge of Entra ID etc., and the netId of any single user on the targetted environment, which can be found using brute force enumeration. The rest is public knowledge.

    Strictly speaking the attacker would need to invest in some measurable amount of effort, but that seems like stretching the definition to make the CVE look less awkward.

      • Arch-TK

        09/18/2025

        In my personal experience as someone who has spent the last 6 years of his career in the security industry, almost nobody actually uses CVSS the way it is intended, they just almost arbitrarily tweak the CVSS inputs to produce an output they like.

        You are correct that the attack complexity probably shouldn't be high in this case. But presumably the person calculating the CVSS score thought it was too high if attack complexity wasn't set to high.

        CVSS has other issues, like people trying to apply it to things that are not vulnerabilities. I would ignore most CVSS scores you see and just read what the issue is instead and make your own judgement call.

        • jodrellblank

          09/18/2025

          "1.1 18 Sep 2025 The CVSS score for this vulnerability has been updated to reflect a change in the Attack Complexity metric from High to Low."

          https://msrc.microsoft.com/update-guide/vulnerability/CVE-20...

            • Freak_NL

              09/19/2025

              Huh. I did not expect that to happen. Well spotted.

          • lukev

            09/18/2025

            To be fair, doing even the most basic task in Entra as an authenticated user is also "high complexity", so the difficulty of attacking it can only go up from there.

            • lucasRW

              09/18/2025

              "really all you need is basic admin knowledge of Entra ID"

              > Yes, because any "basic user of Entra ID with basic knowledge of it" has found undocumented types of tokens, and stringed them with another Graph API vulnerability, to impersonate users...

              Basic Entra ID users don't even know what an Entra ID token is exactly.

                • Freak_NL

                  09/18/2025

                  Having knowledge of the exploit itself does not seem to factor in to determining the complexity of the exploit. Rather, it appears to document the complexity of executing it against any given target, given that the exploit is known to the attacker (and someone else has done the hard work of finding it). See the 'A successful attack depends on conditions beyond the attacker's control.' part in the documentation of 'high'.

                  In this exploit, there are hardly any conditions beyond the attacker's control which must be satisfied.

          • nl

            09/18/2025

            Well at least someone could log in using Entra ID!

              • thatwasunusual

                09/19/2025

                lol. So much coffee found the way through my nose... :D

            • darkamaul

              09/18/2025

              Impressive work!

              This makes me wonder if Microsoft’s commitment to long-term support is part of the problem: instead of deprecating these ancient APIs they keep them on life-support, but forget some "regression-test" on how they interact with the shiny new surfaces.

              Feels like P0’s Windows Registry talks, most of the vulns weren’t in the new code, they were in the how legacy behaviors interacted with newer features.

                • tonyhart7

                  09/18/2025

                  Microsoft also forced to keep these legacy code tbh

                  You see, most enterprise client with big enough contract can force to do this and MS need to support this customer until they migrate or if they ever be at all

                  I may argue for any big legacy enterprise software, its easier to rewrite the damn whole thing than to support the legacy code forever but they cant do that even if they have motivation/resource

                    • the8472

                      09/18/2025

                      They could put it behind a flag, like LANMAN auth.

              • userbinator

                09/18/2025

                failed to properly validate the originating tenant

                One wonders whether those who designed all this ever considered what that field in the token is for.

                The word "tenant" is also very telling --- you're just renting, and the "landlord" always has the keys.

                  • nine_k

                    09/18/2025

                    It's even worse: "Because of the nature of these Actor tokens, they are not subject to security policies like Conditional Access". This goes against all principles of good security design. A token that gives root access instead of specifying a particular action allowed just invites misuse, erroneous or malicious.

                    I would expect these tokens to be like JWT or macaroons, carrying specific permissions within specific bounds / tenants. Alas.

                      • milkshakes

                        09/18/2025

                        well, you're in luck, they are JWTs in fact. JWTs in JWTs, so extra secure.

                          • Freak_NL

                            09/18/2025

                            And of course, because the inner JWT is already signed, why bother signing the outer one? Just validate the inner one!

                            I'm feeling sorry for those poor abused JWTs in this vulnerability.

                        • Nursie

                          09/18/2025

                          They are!

                          But the systems that have been built around them are bad. Firstly in issuing these ‘root’ tokens at all, and secondly in not checking the claims properly.

                          A JWT is only as good as the systems it’s used by.

                      • viraptor

                        09/18/2025

                        It's the standard naming for the services. Multi-tenancy is a thing, but landlords are not in this naming context.

                    • pcj-github

                      09/18/2025

                      Absolutely insane. Security so weak, it seems like you discovered an intentional backdoor.

                        • cookiengineer

                          09/18/2025

                          My NSL detector is off the charts here.

                        • otabdeveloper4

                          09/18/2025

                          > impersonation tokens, called “Actor tokens”, that Microsoft uses in their backend for service-to-service (S2S)

                          Literally every single "security" framework uses God-mode long-lived tokens for non-human identities.

                          (Except for SPIFFE, but that's a niche thing and used only for Kubernetes bullshit.)

                          The whole field of "security" is a farce staffed by clowns.

                            • cyberax

                              09/18/2025

                              AWS had switched from using something like this ("injection tokens") to just regular IAM roles, though managed by the AWS.

                              The only special permission that services (actually, the AWS accounts that they use) inside the AWS have is access to "service principals". The service roles inside customer accounts then use them to grant access.

                              AWS IAM is painful, but it shows that you can design a secure permission system.

                                • otabdeveloper4

                                  09/18/2025

                                  You can add many layers of indirection, but unless you're actually authenticating that a system service is using the credentials (and not, say, a user or a script) then it boils down to a long-lived token at the end.

                                    • noctune

                                      09/18/2025

                                      You can condition IAM on Nitro attestation, so that's doable (if a lot more work than usual).

                                      • cyberax

                                        09/18/2025

                                        Regular individual systems that run the code inside the AWS generally do not have long-lived tokens. The credentials are ultimately _pushed_ to the systems running the services by a small set of highly secured and monitored privileged systems.

                                        You get to see that even with the regular public AWS/EC2. Instance roles are managed externally from the customers' points of view.

                                          • otabdeveloper4

                                            09/19/2025

                                            > highly secured and monitored privileged systems

                                            So, ultimately "keys to the castle" aka a long password?

                                              • cyberax

                                                09/19/2025

                                                It's a bit more complicated :) There are HSMs and code signing thrown into the mix. They went into total overengineering mode when designing it.

                                                But ultimately, any realistic design will eventually have systems that have to be trusted. It's just a question of isolating them.

                                        • oneplane

                                          09/18/2025

                                          If the long-lived token is actually a private key that is non-retrievable and the secrecy and origin is attested by a HSM, I'm fine with that.

                          • buster

                            09/18/2025

                            Reminds me of this dutch guy "obtaining all data from random Microsoft 365 tenants": https://media.ccc.de/v/38c3-from-simulation-to-tenant-takeov...

                            Great talk, by the way.

                            • gfody

                              09/18/2025

                              after 36 years kerberos seems pretty stable, secure, and well supported finally. why do we need Entra?

                                • yabones

                                  09/18/2025

                                  One of the bigger issues is the double-hop problem. It's both an important security boundary, and one of the biggest butt-pains about the protocol.

                                  https://techcommunity.microsoft.com/blog/askds/understanding...

                                  It works great within a single organization hierarchy, but becomes pretty painful for anything we'd consider "SaaS"

                                  • EvanAnderson

                                    09/18/2025

                                    Kerberos doesn't have a good monthly recurring revenue "story".

                                    • jiggawatts

                                      09/18/2025

                                      Kerberos doesn't work well on the web.

                                        • zbentley

                                          09/18/2025

                                          Citation needed. Other than throughput/reliability risks posed by the revocation check flow (which I know aren’t the reason people don’t use Kerberos on the web, since the big auth providers’ SPOFiness in this area is way worse, as proven by countless outages induced by so-and-so rickety auth component failing bringing down a major provider), Kerberos’ adoption issues on the web have more to do with network effect and monetization than technical limitations with the protocol.

                                            • gfody

                                              09/21/2025

                                              seriously "kerberos doesn't work well on the web" is like saying "cars don't work well on the road"

                                              browsers could make it easier to approve domains for spnego (chrome already makes it automatic for enterprise accounts). the market just doesn't want real security, it wants to login with its facebook profile.

                                  • rootsudo

                                    09/18/2025

                                    Oh man, I was close with this a few times as I ran powershell in different ISE windows and sometimes copied/pasted things over for different tenants, darn - it really seemed so obvious of an exploit!

                                    • Sytten

                                      09/18/2025

                                      I recently had to deal with Entra ID for the first time to setup Microsoft OAuth for our site and my god why is it so badly designed.

                                      Just creating a tenant is a PITA and you get a default tenant you can't change without paying for Microsoft 365? Then you have subscriptions, Microsoft partners, Enteprise vs individual accounts, etc. All mixed with legacy AD naming and renaming, documentation with outdated screenshots, Microsoft Partners bullshit.

                                        • 7bit

                                          09/18/2025

                                          > Just creating a tenant is a PITA and you get a default tenant you can't change without paying for Microsoft 365?

                                          What exactly ist a PITA when creating a tenant? It's straightforward.

                                          And what do you mean by default tenant that you cannot change unless you pay? Nothing comes to mind where that would be the case.

                                          Are you sure you're not just using it wrong?

                                            • Sytten

                                              09/18/2025

                                              You literally cannot change your tenant ID and the form by default picks a random for you. There is a hidden form I found on reddit that lets you pick a tenant ID but wtf. Also by default you can't create a tenant without an existing Microsoft account, which everybody acknowledge is a chicken and egg problem.

                                                • 7bit

                                                  09/26/2025

                                                  Why would you ever want to change the tenant id? Thise are problems amateurs create for themselves that professionals dont care abouz at all.

                                                  I agree needing an account to create a tenant is not ideal. But that's nothing more than a minor inconvenience. If these are the big problems you make out with M365, then I think I can just shrug your opinion away.

                                                  • magicalhippo

                                                    09/18/2025

                                                    Why do you care about the tenant id?

                                            • Propelloni

                                              09/18/2025

                                              There ist a whole industry clustered around this FUBAR that makes its living by helping companies navigate this shit. It has small and big players and they have no incentive to tell you that there is anything else you could use. The monthly Service fee is too tasty.

                                              • 09/18/2025

                                                • Kneecaps07

                                                  09/18/2025

                                                  It takes like two minutes to create a tenant. Click Next a bunch, enter a credit card, you're done.

                                                  And yes they have different types of accounts and methods of billing. Their customer base is probably in the hundreds of millions. People are going to want options. I don't really see the issue there.

                                              • malnourish

                                                09/18/2025

                                                I imagine this paid out quote the bounty; exploited, it's hard to think of a more damning security flaw.

                                                • VoidWhisperer

                                                  09/18/2025

                                                  I feel like I remember a similar attack related to Entra ID from a while ago, although I can't remember exactly what it was (maybe [0] or [1]?).. I understand that this is a complex system, but I would be concerned with the number of relatively high severity vulnerabilities being found in it.

                                                  [0]: https://securitylabs.datadoghq.com/articles/i-spy-escalating... [1]: https://www.semperis.com/blog/unoauthorized-privilege-elevat...

                                                    • mindcrash

                                                      09/18/2025

                                                      You could get into Microsoft's tenant with any Entra account.

                                                      That's because Microsoft's own fucking developers don't even understand how Entra authentication/authorization works, and that in some/most scenarios you'll need to check if a account is actually authorized to enter a protected resource post-login (which you need to do within the Oauth login flow in the resource being accessed, nobody will do it for you).

                                                      Something I already discovered by accident (and fixed, ofcourse!) in my own SaaS service at the time (with support for Entra B2B authentication) even before this researcher discovered the same at Microsoft:

                                                      https://research.eye.security/consent-and-compromise/

                                                      HN discussion thread: https://news.ycombinator.com/item?id=44850681

                                                        • VoidWhisperer

                                                          09/19/2025

                                                          Ah yeah, that eye.security post was the one I had seen before. Thanks!

                                                  • cr125rider

                                                    09/18/2025

                                                    Wow the keys to all the enterprise castles! That’s wild!

                                                    • jwpapi

                                                      09/18/2025

                                                      Was there a bounty?

                                                      • TavsiE9s

                                                        09/18/2025

                                                        Microsoft, Azure, why am I not surprised?

                                                        • curtisszmania

                                                          09/18/2025

                                                          [dead]