[CVE-2023-22855] Kardex MLOG - Insecure path join to RCE via SSTI
The web server joined user-supplied paths without sanitisation, allowing local and remote (SMB) file inclusion. Hosting a .t4 file on an SMB share could trigger SSTI and allow RCE.
Published on hesec.de
The manufacturer describes the product as follows (rough translation from vendor product page)
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The application used an insecure path join with an unsanitised user-controlled path, allowing local and UNC path inclusion, then passed .t4 files to a template engine.
Impact
An attacker could achieve remote code execution on the server.
What the attacker needed
Network access to the web service; Ability to host an SMB share reachable by the target
How it was found
- Send a request with a crafted path to include a local file.
- Host a malicious .t4 file on an SMB share.
- Send a request with a UNC path pointing to the SMB share to include the remote file.
- The server processes the .t4 file through the template engine, allowing SSTI and RCE.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
The web server took a file path from the URL and simply glued it onto its own folder without checking for tricks like '..' to go up directories. This let an attacker read files outside the intended folder and even load files from a network share. Because the server also ran a template engine for files ending in .t4, the attacker could put code in such a file and have the server run it.
What is Path traversal?
Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.