CVE-2026-52825: Kimai/kimai Kimai Has Improper Authorization Vulnerability

MODERATE
Advisory Identifier: GHSA-xv4r-4885-gwpg
CWE-862 CWE-285
Published
Advisory Summary

CVE-2026-52825 is a MODERATE kimai has improper authorization vulnerability (CWE-862: Missing Authorization) affecting Kimai/kimai libraries in the Packagist ecosystem. The issue involves kimai has improper authorization in team member and team activity assignment apis which allows expansion of team scope beyond authorized visibility. Remediation is available by upgrading affected packages to version 2.58.0.

CVE-2026-52825 at a Glance

CVE Identifier CVE-2026-52825
GHSA Identifier GHSA-xv4r-4885-gwpg
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-862: Missing Authorization
Affected Product Kimai/kimai
Package Ecosystem Packagist
Published Date
Last Updated

How to Fix CVE-2026-52825

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.58.0
Upgrade kimai/kimai to 2.58.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 CVE-2026-52825, 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.58.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-862: Missing Authorization, where the product does not perform an authorization check when an actor attempts to access a resource or perform an action. 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 Kimai contains an authenticated improper authorization vulnerability in Team-related assignment APIs. A Teamlead who can edit their own team can use backend API endpoints to add users or activities that fall outside their intended visible or manageable scope, even when the frontend correctly hides those targets. This affects both team member assignment and team activity assignment. The issue is caused by treating "may edit this team" as equivalent to "may attach any referenced object to this team", without performing a second authorization check on the target user or activity. ### Details The issue affects at least the following API routes: - `POST /api/teams/{id}/members/{userId}` - `POST /api/teams/{id}/activities/{activityId}` In both cases, the backend checks whether the caller may edit the `Team`, but it does not verify whether the referenced `User` or `Activity` falls inside the caller's allowed management scope. For team member assignment, the frontend form correctly limits the visible user choices. In `src/Form/TeamEditForm.php`, the team edit form uses `UserType`: ```php $builder->add('users', UserType::class, [ 'label' => 'add_user.label', 'help' => 'team.add_user.help', 'mapped' => false, 'multiple' => false, 'expanded' => false, 'required' => false, 'ignore_users' => $team !== null ? $team->getUsers() : [] ]); ``` In `src/Form/Type/UserType.php`, the user selector is built from `UserRepository::getQueryBuilderForFormType()`: ```php $query = new UserFormTypeQuery(); $query->setUser($options['user']); $qb = $this->userRepository->getQueryBuilderForFormType($query); $users = $qb->getQuery()->getResult(); ``` And in `src/Repository/UserRepository.php`, Teamlead-visible candidates are limited to team members from teams they lead: ```php if (null !== $user && $user->isTeamlead()) { $userIds = []; foreach ($user->getTeams() as $team) { if ($team->isTeamlead($user)) { foreach ($team->getUsers() as $teamMember) { $userIds[] = $teamMember->getId(); } } } $userIds = array_unique($userIds); $qb->setParameter('teamMember', $userIds); $or->add($qb->expr()->in('u.id', ':teamMember')); } ``` However, the actual member-assignment API does not reuse that restriction. In `src/API/TeamController.php`: ```php #[IsGranted('edit', 'team')] #[Route(methods: ['POST'], path: '/{id}/members/{userId}', name: 'post_team_member', requirements: ['id' => '\d+', 'userId' => '\d+'])] public function postMemberAction(Team $team, #[MapEntity(mapping: ['userId' => 'id'])] User $member): Response { if ($member->isInTeam($team)) { throw new BadRequestHttpException('User is already member of the team'); } $team->addUser($member); $this->teamService->saveTeam($team); } ``` For activity assignment, the same pattern appears. In `src/API/TeamController.php`: ```php #[IsGranted('edit', 'team')] #[Route(methods: ['POST'], path: '/{id}/activities/{activityId}', name: 'post_team_activity', requirements: ['id' => '\d+', 'activityId' => '\d+'])] public function postActivityAction(Team $team, #[MapEntity(mapping: ['activityId' => 'id'])] Activity $activity, ActivityRepository $activityRepository): Response { if ($team->hasActivity($activity)) { throw new BadRequestHttpException('Team has already access to activity'); } $team->addActivity($activity); $activityRepository->saveActivity($activity); } ``` The `Team` voter only checks whether the current user may edit that team, not whether the referenced object is within the Teamlead's legitimate scope. In `src/Voter/TeamVoter.php`: ```php if (!$user->isAdmin() && !$user->isSuperAdmin() && !$user->isTeamleadOf($subject)) { return false; } return $this->permissionManager->hasRolePermission($user, $attribute . '_team'); ``` For activities, this is especially risky because later authorization logic may trust the team assignment that was just written. In `src/Security/RolePermissionManager.php`: ```php public function checkTeamAccessActivity(Activity $activity, User $user): bool { if ($activity->getProject() !== null && !$this->checkTeamAccessProject($activity->getProject(), $user)) { return false; } return $this->checkTeamAccess($activity->getTeams(), $user); } ``` So once a Teamlead is able to write a new team/activity relation, later access-control decisions may treat that relation as legitimate input. *A PoC was provided, but removed for security reasons.* ### Impact This vulnerability allows a Teamlead to use their own editable team as an expansion container for objects that should remain outside their authorized scope. In the validated member-assignment case, the attacker can forcibly add users who are not supposed to be manageable through that Teamlead's visible range. In the activity-assignment case, the attacker can attach activities that are outside the intended authorization boundary of the team. Once such relations are written, downstream authorization, visibility, and business workflows may start treating them as legitimate. This can affect user scoping, team-based access control, customer/project/activity visibility, time-entry behavior, statistics, and reporting. The issue therefore breaks the trustworthiness of `Team` as a security isolation container. # Solution Several new permission checks were added to `src/API/TeamController.php` - - Check if user can be accessed with `#[IsGranted('access_user', 'member')]` before adding as new team member - Check if customer can be seen with `#[IsGranted('view', 'customer')]` before a team is granted access to a customer - Check if project can be seen with `#[IsGranted('view', 'project')]` before a team is granted access to a project - Check if activity can be seen with `#[IsGranted('view', 'activity')]` before a team is granted access to an activity See [https://www.kimai.org/en/security/ghsa-xv4r-4885-gwpg](https://www.kimai.org/en/security/ghsa-xv4r-4885-gwpg) for more information.

CVE-2026-52825 Affected Kimai/kimai Versions

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

References

Frequently Asked Questions

What is CVE-2026-52825?
CVE-2026-52825 is a security vulnerability in Kimai/kimai involving Kimai has Improper Authorization in Team Member and Team Activity Assignment APIs Which Allows Expansion of Team Scope Beyond Authorized Visibility under CWE-862: Missing Authorization.
Which Kimai/kimai versions are affected?
Affected versions include releases prior to 2.58.0 across affected packages: kimai/kimai.
What version fixes CVE-2026-52825?
Upgrading to 2.58.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.58.0. Upgrade your dependency to 2.58.0 or later.
What CWE is associated with CVE-2026-52825?
CVE-2026-52825 is classified under CWE-862: Missing Authorization (The product does not perform an authorization check when an actor attempts to access a resource or perform an action.).
How can I check Packagist dependencies for CVE-2026-52825?
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-xv4r-4885-gwpg",
  "modified" : "2026-07-14T00:09:03Z",
  "published" : "2026-07-14T00:09:03Z",
  "aliases" : [ "CVE-2026-52825" ],
  "summary" : "Kimai has Improper Authorization in Team Member and Team Activity Assignment APIs Which Allows Expansion of Team Scope Beyond Authorized Visibility",
  "details" : "### Summary\n\nKimai contains an authenticated improper authorization vulnerability in Team-related assignment APIs. A Teamlead who can edit their own team can use backend API endpoints to add users or activities that fall outside their intended visible or manageable scope, even when the frontend correctly hides those targets.\n\nThis affects both team member assignment and team activity assignment. The issue is caused by treating \"may edit this team\" as equivalent to \"may attach any referenced object to this team\", without performing a second authorization check on the target user or activity.\n\n### Details\n\nThe issue affects at least the following API routes:\n\n- `POST /api/teams/{id}/members/{userId}`\n- `POST /api/teams/{id}/activities/{activityId}`\n\nIn both cases, the backend checks whether the caller may edit the `Team`, but it does not verify whether the referenced `User` or `Activity` falls inside the caller's allowed management scope.\n\nFor team member assignment, the frontend form correctly limits the visible user choices. In `src/Form/TeamEditForm.php`, the team edit form uses `UserType`:\n\n```php\n$builder->add('users', UserType::class, [\n    'label' => 'add_user.label',\n    'help' => 'team.add_user.help',\n    'mapped' => false,\n    'multiple' => false,\n    'expanded' => false,\n    'required' => false,\n    'ignore_users' => $team !== null ? $team->getUsers() : []\n]);\n```\n\nIn `src/Form/Type/UserType.php`, the user selector is built from `UserRepository::getQueryBuilderForFormType()`:\n\n```php\n$query = new UserFormTypeQuery();\n$query->setUser($options['user']);\n\n$qb = $this->userRepository->getQueryBuilderForFormType($query);\n$users = $qb->getQuery()->getResult();\n```\n\nAnd in `src/Repository/UserRepository.php`, Teamlead-visible candidates are limited to team members from teams they lead:\n\n```php\nif (null !== $user && $user->isTeamlead()) {\n    $userIds = [];\n    foreach ($user->getTeams() as $team) {\n        if ($team->isTeamlead($user)) {\n            foreach ($team->getUsers() as $teamMember) {\n                $userIds[] = $teamMember->getId();\n            }\n        }\n    }\n    $userIds = array_unique($userIds);\n    $qb->setParameter('teamMember', $userIds);\n    $or->add($qb->expr()->in('u.id', ':teamMember'));\n}\n```\n\nHowever, the actual member-assignment API does not reuse that restriction. In `src/API/TeamController.php`:\n\n```php\n#[IsGranted('edit', 'team')]\n#[Route(methods: ['POST'], path: '/{id}/members/{userId}', name: 'post_team_member', requirements: ['id' => '\\d+', 'userId' => '\\d+'])]\npublic function postMemberAction(Team $team, #[MapEntity(mapping: ['userId' => 'id'])] User $member): Response\n{\n    if ($member->isInTeam($team)) {\n        throw new BadRequestHttpException('User is already member of the team');\n    }\n\n    $team->addUser($member);\n    $this->teamService->saveTeam($team);\n}\n```\n\nFor activity assignment, the same pattern appears. In `src/API/TeamController.php`:\n\n```php\n#[IsGranted('edit', 'team')]\n#[Route(methods: ['POST'], path: '/{id}/activities/{activityId}', name: 'post_team_activity', requirements: ['id' => '\\d+', 'activityId' => '\\d+'])]\npublic function postActivityAction(Team $team, #[MapEntity(mapping: ['activityId' => 'id'])] Activity $activity, ActivityRepository $activityRepository): Response\n{\n    if ($team->hasActivity($activity)) {\n        throw new BadRequestHttpException('Team has already access to activity');\n    }\n\n    $team->addActivity($activity);\n    $activityRepository->saveActivity($activity);\n}\n```\n\nThe `Team` voter only checks whether the current user may edit that team, not whether the referenced object is within the Teamlead's legitimate scope. In `src/Voter/TeamVoter.php`:\n\n```php\nif (!$user->isAdmin() && !$user->isSuperAdmin() && !$user->isTeamleadOf($subject)) {\n    return false;\n}\n\nreturn $this->permissionManager->hasRolePermission($user, $attribute . '_team');\n```\n\nFor activities, this is especially risky because later authorization logic may trust the team assignment that was just written. In `src/Security/RolePermissionManager.php`:\n\n```php\npublic function checkTeamAccessActivity(Activity $activity, User $user): bool\n{\n    if ($activity->getProject() !== null && !$this->checkTeamAccessProject($activity->getProject(), $user)) {\n        return false;\n    }\n\n    return $this->checkTeamAccess($activity->getTeams(), $user);\n}\n```\n\nSo once a Teamlead is able to write a new team/activity relation, later access-control decisions may treat that relation as legitimate input.\n\n*A PoC was provided, but removed for security reasons.*\n\n### Impact\n\nThis vulnerability allows a Teamlead to use their own editable team as an expansion container for objects that should remain outside their authorized scope. In the validated member-assignment case, the attacker can forcibly add users who are not supposed to be manageable through that Teamlead's visible range. In the activity-assignment case, the attacker can attach activities that are outside the intended authorization boundary of the team.\n\nOnce such relations are written, downstream authorization, visibility, and business workflows may start treating them as legitimate. This can affect user scoping, team-based access control, customer/project/activity visibility, time-entry behavior, statistics, and reporting. The issue therefore breaks the trustworthiness of `Team` as a security isolation container.\n\n# Solution\n\nSeveral new permission checks were added to `src/API/TeamController.php` -\n- Check if user can be accessed with `#[IsGranted('access_user', 'member')]` before adding as new team member \n- Check if customer can be seen with `#[IsGranted('view', 'customer')]` before a team is granted access to a customer\n- Check if project can be seen with `#[IsGranted('view', 'project')]` before a team is granted access to a project\n- Check if activity can be seen with `#[IsGranted('view', 'activity')]` before a team is granted access to an activity\n\nSee [https://www.kimai.org/en/security/ghsa-xv4r-4885-gwpg](https://www.kimai.org/en/security/ghsa-xv4r-4885-gwpg) for more information.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "kimai/kimai"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.58.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.57.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/kimai/kimai/security/advisories/GHSA-xv4r-4885-gwpg"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/kimai/kimai"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-285", "CWE-862" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-14T00:09:03Z",
    "nvd_published_at" : null
  }
}