GHSA-cj3c-5xpm-cx94 CVE-2024-29200
Kimai API returns timesheet entries a user should not be authorized to view
- Severity
- 6.8 / 10
- Medium · CVSS 3.1
- Exploit chance (EPSS)
- 0.64%
- Chance of exploitation in the next 30 days. Higher than 50.89% of scored vulnerabilities.
- Known exploited
- No
- Not in CISA's catalog
- Weakness
- CWE-1220 Insufficient Granularity of Access Control
- Fix
2.13.0- Upgrade kimai/kimai to this version or later
Description
Summary
The permission view_other_timesheet performs differently for the Kimai UI and the API, thus returning unexpected data through the API.
Details
When setting the view_other_timesheet permission to true, on the frontend, users can only see timesheet entries for teams they are a part of. When requesting all timesheets from the API, however, all timesheet entries are returned, regardless of whether the user shares team permissions or not.
Example:
There are projects P1 and P2, Teams T1 and T2, users U1 and U2 and Timesheet entries E1 and E2. U1 is team leader of team T1 and has access to P1. U2 is in Team T2 and has access to both P1 and P2. U2 creates E1 for P1 and E2 for P2.
In the UI, U1 with view _other_timesheet perms sees E1 as he is a part of T1 that has access to P1.
In the API, however, he has access to E1 and E2.
Additionally, if U1 is not a team leader T1, he does not see any timesheet from a user other than himself in the UI, but still all timesheets in the API.
PoC
- Give a user
view_other_timesheetpermission - The result of the UI and the API call to
/api/timesheets?user=alldiffers in the data that is being returned
Curl command:
curl -X 'GET' \
'https://kimai.instance.com/api/timesheets?user=all' \
-H 'accept: application/json' \
-H 'X-AUTH-USER: username' \
-H 'X-AUTH-TOKEN: api_token'
Impact
This is at least an insufficient granularity of access control weakness. People can see timesheet entries they are not supposed to. This greatly affects the confidentiality of timesheet entries.
Restricting API access to administrators is also not a valid solution, as API access is needed, for example, to use the mobile app.
Affected versions
Packagist
| Package | Vulnerable | Fixed in |
|---|---|---|
| kimai/kimai | < 2.13.0 |
2.13.0 |
How to fix
Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.
kimai/kimai Packagist → 2.13.0
- composer
composer require kimai/kimai:^2.13.0
Severity breakdown
CVSS 3.1 6.8
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:N/A:N
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- Low
- User interaction
- Required
- Scope
- Changed
- Confidentiality
- High
- Integrity
- None
- Availability
- None
Weakness
CWE-1220: Insufficient Granularity of Access Control
The product implements access controls via a policy or other feature with the intention to disable or restrict accesses (reads and/or writes) to assets in a system from untrusted agents. However, implemented access controls lack required granularity, which renders the control policy too broad because it allows accesses from unauthorized agents to the security-sensitive assets.
How to prevent it
- Architecture and Design, Implementation, Testing: Access-control-policy protections must be reviewed for design inconsistency and common weaknesses. Access-control-policy definition and programming flow must be tested in pre-silicon, post-silicon testing.
References
Advisories
Packages
Other links
Timeline
- Published
- Last updated by the source
- Latest EPSS score
Related advisories
| Advisory | Severity | Why it's related |
|---|---|---|
| GHSA-rw46-qg69-vg6h Kimai: ExportTemplate CRUD Missing Authorization Check Allows Unauthorized TEAMLEAD Access | Medium | Also affects kimai/kimai |
| GHSA-v8hx-4vx8-wc96 Kimai: Pre-2FA KIMAI_SESSION cookie grants full authenticated REST API access, bypassing TOTP | High | Also affects kimai/kimai |
| GHSA-2xgg-2x8h-8xw4 Kimai: Improper Authorization in Project, Customer, and Activity Rate Edit Endpoints Allows Cross-Scope Rate Manipulation | Medium | Also affects kimai/kimai |
| GHSA-xv4r-4885-gwpg Kimai has Improper Authorization in Team Member and Team Activity Assignment APIs Which Allows Expansion of Team Scope Beyond Authorized Visibility | Medium | Also affects kimai/kimai |
| GHSA-jr9p-4h4j-6c58 Kimai: Default APP_SECRET in Docker Image Enables Cookie Forgery and Account Takeover | Critical | Also affects kimai/kimai |
| GHSA-r8vr-m544-qh4h Kimai: Login CSRF in the Timesheet Stop and Restart API Endpoints Allows Unauthorized State Changes | Medium | Also affects kimai/kimai |
| GHSA-c6w6-57jj-62vh Improper Authorization in Kimai Timesheet Restart and Duplicate Allows New Timesheets After Project Access Revocation | Medium | Also affects kimai/kimai |
| GHSA-3q6q-26vg-v97x Kimai: Improper Authorization Through Activity Creation with Preset Project Allows Creation Under Unauthorized Projects | Medium | Also affects kimai/kimai |
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor