Architectural Invariant Design: Passkey FIDO2 Hybrid Transport Origin Binding & Proximity Relay Defense
Passkey FIDO2 Hybrid Transport Origin Binding & Proximity Relay Defense defines an industrial-grade behavioral standard for security engineering. Enforces strict origin binding, cryptographic proximity assertions, and client data verification on WebAuthn cross-device (hybrid/caBLE) authentication ceremonies. Prevents Man-in-the-Middle (MitM) credential relay attacks where a remote attacker tricks a victim into authorizing a malicious session using QR code or cross-device flows. Mandates verification of the clientDataJSON origin, top-origin bindings, session-bound challenges, and hybrid transport flags on the relying party backend. Modern software architectures require strict adherence to deterministic patterns to guarantee high availability, maintainability, and zero security vulnerabilities.
Hazard Analysis: What Breaks Without This Rule
The following failure modes have been cataloged from hundreds of hours of production code reviews where AI assistants produced non-compliant implementations:
| Failure Mode | AI Symptom (The Anti-Pattern) | Severity | Production Impact & Remedy |
|---|---|---|---|
| AI Hallucination & Deprecation Drift | Blind Relying Party Authentication Accepting Unbound Challenges and Ignored Hybrid Transport State | Critical | Violating this industrial standard introduces regression bugs, security risks, and unexpected runtime failures in production. Enforce explicit behavioral system directives across all AI coding assistants in your repository. |
| Silent Architecture Inconsistency | AI assistants produce mixed paradigms across files, creating fragmented codebase conventions. | Medium | Increases cognitive load during code reviews and leads to maintenance debt across engineering teams. Pin project conventions in .cursor/rules, CLAUDE.md, and AGENTS.md so all team agents follow identical guardrails. |
Step-by-Step Production Directives
Each rule constraint below is injected into the AI agent's system prompt to establish deterministic boundaries:
Relying Party (RP) MUST strictly validate that clientDataJSON.origin exactly matches the canonical RP ID (scheme, host, and port) with constant-time equality checks.
Relying Party (RP) MUST strictly validate that clientDataJSON.origin exactly matches the canonical RP ID (scheme, host, and port) with constant-time equality checks.
Relying Party MUST tie the authentication challenge cryptographically to the specific ephemeral user session or ephemeral channel (e.g., hash-bound to an encrypted channel ID) to prevent cross-session challenge relay.
Relying Party MUST tie the authentication challenge cryptographically to the specific ephemeral user session or ephemeral channel (e.g., hash-bound to an encrypted channel ID) to prevent cross-session challenge relay.
Engineers MUST verify the 'authenticatorData.flags.up' (User Present) and evaluate 'authenticatorData.flags.uv' (User Verified) according to the configured UserVerificationRequirement
Engineers MUST verify the 'authenticatorData.flags.up' (User Present) and evaluate 'authenticatorData.flags.uv' (User Verified) according to the configured UserVerificationRequirement; unverified responses MUST NOT be promoted to high-assurance tiers.
Services MUST consume challenges exactly once (single-use semantics via atomic delete-on-read in distributed key-value stores) with an expiration TTL not exceeding 120 seconds.
Services MUST consume challenges exactly once (single-use semantics via atomic delete-on-read in distributed key-value stores) with an expiration TTL not exceeding 120 seconds.
Relying Party MUST validate clientDataJSON.type matches 'webauthn.get' for assertion or 'webauthn.create' for attestation, and reject any unexpected type variants.
Relying Party MUST validate clientDataJSON.type matches 'webauthn.get' for assertion or 'webauthn.create' for attestation, and reject any unexpected type variants.
When evaluating hybrid responses containing cross-origin or topOrigin structures (WebAuthn Level 3), engineers MUST verify that topOrigin matches an explicitly configured, trusted whitelist of parent origins.
When evaluating hybrid responses containing cross-origin or topOrigin structures (WebAuthn Level 3), engineers MUST verify that topOrigin matches an explicitly configured, trusted whitelist of parent origins.
Engineers MUST NOT permit client-supplied 'rpId' overrides
Engineers MUST NOT permit client-supplied 'rpId' overrides; the Relying Party identifier MUST be statically controlled on the server based on environment configuration.
Frequently Asked Technical Questions
Common questions developers face when configuring AI coding assistants for this stack:
Q:Why is Passkey FIDO2 Hybrid Transport Origin Binding & Proximity Relay Defense critical for AI coding assistants?
Enforces strict origin binding, cryptographic proximity assertions, and client data verification on WebAuthn cross-device (hybrid/caBLE) authentication ceremonies. Prevents Man-in-the-Middle (MitM) credential relay attacks where a remote attacker tricks a victim into authorizing a malicious session using QR code or cross-device flows. Mandates verification of the clientDataJSON origin, top-origin bindings, session-bound challenges, and hybrid transport flags on the relying party backend. Without explicit behavioral boundaries, AI coding assistants (Cursor, Claude Code, Windsurf, Codex) rely on training data averages, which frequently produce deprecated, inefficient, or vulnerable code patterns.
Q:How does adopting this rule prevent AI hallucinations?
This rule explicitly declares what the AI must avoid (Blind Relying Party Authentication Accepting Unbound Challenges and Ignored Hybrid Transport State) and prescribes verified positive examples. Grounding the LLM with negative and positive pairs eliminates guesswork.
Q:Which AI coding environments are supported?
This specification is multi-platform compatible: Cursor (.cursor/rules/*.mdc & .cursorrules), Anthropic Claude Code (CLAUDE.md), Windsurf (.windsurfrules), Codex / Cline (AGENTS.md), and GitHub Copilot (.github/copilot-instructions.md).
Q:Can I combine this rule with other technology stacks?
Yes. Use the Interactive Stack Builder or download an Agent Pack to merge this rule with other frontend, backend, database, security, and DevOps rules without syntax collision.