← All resources
Explainer

Device code phishing and consent attacks: how attackers get in through genuine sign-in pages

Device code phishing, ConsentFix, FileFix and fake connected apps abuse genuine sign-in flows or the user's own keyboard, so MFA and link scanners see nothing wrong. Here is how they work and how to shut them down.

Explainer · 7 min read · By SafeToOpen Research · Published

Device code phishing is one of a family of attacks that need no fake login page. The victim signs in on the genuine Microsoft page, completes their own multi-factor authentication (MFA) and, without realising it, hands the attacker a working session. Its relatives work the same way. OAuth consent phishing, ConsentFix, FileFix and the Salesforce "connected app" phone calls behind several of last year's data thefts all get the user to take the risky step on a real page or with their own keyboard.

Because the pages are genuine, domain reputation checks, email link scanning and many endpoint tools have nothing to flag. This guide explains how each attack works, why MFA does not stop it, and which settings and controls do.

What is device code phishing?

The device code flow exists for devices without a proper keyboard, such as a smart TV or a meeting room display. The device shows a short code, and the user types it into a sign-in page on their phone or laptop. Once they sign in, the device receives tokens for their account.

In device code phishing, the attacker starts that flow and sends the code to the victim. Microsoft described a campaign by a group it tracks as Storm-2372, active since August 2024, that built rapport over WhatsApp, Signal and Microsoft Teams, then sent invitations to fake Teams meetings that asked the target to enter a code [1]. The victim typed it on Microsoft's real page, and the attacker received access and refresh tokens that worked for as long as they stayed valid [1]. Targets included government, defence, health, telecoms and energy organisations [1].

What began as a targeted technique has gone mainstream. Proofpoint said that by September 2025 it saw "widespread campaigns" using device code flows, which it called highly unusual [2]. Lures posed as shared documents, salary reports or token re-authorisation notices, and often claimed the code was a one-time password [2]. Proofpoint also tracked a tool that pairs QR codes with device code prompts, so QR code phishing and device code abuse now overlap [2].

How OAuth consent phishing works

OAuth is the standard that lets one app act for you in another, for example a scheduling tool that reads your calendar. In consent phishing, the attacker registers an app with a trusted-looking name and asks the user to approve it. The approval is a permission grant, not a password, so it stays in place until someone finds and removes it.

Proofpoint reported more than 50 impersonated apps in email campaigns, posing as Adobe, DocuSign, SharePoint and RingCentral [3]. The apps asked for minimal permissions. Whether the user clicked Accept or Cancel, they were sent on to a fake Microsoft sign-in page that captured their password and MFA session cookie [3]. By the end of July 2025, Proofpoint had seen attempted takeovers of nearly 3,000 accounts across more than 900 Microsoft 365 environments, with a confirmed success rate above 50% [3].

Nearly 3,000
Microsoft 365 accounts, in more than 900 environments, faced attempted takeover through fake OAuth app campaigns in the first seven months of 2025 [3]

Microsoft announced in June 2025 that it would require admin consent for third-party app access, with the change rolling out from mid-July [3]. That helps, but only if tenants keep the stricter setting and admins review the apps that were approved before it.

ConsentFix and FileFix: when the victim pastes the attack

ClickFix taught attackers that the user's own keyboard is a delivery channel. A fake error or CAPTCHA page tells the user to copy a command and run it. Microsoft's Digital Defense Report 2025, as reported by The Register, found ClickFix was the most common initial access method seen by Microsoft Defender Experts, at 47 percent of attacks [4]. ESET recorded a 517% rise in ClickFix since the second half of 2024 [5].

47%
of attacks seen by Microsoft Defender Experts started with ClickFix, where the user pastes and runs the attacker's command themselves [4]

FileFix, demonstrated by the researcher mr.d0x in June 2025, moves the trick into File Explorer [6]. A page claims a file has been shared and offers a button that opens File Explorer through the browser's file upload feature. The user is told to paste a "file path" into the address bar, but the clipboard actually holds a PowerShell command with a fake path tacked on the end, so only the path is visible [6].

ConsentFix, disclosed by Push Security in December 2025, applies the same idea to sign-in [7]. Victims reached the page through Google Search, often on compromised websites with a good reputation. A sign-in button opened the genuine Microsoft login for the Azure CLI, a first-party Microsoft tool that is exempt from the consent limits applied to third-party apps [7]. The browser then landed on a localhost address (a web address that points back at the user's own computer) carrying an authorisation code, and the page asked the user to paste that address back in. That gave the attacker access to the account [7]. No password was phished and no MFA prompt appeared, so passkeys made no difference [7].

Salesforce vishing and connected app abuse

The same pattern appears in SaaS platforms, often over the phone. Google's Threat Intelligence Group described UNC6040, a financially motivated group whose callers posed as IT support and talked employees through Salesforce's connected app setup page to approve a modified version of the Data Loader tool [8]. The victim entered a "connection code", which works much like a device code, and the attacker's app was linked to the company's Salesforce data [8]. In every case Google observed, the attackers relied on manipulating people, not on a flaw in Salesforce [8].

In September 2025 the FBI warned that authorising a malicious connected app gets around MFA, password resets and login monitoring, because the tokens are issued by Salesforce itself and the activity can look like a trusted integration [9]. Voice is now a main delivery route for this kind of attack: CrowdStrike recorded a 442% rise in voice phishing between the first and second halves of 2024 [10].

Why MFA and email filters miss these attacks

Every attack above shares three traits. The page is genuine, so there is no look-alike domain to catch. The user completes their own MFA, so the sign-in looks normal. And the harmful step, typing a code, pasting an address or approving an app, is something the user does on purpose.

Like zero-day phishing, these attacks leave little for a blocklist to match. They go one step further, because the sign-in itself happens on a trusted page, so judging that page is not enough. Our guide on how real-time phishing detection works explains how browser-based tools judge pages as they load, which suits cloned login pages and newly registered domains. Device code and consent attacks also need checks based on context: did the user start this device code sign-in, is a localhost address with an authorisation code being pasted into a website, and is an app approval happening while someone is on a call?

How to stop device code phishing and consent attacks

Most of the protection comes from identity settings that many organisations have never reviewed.

  1. Block the device code flow where you do not need it. Microsoft recommends blocking it wherever possible and restricting it with Conditional Access where it is needed [1]. Proofpoint gives the same advice and suggests allowing it only for approved users, operating systems or IP ranges [2].
  2. Require admin approval for new apps. Limit user consent to third-party apps in Microsoft Entra and Google Workspace, give staff a request route, and review existing grants for unfamiliar apps.
  3. Watch first-party developer tools. Sign-ins to the Azure CLI from people who are not administrators or developers deserve a closer look [7].
  4. Lock down Salesforce connected apps. Restrict who can manage connected apps, allowlist approved ones, set trusted IP ranges and limit the API permission that Data Loader needs [8].
  5. Revoke sessions, not just passwords. After a suspected compromise, revoke the user's refresh tokens and sign-in sessions [1], and remove any unknown app grants.
  6. Set a phone rule. Tell staff that IT will never ask them to read out a code, approve an app or paste a link during a call.

What to look for in a browser-layer control: a clear warning on Microsoft and Google device code pages ("only enter a code you started yourself"), or a block where your organisation does not use device codes; a check when a localhost address carrying an authorisation code is pasted into a web page; ClickFix detection that also covers FileFix and macOS Terminal lures; consent checks that extend to Salesforce connected apps and GitHub or Slack app installs; and events sent to your SIEM so the identity team can act on them.

Phishing-resistant MFA is still worth deploying, but these attacks are built to work around it. Closing unused sign-in flows, tightening app consent and adding context-aware checks in the browser leaves attackers far fewer genuine pages to abuse.

Frequently asked questions

No. In device code phishing the victim signs in on the genuine Microsoft page and completes their own MFA, so the attacker receives valid tokens. Passkeys and security keys do not help, because the user is authenticating for real. The fix is to block the device code flow with Conditional Access wherever it is not needed, and restrict it to specific devices where it is.

ConsentFix is an OAuth phishing technique disclosed by Push Security in December 2025. The victim signs in to the genuine Microsoft login for the Azure CLI, then is tricked into pasting the resulting localhost address, which contains an authorisation code, into the attacker's page. The attacker exchanges the code for access to the account without any password or MFA prompt.

In Microsoft Entra ID, create a Conditional Access policy that targets the device code flow under the authentication flows condition and set it to block. Apply it to all users, then exclude only the accounts or devices that genuinely need it, such as meeting room systems. Run it in report-only mode first so you can see who still uses the flow.

See how SafeToOpen protects the browser

Browser Security judges every page as it loads and stops brand-new phishing before a password is typed.

Browser Security for organisations →

Sources

  1. Microsoft Security Blog, Storm-2372 conducts device code phishing campaign (2025-02) www.microsoft.com
  2. Proofpoint, Access granted: phishing with device code authorization for account takeover (2025-12) www.proofpoint.com
  3. Proofpoint, Microsoft OAuth App Impersonation Campaign Leads to MFA Phishing (2025-07) www.proofpoint.com
  4. The Register, AI makes phishing 4.5x more effective, Microsoft says (2025-10) www.theregister.com
  5. TechRadar, ClickFix fake error message malware spikes over 500%, takes second place as the most abused attack vector (2025-06) www.techradar.com
  6. BleepingComputer, FileFix attack weaponizes Windows File Explorer for stealthy PowerShell commands (2025-06) www.bleepingcomputer.com
  7. Push Security, ConsentFix: Analyzing a browser-native ClickFix-style attack that hijacks OAuth consent grants (2025-12) pushsecurity.com
  8. Google Threat Intelligence Group, The Cost of a Call: From Voice Phishing to Data Extortion (2025-06) cloud.google.com
  9. FBI, Cyber Criminal Groups UNC6040 and UNC6395 Compromising Salesforce Instances for Data Theft and Extortion (FLASH-20250912-001) (2025-09) www.ic3.gov
  10. CrowdStrike, CrowdStrike 2025 Global Threat Report: Beware the Enterprising Adversary (2025-02) www.crowdstrike.com

External statistics are attributed to their original publishers and were accurate at the time of writing. Figures from industry reports vary by methodology and period; we link to primary sources so you can verify them.

Could you spot the fake?

Put this into practice: 12 real-world scams and genuine messages, two minutes, no sign-up.

12 examples · 2 minutes
Parcel Delivery
SMS · just now

Your package is on hold. A redelivery fee of $1.99 is required: parcel-redeliver.info/pay

Warm-up question

Real, or a scam?

Correct. It’s a scam.
It got you. This one’s a scam.
  • A fee to release a parcel (couriers don’t do this)
  • The link isn’t the courier’s real domain
  • Urgency: pay now or lose the package

That was the warm-up. 12 more are waiting.