
Microsoft Outlook Zero-Day Exploited to Steal NTLM Authentication Data
Microsoft Outlook zero-day CVE-2026-124194 is actively exploited to expose NTLM hashes. Learn how the attack works and how to protect your organization.
November 13, 2026 - Blog
Authored By Ali Charty, Ethical Hacker

OAuth 2.0 gives a convenient and frictionless experience to securely grant third-party applications access to user data without ever sharing credentials. However, abusing OAuth is becoming a massively growing vector for data breaches because of how the framework is notoriously flexible and relies on optional components.
Developers are left with numerous opportunities to inadvertently introduce critical security flaws throughout the OAuth implementation process. This article will examine the common vulnerabilities found and their remediation.
By far one of the most common misconfigurations encountered is the missing state parameter which exposes applications to Cross-Site Request Forgery (CSRF). Without a unique state value to bind the request to the user’s specific browser session, an application cannot verify who initiated the login process. The impact of this flaw could range from data theft and unauthorized resource access to complete, unnoticeable account takeovers.
To exploit this vulnerability, an attacker initiates the OAuth flow using their own-third party account. Right before their browser completes the handshake, they intercept the request and copy the resulting callback URL containing their authorization code. The attacker then tricks a victim into clicking this URL. Since the application fails to validate a session token, the victim’s browser blindly processes the attacker’s code, binding the attacker’s third-party account straight to the victim’s local profile.
Fortunately, mitigating this vulnerability is straight forward: enforcing the use of the state parameter generated by a cryptographically secure pseudo-random number generator. The state parameter acts as a unique identifier to prove that the OAuth response corresponds to a legitimate, user-initiated request. The defense mechanisms operate in three simple steps:
The client application generates a random state value when initiating the OAuth flow
The consent screen includes this state value in the callback URL.
Your app verifies that the incoming state matches the original value before processing the request.
By introducing a unique state value, the application ensures that the user who initiated the login sequence is the exact same user finishing it. To read mode on the code implementation, we recommend checking out Code Signal.
While the state parameter secures the user’s sessions against forgery, protecting the authorization code itself during transit requires an additional layer of security.
This is achieved using Proof Key for Code Exchange (PKCE), a security extension for the OAuth 2.0 authorization flow. PKCE introduces a secret generated by the client application called the Code Verifier, which is later validated by the authorization server.
The application hashes this value to create a Code Challenge and sends it over HTTPS during the initial authorization request. As a result, even if an attacker intercepts the Authorization Code, they still cannot exchange it for tokens without the original, unhashed Code verifier.
However, PKCE is only effective if the authorization server strictly enforces secure methods. If the server permits weaker configurations, such as accepting plain text challenges, or making PKCE optional, attackers can downgrade the flow and bypass the intended protections. Let’s look at an example:
The attacker intercepts the initial authorization request, which uses secure SHA-256 (S256):
GET /authorize?
client_id=bank_app
&response_type=code
&redirect_uri=https://app.bank.com/callback
&code_challenge=AbCdEf123
&code_challenge_method=S256
2. The attacker modifies the request, downgrading the code_challenge_method from S256 to plain before forwarding it to the authorization server:
GET /authorize?
client_id=bank_app
&response_type=code
&redirect_uri=https://app.bank.com/callback
&code_challenge=AbCdEf123
&code_challenge_method=plain
3. If the authorization server incorrectly accepts the plain method, it treats the string “AbCdEf123” as the literal secret rather than a hash. Now when the attacker intercepts the resulting Authorization Code, they can successfully exchange it for user tokens by passing that exact value as the code_verifier.
POST /token
code=Splxl0bEkej3dfbjnbkj21
code_verifier=AbCdEf123
To prevent downgrade attacks, PKCE must be made mandatory for all public clients and strictly bound to each individual transaction.
Follow these general steps to enforce PKCE within your environment:
Log into your Identity Provider’s developer console (e.g., Auth0, Okta, Microsoft Entra ID, Keycloak).
Navigate to your registered applications and select the specific app you want to update.
Locate the authentication settings, typically found under "Advanced Settings," "Grant Types," or "Credential Settings."
Ensure the "Authorization Code" grant type is enabled for the application.
Toggle the PKCE enforcement setting (often labeled as "Require PKCE" or "Strict Code Challenge") to ensure the authorization server rejects requests that don't include a code challenge.
Furthermore, if you are using Auth0, we recommend checking out the specialized Action script provided by Auth0 Support Center.
Beyond session forgery and credential interception, another critical vulnerability vector in the OAuth architecture involves endpoint manipulation.
If the authorization server improperly validates the redirect_uri parameter, an attacker can supply a modified or malicious redirect destination. As a result, the authorization code or access token is sent directly to an attacker-controlled domain instead of the legitimate client application.
In practice, authorization servers usually try to restrict redirects to trusted domains, but they often validate them too loosely. Rather than relying on arbitrary URL schemes that are easily blocked, attackers may abuse open redirects, partial string matching, wildcard-based validation, or subdomain confusion to bypass controls. Once bypassed, the attacker uses the trusted site to forward sensitive authentication tokens to their own server.
For example, if the authorization server only validates that the redirect URI begins with https://securebank.com, an attacker can exploit an open redirect flaw hosted on that trusted domain to bounce the authorization code to an attacker-controlled server: https://securebank.com/redirect?url=https://attacker.com/callback.
However, the success of this attack, depends heavily on how the credentials are returned by the server.
Query Parameters (response_mode=query): If the server passes the authorization code as a query parameter, any standard HTTP 302 server-side redirect on the host site will automatically forward the query string, and the code, directly to the attacker’s server.
URL Fragments (response_mode=fragment): When sensitive data is appended after a # symbol it is hidden from server logs and HTTP Referrer headers. Because browsers automatically strip URL fragments during cross-origin HTTP 302 redirects, a standard server-side open redirect will cause the attack to fail.
To successfully exfiltrate a fragment, the attacker must locate a Client-Side (JavaScript-Based) Open redirect (ex. Response.sendRedirect(request.getParameter(“url”));). Since client-side execution happen entirely within the browser, the fragment is preserved across the jump, carrying the exposed token straight to the attacker’s domain.
Securing this flaw requires strict implementation standards. RFC 9700 is very clear on stating the authorization server must strictly compare the redirect_uri against an explicitly pre-registered, exact-match allowlist. Wildcards, regular expressions, and partial string matching should be entirely avoided.
Here’s an example of a secure, exact-match validation implementation.
# Secure Authorization Server Logic (Python Example)
import logging
from urllib.parse import urlparse, urlunparse
logger = logging.getLogger(__name__)
# 1. Pre-registered database of allowed URIs for a specific client_id
REGISTERED_ALLOWLIST = {
"client_id_123": {
"https://securebank.com/oauth/callback",
"https://securebank.com/dashboard/auth"
}
}
def normalize_uri(uri: str) -> str:
parsed = urlparse(uri.strip())
return urlunparse(parsed._replace(
scheme=parsed.scheme.lower(),
netloc=parsed.netloc.lower()
))
def validate_initial_redirect_uri(client_id: str, requested_uri: str) -> bool:
allowed_uris = REGISTERED_ALLOWLIST.get(client_id, set())
# CRITICAL: Strict exact matching. No wildcards, no regex.
if normalize_uri(requested_uri) in allowed_uris:
return True
logger.warning(
"redirect_uri mismatch for client_id=%s (requested uri omitted)",
client_id
)
raise ValueError(f"400 Bad Request: Invalid redirect_uri for client '{client_id}'")
To ensure complete defense-in-depth, implement the following best practices:
Double Verification: The redirect_uri should be supplied and validated twice, first during the initial front-channel authorization request, and again during the back-channel token exchange process. The authorization server must confirm that both URIs are identical.
Securing Public Clients: When developing mobile or native desktop applications, keeping a client_secret confidential is not always possible. For these public clients, enforcing the PKCE mechanism is mandatory. This ensure that even if an attacker manages to bypass a loose redirect control and intercept the authorization code, they cannot exchange it for an access token without the original, ephemeral code verifier.
3: Excessive Scope
While OAuth scopes are designed to restrict application access, excessive scoping is a common misconfiguration. Adhering to the principle of least privilege ensure that the client applications are granted only the minimal permissions necessary to function.
Think of strict scoping as damage control. If an access token is leaked, a restricted scope limits the attackers reach. However, if a broad token is compromised, an attacker can freely call multiple APIs, modify user data, and potentially execute high-privilege operations.
To prevent privilege creep, consider the following best practices when architecting your OAuth scope:
Keep scopes task-specific: Ensure each scope maps to a distinct, isolated task to prevent privilege creep.
Request Just-in-Time Permissions: Restrict client applications to requesting only the specific scopes required for their immediate context or transaction.
Perform continuous reviews: Regular audit scope delimitations.
While restricting scopes limits what an active access token can do, the ultimate prize for an attacker is obtaining a credential that grants continuous, long-term access without requiring re-authentication.
Since refresh tokens can dynamically mint new access token indefinitely, RFC 9700 describes refresh tokens as attractive attacker targets and recommends rotation or sender-constraining, especially for public clients
Implement the following storage and validation controls when using refresh tokens:
Avoid Browser Storage: Refresh tokens must never be stored in insecure client-side environments like browser localStorage or sessionStorage where they are highly vulnerable to Cross-Site Scripting (XSS) attacks
Enforce Secure HTTP Cookies: Keep refresh token management bound to a backend server. If client-side persistence is absolutely necessary, isolate them within HttpOnly, Secure, and SameSite=Strict cookies to protect them from malicious script access
Implement Server-Side Hashing & Rotation: Authorization servers should encrypt or hash refresh tokens at rest. Furthermore, implement Refresh Token Rotation (RTR) to invalidate the old refresh token and issue a brand-new one upon every single access request, drastically minimizing the lifetime of an intercepted token.
To safely implement Refresh Token Rotation, the backend must keep a record of used tokens to catch reuse attempts. If an attacker and a victim both attempt to use the same refresh token, it indicates a breach.
The server should immediately invalidate that entire "family tree" of tokens, cutting off access for the attacker.
Here is a secure implementation pattern using Python:
import secrets
import hashlib
def _hash_string(token: str) -> str:
"""Helper to consistently hash tokens using SHA-256."""
return hashlib.sha256(token.encode('utf-8')).hexdigest()
def rotate_refresh_token(provided_token_string: str) -> str:
# Hash the incoming raw token to find its record in the DB
hashed_provided_token = _hash_string(provided_token_string)
token_record = db.find_refresh_token(hashed_provided_token)
if token_record is None:
raise ValueError("Invalid refresh token")
# Reject expired tokens before any security checks
if token_record.is_expired():
raise ValueError("Refresh token has expired")
# Replay attack detection: if this token was already used, a replay
# or theft is likely. Revoke the entire family tree to force re-login
if token_record.is_already_used():
db.revoke_all_tokens_in_family(token_record.family_id)
raise ValueError("Refresh token reuse detected")
# Generate a new opaque, cryptographically random token
new_token_string = secrets.token_urlsafe(64)
new_token_hashed = _hash_string(new_token_string)
# Atomically mark the old token as used and persist the new one,
# so a crash mid-rotation can't strand the user or leave a reusable token
with db.transaction():
db.mark_as_used(hashed_provided_token)
db.save_refresh_token(
token=new_token_hashed,
family_id=token_record.family_id,
is_already_used=False,
)
# Return the RAW unhashed token to the client
return new_token_string
Modern applications rely more heavily on interconnected APIs and decentralized identity, as such, a misconfigured OAuth implementation is becoming one of the most high-value attack vectors for an adversary. As you audit and deploy your authentication systems, ensure you have addressed the five OAuth Fundamentals:
Browser Sessions: Use a unique state parameter to completely eliminate CSRF vulnerabilities.
Code Transmission: Enforce PKCE on all public clients to stop code interception and reject downgrade schemes.
Traffic Routing: Avoid wildcards and regex; enforce strict, exact-match redirect allowlists to prevent token diversion.
Privilege Management: Minimize token scopes to tightly contain the blast radius if credentials are leaked.
Persistence: Isolate refresh tokens in secure backend sessions or HttpOnly cookies, and deploy a Refresh Token Rotation mechanism with replay attack detection.