Kimai versions prior to 2.58.0 have a missing authorization check in the ExportController web routes for creating and editing export templates. This allows users with the ROLE_TEAMLEAD permission to create or modify global export templates, which should be restricted to administrators. These templates affect the structure and content of exported data visible to all users. The issue violates intended permission boundaries but does not lead to remote code execution or credential exposure.
Kimai versions prior to 2.59.0 have a vulnerability where the KIMAI_SESSION cookie issued after password verification but before completing two-factor authentication (2FA) grants full authenticated REST API access, effectively bypassing the TOTP second factor. This allows an attacker who knows the user's password to access the API without the second factor. The issue arises because the API firewall accepts the session cookie as authenticated before 2FA is completed. The vulnerability is fixed by requiring a higher authentication level after 2FA and updating the API authorization checks.
Kimai version prior to 2.57.0 contains an authenticated improper authorization vulnerability in the web rate editing endpoints for projects, customers, and activities. The flaw allows a user authorized to edit one parent object to manipulate rate records belonging to other unauthorized parent objects by exploiting missing parent-child consistency validation. This can lead to unauthorized modification of billing-related rate configurations across different teams or business domains.
Kimai contains an authenticated improper authorization vulnerability in its Team Member and Team Activity Assignment APIs. A Teamlead who can edit their own team can add users or activities outside their authorized scope via backend API calls, bypassing frontend restrictions. This occurs because the backend only checks if the user may edit the team, without verifying if the referenced user or activity is within the Teamlead's legitimate management scope. This can lead to unauthorized expansion of team membership and activity assignments beyond intended visibility.
The official Kimai Docker image shipped with a default APP_SECRET environment variable set to a known static value. This default secret was not overridden or validated at startup, allowing attackers to forge HMAC-signed cookies and login links. This enables unauthenticated attackers to take over any account, including super_admin, if they know the username and can guess the user ID, provided the account does not have active two-factor authentication. The issue affects Kimai versions prior to 2.58.0. The vendor has updated the entrypoint script to generate a random APP_SECRET at startup, removed the default static secret from the Dockerfile, and improved login link entropy to mitigate the risk.
Kimai 2.56.0 and earlier versions contain an authenticated cross-site request forgery (CSRF) vulnerability in the timesheet stop and restart API endpoints. The application exposes state-changing operations via GET requests, which should be read-only, allowing attackers to trick logged-in users into triggering unauthorized timesheet state changes. This can stop running timesheets or restart historical ones without user consent, potentially corrupting time tracking data and affecting billing or auditing processes. The issue is fixed by removing the GET routes and limiting these operations to PATCH requests only.
Kimai 2.56.0 and earlier contain an authorization bypass vulnerability in the timesheet restart and duplicate workflows. After a user loses access to a project, they can still create new timesheets under that project by restarting or duplicating historical entries. This occurs because the authorization logic trusts ownership of old timesheets more than current project access rights, allowing persistent write access despite revocation. The issue affects API endpoints and the web UI flows that reuse historical project and activity bindings. This can lead to unauthorized time entries that undermine access control and affect project tracking and reporting.
Kimai 2.56.0 and earlier contain an improper authorization vulnerability in the activity creation flow when using a preset project. Authenticated users with the generic create_activity permission can create activities under projects they are not authorized to access by directly using the preset project creation route. This allows unauthorized creation of child business objects under other teams' projects, potentially impacting project configurations and downstream business processes. The issue is fixed by adding explicit edit permission checks on the project and customer in the relevant controllers.
Kimai versions prior to 2.57.0 have a vulnerability in the Timesheet API PATCH and POST endpoints that allows authenticated users to assign their timesheets to projects outside their authorized teams. This occurs because the project ID submitted by the user bypasses team membership checks due to an unconditional OR condition in the query builder. Consequently, users can access project and customer metadata that should be restricted by team access controls.
Kimai versions prior to 2.57.0 contain an authorization bypass vulnerability in the GET /api/timesheets endpoint. A user with the ROLE_TEAMLEAD and the view_other_timesheet permission can retrieve timesheet records of other users without being the teamlead of the target user's team. This bypass occurs because the list endpoint does not enforce the teamlead check that the per-record endpoint enforces. As a result, sensitive financial data such as rate and internalRate, along with personal activity details, can be disclosed to unauthorized teamlead users.
Kimai version prior to 2.58.0 contains an authenticated cross-site request forgery (CSRF) vulnerability in default team creation endpoints accessed via GET requests. These endpoints allow unauthorized modification of team and permission structures by creating or reusing teams, assigning the victim user as teamlead, and binding projects, customers, or activities to those teams without explicit user consent. The vulnerability requires the victim to be logged in with permissions to manage the relevant object. The issue has been addressed by moving these routes to API POST endpoints.
### Summary
Kimai 2.56.0 contains a server-side request forgery vulnerability in its invoice PDF preview and generation workflow. If an attacker can control Markdown content that is later rendered into an invoice PDF, such as `Customer.invoiceText`, the server-side PDF renderer will fetch remote image URLs embedded in Markdown image syntax.
This allows the application server to issue outbound requests to attacker-controlled or internal targets during PDF rendering. The behavior can be used for internal network probing, server-side reachability checks, and potentially follow-on exploitation depending on deployment environment and accessible internal services.
### Details
The vulnerable behavior occurs in the invoice rendering chain when user-controlled Markdown is transformed into HTML and then rendered by mPDF.
- First, customer invoice text is copied into the invoice model.
. Second, the default PDF invoice template renders that field through the Markdown-to-HTML filter.
- Third, `md2html` enables full Markdown rendering.
- Although safe mode is enabled, the tested Markdown image syntax still survives into the rendered HTML chain in a form that causes the PDF renderer to fetch the image resource.
- Finally, the HTML is handed to mPDF.
The live test confirms that mPDF attempts to retrieve the remote image URL from the server side during PDF preview. This means the issue is not a template-injection problem but an SSRF condition caused by the rendering pipeline:
- attacker-controlled Markdown
- Markdown converted to HTML
- HTML rendered by mPDF
- mPDF fetches remote image resources from the server side
*A PoC was provided, but removed for security reasons.*
### Impact
This vulnerability allows an attacker who can influence invoice-rendered Markdown fields to cause the Kimai server to make outbound requests to arbitrary destinations. In real deployments, this can be used to probe internal services, test access to internal administrative or metadata endpoints, and confirm server-side reachability to attacker-controlled infrastructure.
Depending on the environment, SSRF can also become a stepping stone toward more serious outcomes, such as triggering side effects on internal HTTP services or extracting sensitive information from services reachable only by the server. Because invoice generation is commonly performed by administrative or finance-related users, the feature is realistically reachable in business workflows.
# Solution
- Kimai does not allow to use markdown images any longer and converts them to HTML links instead
- Kimai uses a specialized HttpClient for mPDF (called `NoPrivateNetworkHttpClient`), which prevents access to a variety of URLs, the full list can be fetched [from the documentation](https://www.kimai.org/documentation/pdf-templates.html#embedding-images)
- This change can be a BC break, if someone used
- the Kimai domain for hosting invoice or export template images
- an internal IP for hosting invoice or export template images
See https://www.kimai.org/en/security/ghsa-pj8j-p4g4-4vw8
### Summary
Kimai 2.56.0 contains an authenticated improper authorization / IDOR vulnerability in the favorite timesheet add and remove endpoints. A low-privileged user who knows another user's `timesheet.id` can add that record to, or remove it from, the victim's `favorite/recent` bookmark list. This allows cross-user manipulation of per-user favorite state without administrative privileges.
### Details
The issue affects the following routes:
- `GET /en/favorite/timesheet/add/{id}`
- `GET /en/favorite/timesheet/remove/{id}`
Both endpoints accept a user-controlled timesheet identifier and only require the caller to hold the generic `start_own_timesheet` permission. They do not verify that the referenced `Timesheet` object belongs to the currently authenticated user.
- In `src/Controller/FavoriteController.php`, the controller methods accept a `Timesheet` object directly and forward it to the favorite service.
- The root cause becomes more obvious in `src/Timesheet/FavoriteRecordService.php`. The bookmark owner is derived from `$timesheet->getUser()` instead of the current session user.
- Because of this design, any authenticated user who can reference another user's timesheet ID can modify the victim's `favorite/recent` bookmark data.
*A PoC was provided, but removed for security reasons.*
### Impact
This vulnerability allows any authenticated low-privileged user to manipulate another user's favorite bookmark state across accounts. An attacker can inject arbitrary victim-owned timesheet entries into the victim's quick-entry workflow, remove existing favorites, and repeatedly disturb the victim's normal timesheet usage without needing administrative privileges.
The issue does not directly disclose sensitive data, but it is a real cross-user business-state tampering vulnerability with clear integrity impact. Because the add and remove endpoints can be combined, an attacker can reliably insert, remove, and reorder entries in another user's `favorite/recent` list.
Kimai versions from 2.32.0 up to but not including 2.56 contain a vulnerability in the invoice PDF renderer that allows users with System-Admin role and upload_invoice_template permission to read arbitrary files accessible to the PHP worker. This occurs because the PDF invoice template feature allows setting 'associated_files' with file paths that are read and embedded into the PDF output. The vulnerability is fixed in version 2.56 by removing the ability to specify file paths for associated files, requiring pre-read content instead.
Kimai versions prior to 2.56.0 contain a vulnerability in the Twig sandbox policy that allows the config() Twig function to access and leak server-wide secrets such as LDAP bind passwords and SAML SP private keys. This occurs because the config() function performs unrestricted key lookups on the flattened kimai.config container, exposing sensitive configuration values to any admin user who can upload invoice or export templates. These secrets can then be exfiltrated by lower-privileged users who generate invoices or exports using the malicious templates.
Kimai versions prior to 2.56.0 have a permission model issue where users with the ROLE_TEAMLEAD can enumerate, read, modify, and delete timesheets of any user across all teams. This occurs because the system does not enforce team membership checks for these permissions, allowing cross-team timesheet manipulation. The behavior is by design according to Kimai's documented permissions but may be unexpected. The issue is fixed in version 2.56.0 with added team-scoped permission checks.