Latest / Defensive Line Shorts / The Defensive Line Shorts — Episode 7: ConsentFix
Transcript
- 0:00SPEAKER_01: Hello, and welcome to The Defensive Line Shorts.
- 0:03SPEAKER_01: For anyone joining for the first time,
- 0:05SPEAKER_01: each of these 10-minute episodes looks at one security control or one breach
- 0:09SPEAKER_01: from history.
- 0:10SPEAKER_01: Today, a newer technique that turns a perfectly genuine Microsoft sign-in into a stolen account.
- 0:16SPEAKER_01: It's called ConsentFix.
- 0:18SPEAKER_01: I'm Carter, and I'm an intelligence analyst.
- 0:21SPEAKER_01: My job is to explain how attacks work and why they catch people out.
- 0:25SPEAKER_01: And with me, as always, is Lizzie.
- 0:27SPEAKER_00: Thanks Carter.
- 0:28SPEAKER_00: I'm Lizzie and I'm a blue teamer.
- 0:30SPEAKER_00: I'll be focusing on what defenders can do about it and how much effort each option really takes.
- 0:36SPEAKER_01: Before we get into it, a quick note.
- 0:38SPEAKER_01: This briefing is drafted and read by AI, but reviewed and edited by humans.
- 0:43SPEAKER_01: To understand consent fix, you need one slightly odd fact about Microsoft Entra.
- 0:48SPEAKER_01: Some of Microsoft's own applications are trusted in every tenant by default.
- 0:53SPEAKER_01: Tools like the Azure Command Line Interface, Azure PowerShell, Visual Studio, and VS Code.
- 0:58SPEAKER_01: Any user can sign in to them without an admin ever approving anything.
- 1:02SPEAKER_01: That's convenient for developers.
- 1:04SPEAKER_01: It's also very convenient for attackers.
- 1:07SPEAKER_01: Here's how the attack runs.
- 1:09SPEAKER_01: The attacker builds a sign-in link for one of those trusted apps and sends it to the victim.
- 1:13SPEAKER_01: It might arrive by email, on a webpage, or during a phone call.
- 1:17SPEAKER_01: The victim clicks it and sees the real Microsoft sign-in page.
- 1:21SPEAKER_01: Not a copy.
- 1:22SPEAKER_01: The real one.
- 1:23SPEAKER_01: They enter their password,
- 1:24SPEAKER_01: they complete MFA, and every conditional access policy is checked and passed.
- 1:29SPEAKER_01: Then comes the trick.
- 1:31SPEAKER_01: After sign-in,
- 1:31SPEAKER_01: the app is set to hand the user back to their own computer,
- 1:35SPEAKER_01: a so-called localhost address.
- 1:37SPEAKER_01: Nothing is listening there,
- 1:38SPEAKER_01: so the browser shows an error page,
- 1:40SPEAKER_01: but the address bar of that error page contains an authorization code.
- 1:44SPEAKER_01: The attacker's instructions then ask the victim to copy that address,
- 1:47SPEAKER_01: or drag it, into a box on the attacker's page.
- 1:50SPEAKER_01: It's usually dressed up as a step to finish verification,
- 1:54SPEAKER_01: and once the attacker has that code,
- 1:56SPEAKER_01: they have around 10 minutes to swap it for tokens.
- 1:58SPEAKER_01: Those tokens let them act as the user,
- 2:01SPEAKER_01: and the refresh token can keep working for weeks or months.
- 2:05SPEAKER_01: What's awkward for defenders is that everything you've built checks
- 2:08SPEAKER_01: the victim's sign-in, not the attacker's.
- 2:11SPEAKER_01: MFA, device compliance,
- 2:13SPEAKER_01: location rules,
- 2:14SPEAKER_01: all of them passed because the victim really did sign in on a real device in
- 2:18SPEAKER_01: the right place.
- 2:20SPEAKER_01: The code swap happens later from their own infrastructure as a background sign-in.
- 2:25SPEAKER_01: Even passkeys don't help because nothing was phished at the sign-in page.
- 2:29SPEAKER_01: The weak point is the code, handed over by copy and paste.
- 2:33SPEAKER_01: Researchers have also found variants beyond the Azure tools.
- 2:35SPEAKER_01: Lizzie, how do you defend against something where the login itself is genuine?
- 2:57SPEAKER_00: You stop the sign-in from being possible in the first place.
- 3:00SPEAKER_00: My primary control is to make those first-party apps require assignment.
- 3:05SPEAKER_00: In Entra,
- 3:06SPEAKER_00: you can switch an app so that only users
- 3:08SPEAKER_00: or groups you've explicitly assigned can sign into it.
- 3:11SPEAKER_00: If the victim isn't assigned to Azure command line tools,
- 3:14SPEAKER_00: the sign-in fails and no authorization code is ever issued.
- 3:18SPEAKER_00: No code means nothing for the attacker to steal.
- 3:21SPEAKER_00: That's why I like it.
- 3:22SPEAKER_00: It stops the attack at step one rather than trying to catch it at step five.
- 3:27SPEAKER_00: There's one quirk worth knowing.
- 3:29SPEAKER_00: Some of these Microsoft apps don't appear in your enterprise applications list
- 3:33SPEAKER_00: until you create them in your tenant.
- 3:35SPEAKER_00: So the first step is often a short PowerShell job to add the app,
- 3:38SPEAKER_00: then switch on the assignment requirement,
- 3:40SPEAKER_00: then assign the people who genuinely need it.
- 3:43SPEAKER_00: Start with the big five.
- 3:45SPEAKER_00: Azure Command Line Tools, Azure PowerShell, Visual Studio, VS Code, and Teams PowerShell.
- 3:51SPEAKER_00: The effort is mostly in working out who actually uses them.
- 3:54SPEAKER_00: Your sign-in logs will tell you.
- 3:56SPEAKER_00: Look back over 90 days and see which users have signed in to each app.
- 4:00SPEAKER_00: Often it's a small group of developers and IT staff.
- 4:03SPEAKER_00: Put them in a security group and assign the group.
- 4:06SPEAKER_00: If you want to go further,
- 4:07SPEAKER_00: just-in-time access to that group
- 4:09SPEAKER_00: through privileged identity management Means even those users only have it
- 4:13SPEAKER_00: when they need it.
- 4:15SPEAKER_00: Once the big five are done, work outwards.
- 4:17SPEAKER_00: There are public lists of other Microsoft first-party apps with the same local host behavior.
- 4:22SPEAKER_00: Any that nobody in your organization has used for months are easy candidates
- 4:26SPEAKER_00: to lock down straight away.
- 4:28SPEAKER_00: And prioritize the ones with powerful access, like that Exchange Online app.
- 4:32SPEAKER_01: And it's worth saying where this sits in the bigger picture.
- 4:35SPEAKER_01: Consent fix is part of a trend we've talked about on these shorts before.
- 4:38SPEAKER_01: As passkeys make classic credential phishing harder,
- 4:41SPEAKER_01: attackers are moving to techniques where the victim signs in for real and
- 4:45SPEAKER_01: the attacker takes the result.
- 4:47SPEAKER_01: Device code phishing works like that.
- 4:49SPEAKER_01: So does consent phishing.
- 4:50SPEAKER_01: And the copy and paste step here will feel familiar from our click fix episode.
- 4:54SPEAKER_01: My assessment is that we'll keep seeing new variations on this theme
- 4:58SPEAKER_01: because abusing legitimate sign-in flows is far more reliable for attackers
- 5:02SPEAKER_01: than faking a login page.
- 5:04SPEAKER_00: Which is why I'd put detection second and be honest about who can do it.
- 5:08SPEAKER_00: There is a useful detection pattern.
- 5:10SPEAKER_00: The victim's sign-in and the attacker's code swap share the same session identifier
- 5:15SPEAKER_00: and the same app,
- 5:16SPEAKER_00: but come from different IP addresses, usually within 10 minutes of each other.
- 5:21SPEAKER_00: If you've got a SOC or a managed service with time to build and tune that, it's a good rule.
- 5:26SPEAKER_00: Then hunt for what attackers do next,
- 5:28SPEAKER_00: like new mailbox forwarding rules or secrets added to applications.
- 5:32SPEAKER_00: But for most organizations, that's an incident response tool rather than an everyday control.
- 5:38SPEAKER_00: It takes log expertise and time most teams don't have.
- 5:42SPEAKER_00: If that's you,
- 5:43SPEAKER_00: put your effort into the assignment lockdown because it's quick and it stops
- 5:47SPEAKER_00: the attack outright.
- 5:48SPEAKER_00: And if you do investigate a suspected case, remember what you're dealing with.
- 5:53SPEAKER_00: Resetting the password isn't enough.
- 5:55SPEAKER_00: Revoke the user's sessions and refresh tokens,
- 5:58SPEAKER_00: check for forwarding rules and new app registrations,
- 6:01SPEAKER_00: and review what the account accessed during that window.
- 6:04SPEAKER_00: On awareness,
- 6:05SPEAKER_00: the one message I'd give staff is never paste a web address from your browser into
- 6:10SPEAKER_00: a page or chat because someone asked you to.
- 6:13SPEAKER_01: So, three takeaways.
- 6:15SPEAKER_01: ConsentFix abuses Microsoft apps that are trusted in every tenant,
- 6:19SPEAKER_01: so the victim's sign-in, including MFA, is completely genuine.
- 6:24SPEAKER_01: Your best defense is to make those apps require assignment,
- 6:27SPEAKER_01: starting with the big five,
- 6:28SPEAKER_01: so For the weekly picture,
- 6:30SPEAKER_01: subscribe to The Defensive Line Weekly on Substack
- 6:33SPEAKER_01: and wherever you get your podcasts.
- 6:35SPEAKER_01: Until next time, stay defensive!