GHSA-3jp4-mhh4-gcgr: Kimai/kimai Kimai Has An Open Redirect Vulnerability

LOW
CVSS 0.0
CWE-601
Published
Advisory Summary

GHSA-3jp4-mhh4-gcgr is a LOW (CVSS 0.0) kimai has an open redirect vulnerability (CWE-601: URL Redirection to Untrusted Site ('Open Redirect')) affecting Kimai/kimai libraries in the Packagist ecosystem. The issue involves kimai has an open redirect via unvalidated relaystate in saml acs handler. Remediation is available by upgrading affected packages to version 2.53.0.

GHSA-3jp4-mhh4-gcgr at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-3jp4-mhh4-gcgr
Severity LOW
CVSS v3.1 Base Score 0.0
CWE Classification CWE-601: URL Redirection to Untrusted Site ('Open Redirect')
Affected Product Kimai/kimai
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 0.0

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:N/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality None (C:N)
Integrity None (I:N)
Availability None (A:N)

How to Fix GHSA-3jp4-mhh4-gcgr

To remediate this vulnerability, upgrade all affected Kimai/kimai dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

kimai/kimai fixed: 2.53.0
Upgrade kimai/kimai to 2.53.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for kimai/kimai

How to Check if You Are Affected

To determine whether your application is affected by GHSA-3jp4-mhh4-gcgr, inspect your project dependencies for Kimai/kimai:

inspect dependencies for kimai/kimai

Analyze the terminal output to locate any version of Kimai/kimai in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.53.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-601: URL Redirection to Untrusted Site ('Open Redirect'), where the web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect. In Kimai/kimai, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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 and the attacker needs to be able to create a SAML request, meaning either admin access to an IdP supporting such an action OR access to the private SAML keys / certificates. In other words: only exploitable in IdP-initiated SSO flows where the IdP includes a `RelayState` value supplied by the attacker (e.g., via a malicious link to the IdP). ### Fix The `RelayState` is validated before redirecting, see #5878 - It may not contain a host or port and cannot start with `//`. - If it contains a host, it must match the current host.

GHSA-3jp4-mhh4-gcgr Affected Kimai/kimai Versions

1 component(s)
Fixed Versions:
2.53.0
Product / Package Ecosystem Affected Versions Fixed Version
kimai/kimai
Packagist
< 2.53.0
2.53.0

References

Frequently Asked Questions

What is GHSA-3jp4-mhh4-gcgr?
GHSA-3jp4-mhh4-gcgr is a security vulnerability in Kimai/kimai involving Kimai has an Open Redirect via Unvalidated RelayState in SAML ACS Handler under CWE-601: URL Redirection to Untrusted Site ('Open Redirect').
Which Kimai/kimai versions are affected?
Affected versions include releases prior to 2.53.0 across affected packages: kimai/kimai.
What version fixes GHSA-3jp4-mhh4-gcgr?
Upgrading to 2.53.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is kimai/kimai affected?
Yes, kimai/kimai is affected in releases prior to 2.53.0. Upgrade your dependency to 2.53.0 or later.
What is the CVSS score of GHSA-3jp4-mhh4-gcgr?
GHSA-3jp4-mhh4-gcgr has a CVSS v3.1 base score of 0.0 (LOW) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:N/I:N/A:N.
What CWE is associated with GHSA-3jp4-mhh4-gcgr?
GHSA-3jp4-mhh4-gcgr is classified under CWE-601: URL Redirection to Untrusted Site ('Open Redirect') (The web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect.).
How can I check Packagist dependencies for GHSA-3jp4-mhh4-gcgr?
Run the dependency tree command: 'inspect dependencies for kimai/kimai'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-3jp4-mhh4-gcgr",
  "modified" : "2026-04-14T01:06:06Z",
  "published" : "2026-04-14T01:06:06Z",
  "aliases" : [ ],
  "summary" : "Kimai has an Open Redirect via Unvalidated RelayState in SAML ACS Handler",
  "details" : "### Summary\n\nThe 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.\n\n*Requires SAML to be enabled (non-default configuration).*\n\n### Details\n\nVulnerable file: `src/Saml/Security/SamlAuthenticationSuccessHandler.php`\n\n```php\n// Line 27-33\n$relayState = $request->request->get('RelayState', $request->query->get('RelayState'));\nif (\\is_scalar($relayState)) {\n    $relayState = (string) $relayState;\n    if ($relayState !== $this->httpUtils->generateUri($request, (string) $this->options['login_path'])) {\n        return $relayState;  // No host/scheme validation — any URL accepted\n    }\n}\n```\n\nThe 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.\n\nThe existing unit test `SamlAuthenticationSuccessHandlerTest::testRelayState()` confirms this behavior — an absolute URL in `RelayState` results in a redirect to that URL with no restriction.\n\n### Steps to Reproduce\n\n```\n1. Enable SAML authentication in Kimai\n2. Configure a SAML IdP (e.g., SimpleSAMLphp)\n3. Initiate IdP-initiated SSO with RelayState=https://attacker.com\n   — or intercept the ACS POST and modify RelayState to https://attacker.com\n4. Complete SAML authentication at the IdP\n5. Observe: after the SAMLResponse POST to /saml/acs, Kimai issues:\n   HTTP/1.1 302 Found\n   Location: https://attacker.com\n```\n\nCode-confirmed via unit test (`testRelayState`): `onAuthenticationSuccess` with `RelayState=http://localhost/relayed` redirects directly to that URL. External URLs follow the same code path.\n\n### Impact\n\nWhile this bug exists it has low practical possibilities and the attacker needs to be able to create a SAML request, meaning either admin access to an IdP supporting such an action OR access to the private SAML keys / certificates.\n\nIn other words: only exploitable in IdP-initiated SSO flows where the IdP includes a `RelayState` value supplied by the attacker (e.g., via a malicious link to the IdP).\n\n### Fix\n\nThe `RelayState` is validated before redirecting, see #5878\n\n- It may not contain a host or port and cannot start with `//`. \n- If it contains a host, it must match the current host.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:N/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "kimai/kimai"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.53.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.52.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/kimai/kimai/security/advisories/GHSA-3jp4-mhh4-gcgr"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/kimai/kimai/pull/5878"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/kimai/kimai"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-601" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-14T01:06:06Z",
    "nvd_published_at" : null
  }
}