Miggo Logo

CVE-2023-46245: Kimai (Authenticated) SSTI to RCE by Uploading a Malicious Twig File

7.2

CVSS Score
3.1

Basic Information

EPSS Score
0.8393%
Published
10/30/2023
Updated
1/12/2024
KEV Status
No
Technology
TechnologyPHP

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
kimai/kimaicomposer< 2.1.02.1.0

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from insecure Twig template handling in invoice rendering. The key functions are the render methods in HTML/PDF exporters that processed user-controlled Twig templates without the security sandbox shown in the patch (added SandboxExtension with ExportPolicy). These functions directly pass user content to Twig's render() method, enabling template injection. The commit diff shows security measures were added to these exact locations, confirming their vulnerability in previous versions.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

# **s*ription T** l*t*rs v*rsion o* Kim*i is *oun* to ** vuln*r**l* to * *riti**l S*rv*r-Si** T*mpl*t* Inj**tion (SSTI) w*i** **n ** *s**l*t** to R*mot* *o** *x**ution (R**). T** vuln*r**ility *ris*s w**n * m*li*ious us*r uplo**s * sp**i*lly *r**t**

Reasoning

T** vuln*r**ility st*ms *rom ins**ur* Twi* t*mpl*t* **n*lin* in invoi** r*n**rin*. T** k*y *un*tions *r* t** `r*n**r` m*t*o*s in *TML/P** *xport*rs t**t pro**ss** us*r-*ontroll** Twi* t*mpl*t*s wit*out t** s**urity s*n**ox s*own in t** p*t** (***** `