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.
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:
login.microsoftonline.com) to authenticate. They complete their normal login process, including MFA.localhost URL which contains the OAuth authorization code as a parameter. This is standard behavior for the Azure CLI login flow.localhost redirect and the code) and paste it into a form on the page to complete the 'verification'.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.
code) which is a short-lived credential used to obtain a long-lived access token. This is part of T1528 - Steal Application Access Token.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.The impact of a successful ConsentFix attack is equivalent to a full credential compromise:
Detecting ConsentFix requires focusing on identity and browser-level events:
localhost.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.
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.

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.
Help others stay informed about cybersecurity threats