Embedding Browser-Verified Domain Hashes in WebAuthn Signatures Blocks Phishing Relays
The Web Authentication API defeats adversary-in-the-middle attacks by cryptographically binding credentials to the exact domain in the address bar. This browser-level enforcement ensures that intercepted signatures are mathematically invalid on legitimate servers.
By Sergei Orlov
In short
- WebAuthn defeats real-time phishing by embedding the browser's current address bar domain directly into the cryptographic signature payload.
- Adversary-in-the-middle proxies can relay passwords and authenticator codes, but they cannot forge a WebAuthn signature for a mismatched origin.
- The protocol shifts security enforcement from human vigilance to mathematical validation, neutralizing attacks before they reach the application layer.
In this article
Multi-factor authentication no longer guarantees account security against modern phishing campaigns. Attackers now routinely bypass SMS codes and authenticator apps using reverse proxies that relay credentials in real time. The defense that actually stops this is WebAuthn, a standard that strips the human out of the verification loop.[1][2]
By cryptographically binding the login to the browser's address bar, WebAuthn renders intercepted credentials mathematically invalid. The protocol does not rely on users spotting a fake domain or a subtle spelling change. Instead, it forces the browser to embed the exact origin into the signature payload.[1][5]
This mechanism, known as origin binding, is the foundation of passkeys and FIDO2 hardware security keys. While marketing materials often focus on the convenience of biometric unlocks, the structural security gain happens invisibly. The biometric simply unlocks a private key; the origin binding prevents that key from signing a fraudulent challenge.[2][3]
The World Wide Web Consortium (W3C) standardized this approach with WebAuthn Level 1 in 2019, and the protocol has since evolved through Level 2 in 2021. As organizations face rising adversary-in-the-middle (AiTM) attacks, understanding how this cryptographic boundary holds is essential. The vulnerability in traditional MFA is not the strength of the factor, but its portability.[1][6]
How Reverse Proxies Hijack Sessions
To understand why WebAuthn succeeds, one must examine how traditional multi-factor authentication fails. Phishing-as-a-Service toolkits like Tycoon 2FA and Evilproxy do not bother cracking passwords or guessing time-based codes. They simply insert an intermediary server between the victim and the legitimate identity provider.[2][6]
When a user clicks a phishing link, they land on an attacker-controlled reverse proxy, such as a lookalike domain. The proxy fetches the real login page from the target bank or enterprise service and displays it to the user. The site looks authentic because it is the actual site, merely piped through a hostile conduit.[2][5]
As the user types their password, the proxy captures the keystrokes and instantly forwards them to the legitimate server. When the server demands a six-digit authenticator code, the proxy relays that prompt back to the user. The user enters the code, and the proxy submits it to complete the challenge.[1][4]
"The attack flow is automated and seamless," notes Adaptive Security's 2026 deployment guide. "The victim lands on a phishing page that looks identical to a legitimate login portal, enters their username and password, and the attacker's backend immediately submits those credentials."
Once the legitimate server accepts the code, it issues a session cookie to keep the user logged in. The reverse proxy intercepts this cookie, saves a copy for the attacker, and passes it down to the victim. The attacker now holds a fully authenticated session, bypassing the MFA entirely.[2][5]
Replacing Secrets With Signatures
WebAuthn dismantles this attack path by abandoning shared secrets entirely. Passwords, SMS texts, and authenticator codes all share a fatal flaw: they are portable strings of data. If an attacker acquires the string, they can submit it from anywhere, and the server cannot distinguish the source.[1][4]
Instead of secrets, WebAuthn relies on asymmetric public-key cryptography. During registration, the user's authenticator—whether a smartphone secure enclave or a hardware key—generates a unique key pair. The private key remains permanently locked inside the device hardware.[1][3]
The public key is transmitted to the relying party, which is the server managing the application. When the user attempts to log in, the server does not ask for a password. It generates a random cryptographic challenge and sends it to the browser, demanding a signature from the corresponding private key.[4][5]
The user authorizes the signature locally, typically using a biometric prompt like Face ID or a device PIN. The authenticator signs the challenge and returns the payload to the server. Because the private key never leaves the device, an attacker cannot steal it from a database breach or intercept it in transit.[1][4]
Crucially, the signature proves possession of the key without revealing the key itself. The server verifies the response using the stored public key. If the math checks out, the authentication succeeds. But this challenge-response cycle alone does not stop a reverse proxy from relaying the challenge.[1][5]
How the Browser Traps the Proxy
The definitive defense against AiTM phishing lies in a specific WebAuthn property called origin binding. When the server sends the challenge, the browser intervenes before passing the data to the authenticator. The browser captures the exact domain currently displayed in the address bar.[1][6]
WebAuthn utilizes two distinct domain identifiers to forge this lock. The first is the Relying Party ID, a string chosen by the service during registration, typically the root domain. The authenticator hashes this ID into a 32-byte hash and embeds it in the signature.[4][6]
The second identifier is the Client Data Hash. The browser takes the challenge, the origin URL it actually sees, and other metadata, bundling them into a JSON object. It computes a SHA-256 hash of this object and hands it to the authenticator to sign alongside the Relying Party ID hash.[2][5]
If a user is tricked into visiting a proxy domain, the browser dutifully records that proxy as the origin. The reverse proxy relays the challenge from the real bank, but it cannot force the victim's browser to lie about its current address. The browser locks the fraudulent origin into the payload.[1][2]
When the proxy forwards the signed response to the legitimate bank, the server unpacks the data. It expects to see its own origin cryptographically sealed in the signature. Instead, it finds the proxy domain. The server immediately rejects the authentication, neutralizing the attack at the protocol level.[4][6]
Session Theft and Post-Login Risks
While WebAuthn provides an ironclad defense during the authentication ceremony, it does not solve every security challenge. The protocol ensures that an attacker cannot obtain a valid login signature from a mismatched domain. However, it does not protect the session after the login completes.[1][5]
If an organization implements WebAuthn but allows users to fall back to legacy passwords, attackers will simply target the weaker method. Maintaining transitional fallback methods leaves the credential replay vulnerability exposed, undermining the structural gains of the new protocol.[2][4]
Furthermore, if an attacker compromises the user's local device with malware, they can extract the session cookies directly from the browser cache. WebAuthn secures the entry door, but a stolen session cookie grants the attacker full access without needing to authenticate again.[5][6]
To mitigate this, high-assurance environments are exploring token-binding protocols that tie the session cookie to the specific device hardware. Until those standards mature, session hijacking remains a viable, albeit more difficult, avenue for sophisticated threat actors.[2][6]
The FIDO Alliance acknowledges these residual risks. In their 2025 deployment guidelines, they note that while passkeys prevent direct account compromise through phishing, compromised sessions can still allow attackers to perform actions on behalf of legitimate users.[2]
Deploying Phishing Resistance
Despite these post-login caveats, the transition to WebAuthn represents the most significant upgrade in web security in a decade. The FIDO Alliance reported in 2025 that 53 percent of surveyed users had enabled passkeys on at least one account, driven by major consumer platform rollouts.[2][6]
For enterprise technology leaders, the mandate is clear. The US Cybersecurity and Infrastructure Security Agency (CISA) now classifies FIDO2 and WebAuthn as the only fully phishing-resistant authentication standards. Legacy MFA is no longer considered sufficient for privileged access.[5][6]
The US Cybersecurity and Infrastructure Security Agency (CISA) now classifies FIDO2 and WebAuthn as the only fully phishing-resistant authentication standards.
Implementing this architecture requires careful engineering. Developers must rigorously validate the challenge values, the origin, the relying party ID hash, and the signature on the server side. A flawed server implementation that ignores the origin check completely negates the browser's protections.[1][4]
WebAuthn shifts the burden of security from human vigilance to cryptographic math. Users no longer need to scrutinize URLs for subtle typos, and IT departments no longer need to train employees to spot invisible reverse proxies. The protocol simply refuses to cooperate with a lie, closing the vulnerability that made credential relay possible.[1][6]
How we did this
- Method
- Cryptographic payload comparison and protocol derivation. We compared the data structures transmitted during an adversary-in-the-middle (AiTM) reverse proxy attack against the required signature inputs defined in the W3C Web Authentication (WebAuthn) Level 2 specifications to isolate the exact point of failure for relay attacks.
- What we found
- The analysis reveals that WebAuthn does not actually detect the presence of an adversary-in-the-middle proxy. Instead, it forces the browser to embed the proxy's own domain into the cryptographic signature, ensuring the legitimate server mathematically rejects the payload. The defense relies entirely on the browser's isolation of the origin, not on network-level threat detection.
- What we worked from
- WebAuthn signature payload requirements (rpIdHash and clientDataHash): Mandatory inclusion of the browser-verified origin in the signed authenticator data — W3C
- AiTM reverse proxy credential relay mechanism: Real-time interception and forwarding of portable authentication factors — FIDO Alliance
- Limits of this analysis
- This protocol analysis focuses strictly on the authentication ceremony. It does not account for malware that extracts session cookies post-login, nor does it cover scenarios where the user's local device is fully compromised.
Definitions
- WebAuthn
- A W3C standard that provides a browser API for authenticating users via public-key cryptography instead of passwords.
- Adversary-in-the-middle (AiTM)
- An attack where a hostile server sits between the user and the legitimate site, relaying traffic to intercept credentials.
- Origin Binding
- A cryptographic mechanism that ties an authentication signature to the specific website domain requesting it.
- Relying Party ID
- The registered domain name of the legitimate service, which is hashed and embedded into the WebAuthn signature.
- Client Data Hash
- A cryptographic hash generated by the browser that includes the challenge and the actual origin URL the user is visiting.
Questions & answers
Can I use WebAuthn on a device without a biometric scanner?
Yes. While biometrics are common, the WebAuthn standard allows authenticators to use a local PIN or even a swipe pattern to unlock the private key, ensuring compatibility with older hardware.
How do I recover my account if I lose my hardware security key?
Most services require users to register at least two authenticators, or they provide a one-time cryptographic recovery code. Synced passkeys solve this by backing up the private key to a cloud provider like Apple or Google.
Does WebAuthn protect against malicious browser extensions?
No. Browser extensions operate within the trusted context of the browser itself and can read data directly from the page DOM, allowing them to steal session cookies even after a successful WebAuthn login.
Are passkeys and WebAuthn the same thing?
Passkeys are the consumer-friendly term for discoverable FIDO2 credentials that utilize the WebAuthn API. WebAuthn is the underlying technical standard that makes passkeys function across different websites.
Analysis by camp
Protocol Engineers
Argue that security must be enforced by cryptographic math at the browser level, removing human judgment from the authentication loop.
Engineers designing authentication standards emphasize that human users cannot reliably detect sophisticated reverse proxies. By moving the origin verification into the browser's cryptographic payload, they ensure that the protocol itself rejects fraudulent domains. This perspective prioritizes structural security over user training, asserting that if a system allows a user to make a fatal mistake, the system is flawed.
Threat Intelligence Analysts
Focus on the rapid evolution of AiTM reverse proxies and stress that legacy MFA is now structurally compromised.
Security analysts tracking active phishing campaigns note that attackers have fully automated the bypass of SMS and TOTP codes. They view the deployment of WebAuthn not as an optional upgrade, but as an urgent necessity to counter Phishing-as-a-Service platforms. From this viewpoint, any authentication flow that relies on a portable secret is already obsolete against modern tooling.
Identity Standards Bodies
Advocate for universal passkey adoption while acknowledging the ongoing challenges of session theft and legacy fallback methods.
Organizations like the FIDO Alliance push for broad consumer and enterprise adoption of origin-bound credentials. However, they caution that implementing WebAuthn is only half the battle. If services maintain legacy password fallbacks or fail to secure post-login session cookies, attackers will simply pivot to those remaining vulnerabilities. Their focus is on comprehensive ecosystem deprecation of shared secrets.
- Protocol Engineers
- Argue that security must be enforced by cryptographic math at the browser level, removing human judgment from the authentication loop.
- Threat Intelligence Analysts
- Focus on the rapid evolution of AiTM reverse proxies and stress that legacy MFA is now structurally compromised.
- Identity Standards Bodies
- Advocate for universal passkey adoption while acknowledging the ongoing challenges of session theft and legacy fallback methods.
Perspectives this story doesn't cover
- End-users frustrated by account recovery processes
- Small business IT teams lacking resources to implement WebAuthn
Sources
[1]W3CProtocol EngineersWeb Authentication: An API for accessing Public Key Credentials Level 2
Read on W3C →
[2]FIDO AllianceIdentity Standards BodiesPasskeys: A passwordless and phishing-resistant authentication mechanism
Read on FIDO Alliance →
[3]WikipediaWeb Authentication
Read on Wikipedia →
[4]MDN Web DocsProtocol EngineersWeb Authentication API
Read on MDN Web Docs →
[5]NISTThreat Intelligence AnalystsDigital Identity Guidelines: Authentication and Lifecycle Management
Read on NIST →
[6]Factlen Editorial TeamIdentity Standards BodiesSynthesis by Factlen editorial team
Read on Factlen Editorial Team →
More in Technology
See all →OAuth 2.0
The Six Steps of the OAuth 2.0 Authorization Code Flow with PKCE
4 sources
Core Vulnerability
WordPress Patches Critical Core Vulnerability as Attackers Exploit Flaw Within Hours
5 sources
Zero-Day Exploits
Chinese State-Linked Hackers Exploit Chrome-Windows Zero-Day Chain to Deploy CLEANGULP Malware
4 sources
Data Sanitization
The Physical and Cryptographic Thresholds of Flash Memory Sanitization
7 sources
Comments
Every angle. Every day.
Get Technology stories with full source coverage and perspective breakdowns, free every day.




