Eval Injection Affecting kimai/kimai package, versions <2.1.0


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of concept
EPSS
0.19% (58th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Eval Injection vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-PHP-KIMAIKIMAI-6039895
  • published31 Oct 2023
  • disclosed30 Oct 2023
  • creditixSly

Introduced: 30 Oct 2023

CVE-2023-46245  (opens in a new tab)
CWE-95  (opens in a new tab)

How to fix?

Upgrade kimai/kimai to version 2.1.0 or higher.

Overview

Affected versions of this package are vulnerable to Eval Injection via the PDF and HTML rendering functionalities. A malicious user can upload a specially crafted Twig file, being able to escalate then to a Remote Code Execution.

PoC


public function render(array $timesheets, TimesheetQuery $query): Response
{
    ...
    $content = $this->twig->render($this->getTemplate(), array_merge([
        'entries' => $timesheets,
        'query' => $query,
        ...
    ], $this->getOptions($query)));
    ...
    $content = $this->converter->convertToPdf($content, $pdfOptions);
    ...
    return $this->createPdfResponse($content, $context);
}

CVSS Scores

version 3.1