CVE-2024-36057
Command Injection in Koha Library via Unsanitized Zip Filename
Publication date: 2026-04-07
Last updated on: 2026-04-09
Assigner: MITRE
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| koha | koha | to 23.05.10 (exc) |
| koha_community | koha | to 22.05.22 (exc) |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-94 | The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. |
Attack-Flow Graph
AI Powered Q&A
How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:
The vulnerability in Koha Library before version 23.05.10 allows remote code execution via unsanitized filenames in uploaded ZIP files. This can lead to full system compromise, data exfiltration, and installation of persistent backdoors.
Such a compromise could potentially result in unauthorized access to sensitive personal data managed by the library system, which may impact compliance with data protection regulations such as GDPR and HIPAA. Specifically, unauthorized data access or data breaches caused by exploitation of this vulnerability could violate requirements for data confidentiality, integrity, and security.
Therefore, organizations using vulnerable versions of Koha may face increased risk of non-compliance with these standards until the vulnerability is remediated.
What immediate steps should I take to mitigate this vulnerability?
The immediate mitigation step is to upgrade Koha to version 22.05.22 or later, where this vulnerability has been fixed.
Until the upgrade can be performed, restrict access to the upload-cover-image.pl script and the upload functionality to trusted users only, as exploitation requires authenticated high-privilege access.
Additionally, implement input validation or sanitization on filenames before unzipping to prevent command injection.
Monitor your system for signs of compromise, such as unexpected processes or network connections, and review logs for suspicious activity.
Can you explain this vulnerability to me?
CVE-2024-36057 is a remote code execution vulnerability in Koha Library software versions prior to 22.05.22. It occurs because the application fails to sanitize user-controllable filenames before unzipping uploaded ZIP files in the upload-cover-image.pl script.
Specifically, the command used to unzip files includes the filename directly in a shell command without proper sanitization, allowing an attacker to inject shell metacharacters and execute arbitrary commands on the server.
An attacker with authenticated access and high privileges can craft a ZIP file with malicious filenames containing shell commands. When the user clicks "Process Images," these commands are executed, potentially compromising the system.
How can this vulnerability impact me? :
This vulnerability allows a remote authenticated attacker to execute arbitrary operating system commands on the server running Koha.
The impact includes potential full system compromise, data exfiltration, installation of persistent backdoors or reverse shells, and loss of control over the affected system.
How can this vulnerability be detected on my network or system? Can you suggest some commands?
This vulnerability can be detected by monitoring for suspicious uploads of ZIP files with filenames containing shell metacharacters or backtick characters, which are used to inject commands. Specifically, look for ZIP files uploaded via the endpoint /cgi-bin/koha/tools/upload-file.pl?temp=1.
To detect exploitation attempts, you can check server logs for unusual command execution or unexpected unzip commands triggered by filenames containing shell metacharacters.
Suggested commands to detect potential exploitation attempts include:
- Search web server access logs for POST requests to the upload endpoint: grep 'POST /cgi-bin/koha/tools/upload-file.pl?temp=1' /var/log/apache2/access.log
- Look for filenames with suspicious characters in logs or temporary upload directories: grep -E '[`$&|;]' /path/to/uploaded/files
- Monitor running processes or command history for unexpected unzip commands with unusual filenames: ps aux | grep unzip
- Check for reverse shell connections or unusual network activity originating from the Koha server.