Skip to content

Login fails in Firefox: CSP blocks eval() in oidc-client-ts, "No matching state found in storage" #2467

@maki-ikam

Description

@maki-ikam

Initial Checklist

  • I understand this is a bug report and questions should be posted in the Community Discussions
  • I searched issues and couldn't find anything (or linked relevant results below)

Bug Description

The OIDC login flow fails in Firefox. After successful authentication callback, the page hangs indefinitely at "Sie werden eingeloggt" / "You are being signed in".

The browser console shows two related errors:

  1. **CSP violation:**Source: PortalTarget.vue_vue_type_script_lang-*.mjs

  2. **OIDC error (consequence of Branding #1):**This is incompatible with Firefox's strict CSP enforcement when oidc-client-ts (or its wrapper) uses eval() / new Function() internally to process tokens.

Steps to Reproduce

  1. Self-hosted OpenCloud 4.0.5 with internal IDP (Konnect)
  2. Open OpenCloud URL in Firefox (latest stable)
  3. Click login, enter credentials
  4. After successful auth callback, page redirects to /web-oidc-callback?code=...&state=...
  5. Page shows "Sie werden eingeloggt" and hangs forever

Works fine in Chrome, Edge (different CSP enforcement).

Expected Behavior

Login should complete and redirect to the main UI in any modern browser, including Firefox.

Workaround

Override the default CSP via PROXY_CSP_CONFIG_FILE_LOCATION with a custom csp.yaml that adds 'unsafe-eval' to script-src.

This works, but requires every Firefox-using OpenCloud admin to deploy this workaround. It also reduces the security posture of the default deployment.

Suggested Fix

Either:

  1. Refactor the oidc-client-ts wrapper code to avoid eval() / new Function() (preferred)
  2. Add 'unsafe-eval' to the default CSP shipped with OpenCloud (security tradeoff)
  3. Document the Firefox incompatibility prominently and document the workaround in the official docs

Environment

  • OpenCloud version: 4.0.5 (production)
  • Browser: Firefox (latest stable)
  • IDP: internal Konnect (default)
  • Reverse proxy: Tailscale Serve (HTTPS termination)
  • Affects: any Firefox user, any deployment using the default CSP

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions