Skip to main content

Boteraser | Website and Server Security Solutions

🛡️ CVE-2026-44298 — kimai

🟡 CVSS 4.1 — Medium ✅ No Known Exploit CWE-22 NVD
4.1
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

Kimai has an arbitrary file read in its invoice PDF renderer (admin)

Summary

Users with the role System-Admin (ROLE_SYSTE_ADMIN) and the permission upload_invoice_template can upload PDF invoice templates, which can call pdfContext.setOption('associated_files', ...) inside the sandboxed Twig render.

This is forwarded to mPDF's SetAssociatedFiles(), whose writer calls file_get_contents($entry['path']) during PDF output and embeds the bytes as a FlateDecode stream in the PDF. Any file readable by the PHP worker is returned to the attacker inside the rendered invoice.

Root cause

1. src/Twig/SecurityPolicy/StrictPolicy.php:123-128 explicitly whitelists PdfContext::setOption():

```php

if ($obj instanceof PdfContext) {

if ($lcm !== 'setoption') { throw ...; }

return;

}

```

2. src/Pdf/MPdfConverter.php keeps associated_files in the pass-through allowlist:

```php

$allowed = ['mode','format','default_font_size','default_font', ... , 'associated_files','additional_xmp_rdf'];

```

and then forwards it to mPDF:

```php

if (array_key_exists('associated_files', $options) && is_array($options['associated_files'])) {

$associatedFiles = $options['associated_files'];

unset($options['associated_files']);

}

...

$mpdf->SetAssociatedFiles($associatedFiles);

```

3. mPDF 8.3.1 MetadataWriter::writeAssociatedFiles() calls file_get_contents, which respects PHP stream wrappers:

```php

if (isset($file['path'])) {

$fileContent = @file_get_contents($file['path']);

}

...

$filestream = gzcompress($fileContent);

$this->writer->write('<</Type /EmbeddedFile');

```

The sandbox and the option allowlist were both written defensively (short whitelists, not blacklists), but neither side considered that associated_files is a PDF/A file-embedding feature whose path key is a sink.

Fix

The implemented fix has two aspects:

1. The PdfContext now works with a strict allow-list, that excludes associated_files

2. The MPdfConverter now removes any path from the $associatedFiles array, which can still be used by plugins:

```php

if (\count($associatedFiles) > 0) {

// remove "path" so mPDF will not use file_get_contents() on local files

// callers must pre-read and pass the bytes via "content"

$associatedFiles = array_map(static function ($entry): array {

if (!\is_array($entry)) {

return [];

}

if (\array_key_exists('path', $entry)) {

unset($entry['path']);

}

return $entry;

}, $associatedFiles);

$mpdf->SetAssociatedFiles($associatedFiles);

}

```

How this vulnerability can be exploited

This issue can be reached over the network, attack complexity is low, an attacker needs administrative privileges on the target. No user interaction is required. The scope is changed, meaning a successful attack can affect components beyond the vulnerable one. Rated impact: confidentiality low, integrity none, availability none.

CVSS metrics in full

The score comes from this vector: CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:L/I:N/A:N

  • Attack vector: Network — reachable from anywhere that can route to the service.
  • Attack complexity: Low — the attack works reliably, with no preparation.
  • Privileges required: High — administrative rights are needed first.
  • User interaction: None — nobody has to be tricked into anything.
  • Scope: Changed — a successful attack reaches components beyond the vulnerable one.
  • Confidentiality impact: Low — limited, and the attacker does not choose what is affected.
  • Integrity impact: None.
  • Availability impact: None.

Weakness class

CVE-2026-44298 is classified as CWE-22: Path Traversal. A file path built from user input is not confined to the intended directory, letting an attacker reach files elsewhere on the filesystem.

Affected software

CVE-2026-44298 is recorded against 2 packages.

  • kimai (from 2.32.0 up to 2.56.0)
  • kimai/kimai (from 2.32.0 up to 2.56)

Timeline and source

Published on 8 May 2026 and last revised on 17 June 2026. No public exploit is currently recorded for this entry. Record sourced from NVD.

References

github.com
github.com

Other advisories for this package

kimai has other advisories on record. If you are patching this one, these are worth checking on the same host:

Same weakness in other software

These advisories are the same class of weakness (CWE-22: Path Traversal) in other software:

Details

Severity MEDIUM
CVSS Score 4.1
CVSS Vector CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:L/I:N/A:N
CWE CWE-22
Public Exploit ✅ No
Source NVD
Published 2026-05-08
Updated 2026-08-20
Modified 2026-06-17
Fix URL N/A

Affected Packages

Software From version Fixed in
kimai 2.32.0 2.56.0
kimai/kimai 2.32.0 2.56

Similar Threats

Vulnerability Monitoring

Track new vulnerabilities in kimai

CVE-2026-44298 is rated CVSS 4.1 Medium. BotEraser monitors your WordPress installation and notifies you when software you use appears in our vulnerability database.

Set Up Free Alerts →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.

Browse related advisories

All advisoriesCVECVE 2026
✓