You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(apigw): harden SAML/OIDC integration security and error handling
- Session leak: add defer-based cleanup on error paths in both OIDC and
SAML callback handlers so sessions are always deleted if document
storage or credential creation fails
- SAML assertion time validation: check NotBefore/NotOnOrAfter per
SAML 2.0 §2.5.1; reject expired or future-dated assertions
- SAML nil guards: validate IdP metadata has SSO descriptors, and
assertion has Subject/NameID/Conditions before accessing them
- Dynamic registration: limit response body to 1MB via io.LimitReader
to prevent OOM from malicious registration endpoints
- OIDC IdP errors: check for error/error_description query params in
callback (RFC 6749 §4.1.2.1) instead of returning generic error
- Cookie cleanup: delete auth_method and redirect URL cookies after
successful OIDC/SAML callbacks and in user cancel endpoint
- State leak prevention: log OIDC state at Debug (not Info) level and
remove state values from error messages returned to callers
- SAML standalone: return explicit error when JWK is nil instead of
passing nil to credential creation
- Multi-valued attrs: log warning when SAML attributes have multiple
values (only first is used)
- Doc retrieval: replace non-deterministic map iteration in UserLookup
with firstDocument() helper that validates document is non-nil
- Scope validation: validate scope maps to a credential constructor
before initiating SAML/OIDC auth from consent endpoint
0 commit comments