Skip to content

Feature Request: Use dynamic value in the cookie for SAML and OpenID authentication #1271

Closed

Description

@xingzhang-suse

Is your feature request related to a problem?

#34

Solution you'd like

  1. Generate a unique nonce (UUID) per login attempt when the user is redirected to the IdP.
  2. Store the token as putToken(nonce, userToken) instead of the fixed "samlSso" key.
  3. Put the nonce in the temp cookie, so the second-phase PATCH /token_auth_server uniquely identifies the login attempt.
  4. Optionally pass the nonce as RelayState to the IdP for callback validation.
  5. Validate and invalidate the specific nonce on the PATCH call — preventing replay and cleaning up stale entries.
  6. Apply the same fix to OpenIdAuthService.scala — confirmed to use the identical KEY = "samlSso" pattern.
  7. Add TTL/cleanup for pending login entries to prevent unbounded in-memory map growth.

Alternatives you've considered

No response

Anything else?

No response

Activity

  1. added
    enhancementNew feature or request
    UINeuVector manager repo's tasks, including UI and seb server
    on Aug 13, 2026
  2. added this to the v5.6.2 milestone on Sep 1, 2026
  3. leotseng-suse commented on Sep 8, 2026

    @leotseng-suse

    The test was completed, and the following test scenarios were passed.

    • Test build:
      • 10.112.240.103:5000/neuvector/manager:1289-4
      • 10.112.240.103:5000/neuvector/controller:william-34-39
    • Test scenarios:
      • Dynamic Cookie Uniqueness (SAML & OpenID): Verified across both SAML and OpenID authentication flows that the temp cookie value in the PATCH /token_auth_server request is now a dynamically generated, unique UUID (nonce) for every single login attempt, rather than a static string.
      • Nonce Consumption & Replay Prevention: Confirmed that once a nonce is successfully used for authentication, it is immediately invalidated. Attempting a replay attack by resending the exact same PATCH request with a consumed temp cookie is successfully rejected by the backend (401 Unauthorized), effectively preventing state confusion and replay attacks.
  4. xingzhang-suse commented on Sep 9, 2026

    @xingzhang-suse
    CollaboratorAuthor

    Reopen for backport to 5.4.x and 5.5.x

  5. added 11 commits that reference this issue on Sep 15, 2026
  6. xingzhang-suse commented on Sep 16, 2026

    @xingzhang-suse
    CollaboratorAuthor

    In 5.4.11, 5.5.4 and 5.6.2 now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

UINeuVector manager repo's tasks, including UI and seb serverbackportenhancementNew feature or request

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions