Summary
Kimai before 2.56.0 does not consistently enforce team-membership boundaries when authorizing certain timesheet operations. An authenticated account with ROLE_TEAMLEAD or equivalent permissions may therefore read, modify, or permanently delete timesheets belonging to users outside its teams through the API, while ordinary ROLE_USER accounts remain restricted.
Affected context
The issue occurs in deployments using Kimai versions before 2.56.0 when TimesheetVoter::voteOnAttribute() evaluates permissions for API operations. The authorization decision maps capabilities to own_timesheet or other_timesheet permissions without consistently checking whether the target user belongs to a team the requester is authorized to manage. Sequential timesheet identifiers may make target records easier to identify, although exploitation still depends on the caller having the relevant elevated permission.
Exploit preconditions
- Attack surface: Kimai API endpoints that expose timesheet read, edit, or
deletion operations
- Required access: An authenticated account with ROLE_TEAMLEAD or another
role granting edit_other_timesheet or delete_other_timesheet
- Trigger point: Authorization of an operation against a timesheet owned by
another user
- Missing control: The authorization path does not reliably verify shared
team membership before applying the broader timesheet permission
- Scope limitation: Accounts limited to ROLE_USER are generally restricted
by the existing permission model
Why this happens
The underlying bug is an object-level authorization failure mapped to CWE-863, Incorrect Authorization. The voter treats broad permissions such as access to other users' timesheets as sufficient authorization but does not add the contextual team-membership check required to constrain that access. This creates a mismatch between role permission evaluation and resource ownership or tenancy boundaries; the behavior may also reflect a documented permission model that is broader than the expected security boundary.
Potential impact
- An authorized user may read timesheet records outside their team
- An authorized user could modify other users' recorded work data
- An authorized user may permanently delete timesheets system-wide
- Reporting, billing, payroll, or compliance data could be altered
- The issue could enable cross-team privacy violations and audit integrity loss
General mitigation guidance
Mitigation generally focuses on enforcing resource-level authorization at every timesheet operation. Authorization policies can require both the relevant role capability and verified membership in the target user's permitted team, with explicit deny-by-default behavior for ambiguous or missing relationships. Resource ownership and tenant or team scope should be derived from trusted server-side data rather than caller-controlled identifiers. Sensitive deletion and modification actions can receive additional privilege separation, confirmation, audit logging, and narrowly scoped administrative roles. API responses should avoid disclosing records that fail the same authorization check used for the requested action.
How teams detect issues like this
Detection can include static and policy analysis for authorization voters that check roles without also evaluating resource ownership, team, tenant, or relationship scope. Code review should look for direct object retrieval by identifier followed by permission checks that omit the object's security context, especially on read, update, and delete paths. Integration tests can exercise cross-team access with elevated and ordinary roles and verify consistent deny behavior. Runtime monitoring may flag unusual cross-team access or deletion patterns, while automated security review tools can help identify missing object-level authorization checks.

