GHSA-3jp4-mhh4-gcgr
### Summary The SAML authentication success handler in Kimai returns the `RelayState` POST parameter as a redirect destination without validating the host or scheme. After a user successfully authenticates via SAML, they are redirected to an attacker-controlled URL if the IdP includes a malicious `RelayState` value. This enables phishing attacks that steal credentials or session tokens post-SSO. *Requires SAML to be enabled (non-default configuration).* ### Details Vulnerable file: `src/Saml/Security/SamlAuthenticationSuccessHandler.php` ```php // Line 27-33 $relayState = $request->request->get('RelayState', $request->query->get('RelayState')); if (\is_scalar($relayState)) { $relayState = (string) $relayState; if ($relayState !== $this->httpUtils->generateUri($request, (string) $this->options['login_path'])) { return $relayState; // No host/scheme validation — any URL accepted } } ``` The only check is that `RelayState` does not equal the configured `login_path`. Any external URL (e.g., `https://attacker.com`) passes this check and is returned as the redirect destination. The existing unit test `SamlAuthenticationSuccessHandlerTest::testRelayState()` confirms this behavior — an absolute URL in `RelayState` results in a redirect to that URL with no restriction. ### Steps to Reproduce ``` 1. Enable SAML authentication in Kimai 2. Configure a SAML IdP (e.g., SimpleSAMLphp) 3. Initiate IdP-initiated SSO with RelayState=https://attacker.com — or intercept the ACS POST and modify RelayState to https://attacker.com 4. Complete SAML authentication at the IdP 5. Observe: after the SAMLResponse POST to /saml/acs, Kimai issues: HTTP/1.1 302 Found Location: https://attacker.com ``` Code-confirmed via unit test (`testRelayState`): `onAuthenticationSuccess` with `RelayState=http://localhost/relayed` redirects directly to that URL. External URLs follow the same code path. ### Impact While this bug exists it has low practical possibilities
Properties
- ghsa_id
- GHSA-3jp4-mhh4-gcgr
- severity
- low
- summary
- Kimai has an Open Redirect via Unvalidated RelayState in SAML ACS Handler
- cve_id
- GHSA-3jp4-mhh4-gcgr
- cvss_vector
- CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:N/I:N/A:N
- is_ghsa_only
- true
- ghsa_published
- 2026-04-14T01:06:06Z
- source_url
- https://github.com/advisories/GHSA-3jp4-mhh4-gcgr
- ghsa_updated
- 2026-04-14T01:06:07Z
Related Entities (4)
VULNERABLE_TO (1)
AFFECTS (1)
HAS_WEAKNESS (1)
REPORTED_BY (1)
Explore deeper with Ninja Signal's threat intelligence graph