New 'ConsentFix' Phishing Attack Hijacks Microsoft Accounts, Bypassing MFA via Azure CLI Abuse

Researchers Uncover 'ConsentFix' Phishing Technique that Abuses Trusted Azure CLI for MFA-Bypassing Account Takeover

HIGH
December 17, 2025
5m read
PhishingCloud SecurityThreat Actor

Related Entities

Organizations

Products & Tech

Azure CLI Microsoft Entra IDOAuth

Other

ConsentFix

Full Report

Executive Summary

Security researchers at Push Security have identified a novel phishing technique named ConsentFix that enables attackers to perform a full account takeover of Microsoft accounts without stealing credentials or bypassing Multi-Factor Authentication (MFA). The attack is a social engineering scheme that manipulates a user into copying a sensitive OAuth authorization code from their browser's address bar and pasting it into an attacker-controlled web page. This code is then used by the attacker to authenticate via the legitimate Microsoft Azure CLI, a trusted first-party application. This abuse of a trusted application allows the attacker to gain an access token with the user's full permissions, effectively hijacking the session. The technique is particularly dangerous because it occurs entirely within the browser, evades many endpoint security controls, and works even against users with phishing-resistant MFA like passkeys.


Threat Overview

ConsentFix is an evolution of OAuth consent phishing that weaponizes the user's trust in legitimate login flows. The attack is browser-native, meaning it doesn't rely on traditional malware or executable files.

The attack flow is as follows:

  1. Lure: A user is directed to a malicious website, often via poisoned search engine results or a standard phishing email.
  2. Social Engineering: The site presents a fake challenge, such as a Cloudflare Turnstile CAPTCHA, asking the user to verify their identity with their Microsoft work account.
  3. Legitimate Login: The user is redirected to the official Microsoft login page (login.microsoftonline.com) to authenticate. They complete their normal login process, including MFA.
  4. Token Capture: After successful login, Microsoft redirects the browser to a localhost URL which contains the OAuth authorization code as a parameter. This is standard behavior for the Azure CLI login flow.
  5. The 'Fix': The attacker's phishing page then displays an instruction, telling the user to copy the entire URL from their browser's address bar (the one containing the localhost redirect and the code) and paste it into a form on the page to complete the 'verification'.
  6. Account Takeover: When the user pastes the URL, they are unknowingly handing the authorization code to the attacker. The attacker uses this code on their own machine with the Azure CLI to request an access token and refresh token, giving them persistent access to the victim's account and all associated Microsoft 365 services.

Technical Analysis

The core of the ConsentFix attack is the abuse of the OAuth 2.0 authorization code grant flow combined with social engineering. The key technical enabler is the implicit trust granted to the Azure CLI application within Microsoft Entra ID.

  • OAuth Abuse: The attack targets the authorization code (code) which is a short-lived credential used to obtain a long-lived access token. This is part of T1528 - Steal Application Access Token.
  • Trusted Application: Because the Azure CLI is a first-party Microsoft application, it is pre-consented in most tenants and is often exempt from conditional access policies or stricter consent settings that would apply to third-party apps. This allows the attacker to seamlessly gain access without triggering admin approval workflows.
  • Session Hijacking: Once the attacker has the access token, they have effectively hijacked the user's session, corresponding to T1550.001 - Application Access Token. They can then perform any action the user is permitted to do, such as reading emails, accessing SharePoint/OneDrive files, or modifying Azure resources.
  • Defense Evasion: The attack bypasses many traditional defenses. No credentials are phished, so password managers and credential stuffing protections are ineffective. MFA is completed legitimately by the user, so it is not 'bypassed' in a technical sense. The activity happens in the browser, making it hard for some EDR tools to see the malicious context.

Impact Assessment

The impact of a successful ConsentFix attack is equivalent to a full credential compromise:

  • Complete Account Takeover: The attacker gains full access to the victim's Microsoft 365 account, including email (Outlook), file storage (SharePoint, OneDrive), and collaboration tools (Teams).
  • Data Breach: Sensitive corporate data can be exfiltrated from the compromised account.
  • Business Email Compromise (BEC): The attacker can use the compromised mailbox to launch convincing BEC attacks against colleagues, partners, or customers.
  • Cloud Infrastructure Compromise: If the user has administrative rights in Azure, the attacker can use their session to modify, delete, or create cloud resources, potentially leading to a much larger breach.
  • Persistence: The attacker obtains a refresh token, allowing them to maintain access to the account even if the user changes their password.

Detection & Response

Detecting ConsentFix requires focusing on identity and browser-level events:

  • Monitor for Anomalous Token Issuance: In Microsoft Entra ID sign-in logs, look for token issuance events for the Azure CLI application where the IP address of the token request does not match the IP address of the initial user authentication. This is a high-fidelity indicator of this attack.
  • Browser Security Tools: Deploy browser security solutions that can detect and block malicious copy-and-paste events or warn users when they are on a known phishing page that uses this technique.
  • User-Reported Phishing: Educate users to be suspicious of any website that asks them to copy and paste a URL from their address bar, especially one containing localhost.
  • Incident Response: If an attack is detected, immediately revoke all refresh tokens for the affected user account in the Entra ID portal to terminate the attacker's session.

Mitigation

  1. User Education: The primary defense is user awareness. Train users to never copy and paste URLs from their address bar into a website, especially as part of a login or verification process. This is a D3FEND User Behavior Analysis (D3-UBA) related control.
  2. Restrict Application Consent: While Azure CLI is trusted, review and restrict user consent for third-party applications. Configure Entra ID to require admin consent for any new application to limit the broader threat of consent phishing.
  3. Conditional Access Policies: Implement strict Conditional Access policies in Entra ID that enforce location-based or device compliance checks for token issuance. A policy that flags or blocks token requests from untrusted locations or devices could disrupt the attacker's ability to use the stolen code.
  4. Browser Security Solutions: Deploy advanced browser security platforms, like the one offered by Push Security, that are specifically designed to detect and block ClickFix and ConsentFix attack patterns at the browser level.

Timeline of Events

1
December 11, 2025
Push Security publishes research on the 'ConsentFix' attack technique.
2
December 17, 2025
This article was published

MITRE ATT&CK Mitigations

The most effective mitigation is training users to recognize the social engineering tactic and never copy-paste URLs from their address bar.

Utilize advanced browser security tools that can detect and block malicious copy-paste actions.

Implement Conditional Access policies in Entra ID to block token issuance from non-compliant or untrusted locations.

Mapped D3FEND Techniques:

D3FEND Defensive Countermeasures

To combat the ConsentFix attack, organizations must implement Web Session Activity Analysis, focusing on the browser itself. This involves deploying a browser security solution capable of monitoring user actions in real-time. Specifically for this threat, the tool must be able to detect when a user copies content from the browser's address bar, analyze the content of that URL for sensitive information like an OAuth 'code' parameter, and understand the context of the destination page where the user is pasting. If the tool detects a user copying a localhost URL with an authorization code and attempting to paste it into a form on an untrusted website, it should block the action and alert both the user and the security team. This provides a high-fidelity, preventative control that stops the social engineering tactic at its source, before the token is ever compromised.

A key detective control for ConsentFix is to analyze the authentication events within Microsoft Entra ID. Security teams should configure their SIEM or identity threat detection platform to correlate two distinct events: the initial user authentication and the subsequent token request. For a legitimate Azure CLI login, the IP address for both the user's login to Microsoft and the CLI's token exchange request should be the same. In a ConsentFix attack, the user logs in from their IP, but the attacker uses the stolen code to request the token from their own, different IP. Creating a rule that alerts on 'Azure CLI token request from IP different than initial auth IP' provides a powerful, high-confidence indicator of this specific attack pattern. This allows for rapid incident response, including the immediate revocation of the attacker's session.

While ConsentFix abuses a trusted first-party application, organizations can still limit the blast radius by hardening permissions related to application consent. Configure Microsoft Entra ID to block users from consenting to new third-party applications and enforce an admin consent workflow. While this doesn't stop the Azure CLI abuse directly, it hardens the environment against the broader class of consent phishing attacks. Furthermore, regularly review permissions granted to all applications, including first-party ones, and ensure that Conditional Access policies (e.g., requiring compliant devices or trusted locations) are applied as broadly as possible. Reducing the overall number of applications with standing access and enforcing stricter conditions for token issuance makes the environment more resilient to token theft tactics like ConsentFix.

Sources & References

ConsentFix: Browser-native ClickFix hijacks OAuth grants
Push Security (pushsecurity.com) December 11, 2025
New ConsentFix attack hijacks Microsoft accounts via Azure CLI
BleepingComputer (bleepingcomputer.com) December 11, 2025
Azure CLI Trust Abused in ConsentFix Account Takeovers
eSecurity Planet (esecurityplanet.com) December 16, 2025
Meet ConsentFix, a new twist on the ClickFix phishing attack
CSO Online (csoonline.com) December 12, 2025

Article Author

Jason Gomes

Jason Gomes

• Cybersecurity Practitioner

Cybersecurity professional with over 10 years of specialized experience in security operations, threat intelligence, incident response, and security automation. Expertise spans SOAR/XSOAR orchestration, threat intelligence platforms, SIEM/UEBA analytics, and building cyber fusion centers. Background includes technical enablement, solution architecture for enterprise and government clients, and implementing security automation workflows across IR, TIP, and SOC use cases.

Threat Intelligence & AnalysisSecurity Orchestration (SOAR/XSOAR)Incident Response & Digital ForensicsSecurity Operations Center (SOC)SIEM & Security AnalyticsCyber Fusion & Threat SharingSecurity Automation & IntegrationManaged Detection & Response (MDR)

Tags

ConsentFixPhishingOAuthMFA BypassAccount TakeoverAzure CLIMicrosoft Entra IDPush SecuritySocial Engineering

📢 Share This Article

Help others stay informed about cybersecurity threats

Continue Reading