DEV Community

Anton Minin Baranovskii
Anton Minin Baranovskii

Posted on

Architectural Asymmetry in Authentication: Part 2 — Risk Before Context

In Part 1, I introduced the concept of architectural asymmetry in authentication: when disclosure happens before context is established, risk is introduced before justification exists.

This article goes deeper into that first structural flaw.

The issue is not weak passwords.
It is not missing MFA.
It is the order of operations.


What “Context” Means in Practice

In authentication architecture, context is not a feeling of trust.

It is a set of verifiable guarantees that bind a request to a legitimate authentication flow.

At minimum:

  • Correct origin and domain
  • Strict redirect URI validation
  • State / nonce binding
  • PKCE (for public clients)
  • Proper session linkage
  • Clear separation between internal and external flow steps

TLS only secures transport to a domain.
It does not prove that the domain is intended.
UI similarity does not prove authenticity.
Redirect chains do not guarantee integrity.

Context must be enforced before sensitive input.


The First Irreversible Action

In many identity-first flows:

  1. User enters email / username
  2. User enters password or OTP
  3. System validates

The first irreversible action is identifier disclosure.

Even without password compromise, this enables:

  • Targeted phishing adaptation
  • Account enumeration (direct or timing-based)
  • SSO path selection
  • Context-aware social engineering

Once sent to the wrong endpoint, that disclosure cannot be undone.

Risk appears before context validation.


Early-Phase Attack Surface

This ordering enables several well-known attack classes.

Phishing Pages

A replica login page captures the identifier first.
The attacker adapts the next screen dynamically (corporate SSO, OTP, recovery).

The user has already committed to the wrong context.

Reverse Proxy Attacks

An “evil proxy” relays authentication traffic while capturing credentials or OTP codes.

Time-based OTP does not prevent this within its validity window if interception occurs before session binding.

Account Enumeration

Different error responses, timing differences, or secondary challenge variations allow attackers to confirm valid accounts at scale.

Even subtle response variance is measurable.

Flow Manipulation

Improper state/nonce binding or weak redirect validation can lead to session confusion or redirection abuse.

All of these operate before strong contextual guarantees are enforced.


Why UX Improvements Do Not Fix It

UI warnings help.
Domain highlighting helps.
Security education helps.

They do not change the structural order.

Even passkeys and WebAuthn reduce transferable secret entry, which is important.
But if the system still requests an identifier first to locate the account, disclosure-before-context remains.

The blast radius may shrink.
The asymmetry may weaken.
The ordering still matters.


Reordering the Flow

The alternative is not “authentication without identity”.

It is changing sequence:

Instead of:

disclosure → validation → access decision

Use:

context validation → risk evaluation → minimal confirmation → access

In practice:

  • Enforce strict redirect URI policies
  • Require state / nonce binding
  • Use PKCE by default
  • Bind confirmation to session and device
  • Delay identifier disclosure unless strictly required

Identity becomes conditional, not default.


Why This Is Architectural

This is not about adding more factors.
It is about when those factors are requested.

If the first irreversible action is disclosure, risk precedes justification.

Authentication design is defined by sequence, not just mechanisms.

Top comments (0)