Ferritaas Incident Intelligence
Defect Intelligence Report Bug 0869402 Severity: Critical (P1)

SAML 2.0 Azure AD / Entra ID Assertion Drift Triggering Infinite Login Loop

Clock skew exceeding 120 seconds between Microsoft Entra ID (Azure AD) and the FortiOS SAML Service Provider daemon (samld) invalidates assertion timestamp conditions, triggering continuous HTTP 302 redirects and trapping remote workers in recursive login loops.

Technical Root Cause Analysis

During SAML 2.0 single sign-on flows, Microsoft Entra ID signs an XML assertion containing strict cryptographic time boundaries: <saml:Conditions NotBefore="2026-09-11T01:10:00Z" NotOnOrAfter="2026-09-11T01:15:00Z">. The FortiOS SAML daemon (samld) parses these attributes using its local system clock.

When network NTP synchronization is interrupted (e.g. firewall egress blocking UDP port 123, hypervisor host clock skew on FortiGate-VM, or hardware RTC drift), the FortiGate clock drifts relative to Microsoft UTC time. If this skew exceeds 120 seconds, the sp_validator module rejects the assertion as either "Not yet valid" (FortiGate clock is behind) or "Assertion has expired" (FortiGate clock is ahead).

Because the user's browser maintains an active session cookie with Entra ID, the FortiGate issues an HTTP 302 redirect back to the IdP authorization endpoint. Entra ID sees an authenticated session and immediately issues a fresh SAML response back to the FortiGate Assertion Consumer Service (ACS) URL. The FortiGate rejects it again, generating an infinite HTTP 302 redirection storm that spikes samld CPU and locks out all enterprise SSL-VPN and ZTNA users.

[samld debug trace: diagnose debug application samld -1] samld_sp_login_resp: processing SAMLResponse from IdP 'https://sts.windows.net/3a8c19-...' samld_sp_validate_assertion: Assertion ID '_b80918e2-9844-482a-9921-fd108a7' samld_sp_validate_conditions: Current system time: 2026-09-11T01:17:42Z samld_sp_validate_conditions: NotBefore: 2026-09-11T01:10:05Z, NotOnOrAfter: 2026-09-11T01:15:05Z samld_sp_validate_conditions: ERROR: assertion expired (skew: +157s, max allowed: 120s) samld_send_http_redirect: redirecting client to '/remote/saml/login' (HTTP 302) samld_sp_login_resp: recursive loop detected (client IP 198.51.100.44 hit ACS 14 times in 3 seconds)

Affected Firmware & Blast Radius Matrix

FortiOS Branch Vulnerable Builds Confirmed Clean Build Status & Workaround
FortiOS 7.2 7.2.2 – 7.2.6 7.2.7+ Configure set clock-tolerance 300 in user saml
FortiOS 7.4 7.4.0 – 7.4.1 7.4.2+ Native clock tolerance + NTP sync repair
FortiOS 7.0 7.0.8 – 7.0.12 7.0.13+ Manual NTP sync + internal stratum 1 NTP server

Platform Impact: All FortiGate hardware and VM firewalls using SAML 2.0 authentication for SSL-VPN remote access, ZTNA application gateways, or Web GUI administrative single sign-on.

Step 01: Free Verification CLI (Safe Read-Only)

Execute these diagnostic commands to inspect SAML daemon validation failures and compare FortiGate system time against active NTP peers:

Diagnostic Commands

# 1. Enable live SAML service provider debugging
diagnose debug reset
diagnose debug application samld -1
diagnose debug enable

# 2. Verify current system date and NTP synchronization status
get system status | grep -E "Date|System time"
diagnose sys ntp status

# 3. Check active SSL-VPN tunnels to confirm session dropouts
diagnose vpn ssl list

# 4. Turn off debugging once redirection traces are recorded
diagnose debug disable

Remediation & Workaround Steps (Teaser Preview)

Step-by-step remediation procedures available in the interactive Ferrite platform:

Step 02: Adjust FortiOS SAML Clock Tolerance Window

Configure set clock-tolerance 300 under config user saml to tolerate up to 5 minutes of time drift.

🔒 Interactive CLI Available in Ferrite Runbook #08

Step 03: Force Manual Real-Time Clock Alignment via CLI

Execute an immediate step-update of the hardware RTC to align FortiOS with UTC time without rebooting.

🔒 Interactive CLI Available in Ferrite Runbook #08

Step 04: Migrate from Public FortiGuard NTP to Internal DC Hierarchy

Configure redundant NTP servers with explicit source interface binding and polling frequency tuning.

🔒 Interactive CLI Available in Ferrite Runbook #08
⚡ Ferrite Platform Superpowers

Execute the Complete Runbook with Live Browser Automation

Connect your FortiGate via browser console (Web Serial) or local SSH bridge, verify each command in real-time, generate ready-to-run Tera Term scripts, and export sanitized TAC dossiers.

Live Browser Automation Direct terminal connection with live step checkoff.
📟
1-Click Tera Term (.ttl) Generate scripts for air-gapped jumpboxes.
🛡️
Zero-Trust Scrubber Scrub serials and credentials in local browser RAM.
📄
TAC P1 Escalation Dossier Standardized evidence export with SHA-256 seal.

Frequently Asked Questions

Why does a 2-minute clock difference cause an infinite login loop?

Microsoft Entra ID assertions are valid for only 5 minutes. If the firewall clock is skewed by >120 seconds, the assertion is rejected. Because the browser retains an active IdP session, the IdP keeps redirecting the client back with new assertions, triggering a loop.

How can I stop the loop immediately in production?

Increase the allowable clock skew window by configuring set clock-tolerance 300 in the SAML user profile, followed by resynchronizing NTP.

Does clock drift affect Entra ID conditional access policies?

Yes. When timestamps are outside acceptable thresholds, conditional access token lifetime evaluation fails, generating sign-in failure audit logs in Microsoft Entra admin center.