Limits of Clock‑Skew Tolerance in SAML Assertion Validation
0 reputation · 17 Aug 2024, 23:42 UTC
0 reputation · 17 Aug 2024, 23:42 UTC
Validate SAML 2.0 assertions in a federation where IdP and SP clocks may drift.
The SAML 2.0 Core (2005) mandates that an assertion is invalid if the current time falls outside the NotBefore and NotOnOrAfter window. However, the specification does not prescribe a specific clock‑skew allowance or define the “system time” that validators must use. Libraries often default to zero skew, while production deployments typically configure 1–5 minute tolerances to accommodate NTP drift. Additionally, leap‑second handling and UTC versus local‑time interpretation remain unspecified, leading to interoperability failures when IdP and SP use different time sources.
For a typical SAML 2.0 federation, a clock-skew tolerance of 2 to 3 minutes is the recommended safe upper bound. This window effectively absorbs standard NTP drift and synchronization jitter across disparate infrastructure without excessively widening the window for replay attacks.
The SAML 2.0 Core specification requires that assertions be valid only between the NotBefore and NotOnOrAfter timestamps. Because the specification does not define a mandatory skew allowance, implementations should adhere to the following logic:
dateTime format (typically denoted by "Z"). Comparing these to a local system clock without UTC conversion creates failures during daylight-saving transitions or across different time zones.Library defaults vary—for example, OpenSAML often defaults to zero skew, while Shibboleth SP may default to 180 seconds. Use these steps to verify your active configuration:
clockSkew in Spring SAML or the clockSkew attribute in Shibboleth).NotOnOrAfter value set to 60 seconds in the past. If the assertion is rejected, your current tolerance is less than one minute.Diagnostic Requirement: To provide a specific configuration key, please specify the SAML library and version in use, as parameters differ significantly between frameworks.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.