Arbitrary file read in invoice PDF renderer (admin)

Affected versions

Description

Kimai allowed a System-Admin (ROLE_SUPER_ADMIN) with the upload_invoice_template permission to abuse PDF renderer options from within a sandboxed invoice Twig template. In affected versions, a crafted template could pass a malicious associated_files entry to mPDF and cause the renderer to read a local file from the server and embed its contents into the generated PDF.

This issue affected uploaded invoice templates rendered as PDF documents.

The vulnerable option was intended to be set from PHP code or plugins, not directly from a Twig template.

Solution

The fix has two parts:

If you cannot update immediately, do not grant upload_invoice_template to untrusted users.

Users should update to 2.56 or newer.

Credits

First reported in GitHub advisory: GHSA-h5fh-7hwr-97mw

Top