CVE-2019-17109: Directory Traversal and Privilege Escalation in Koji
Summary
CVE-2019-17109: Koji through 1.18.0 allows remote Directory Traversal, with resultant Privilege Escalation. Affects koji versions < 1.19.0. Fixed in 1.19.0. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
Koji is a package management system used for building and distributing software packages. It is commonly used in Python projects and provides features such as package versioning, dependency management, and build automation. However, Koji versions up to 1.18.0 are vulnerable to a Directory Traversal attack, which can lead to Privilege Escalation.
Vulnerability Detail
The vulnerability in Koji allows remote attackers to perform Directory Traversal, enabling them to access files and directories outside the intended scope. This can lead to unauthorized access to sensitive information, modification of critical files, or even execution of arbitrary code with elevated privileges. The vulnerability was assigned CVE-2019-17109 and was first published on October 9, 2019.
How To Fix
Minimum fixed version
1.19.0
This is the first release that contains the fix.
pip install --upgrade "koji==1.19.0"
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
If upgrading to the latest version is not immediately feasible, a temporary workaround is to implement access controls and input validation to prevent unauthorized file access. This can be achieved by validating user-supplied input and restricting access to sensitive directories. Here is an example of how to implement input validation in Python:
import os
def validate_input(input_path):
# Ensure the input path is within the allowed directory
allowed_directory = '/path/to/allowed/directory'
full_path = os.path.abspath(input_path)
if not full_path.startswith(allowed_directory):
raise ValueError('Invalid input path')
# Usage example
user_input = '/path/to/../../sensitive/file'
validate_input(user_input)
Note that this workaround is not a permanent solution and should be replaced with the official fix as soon as possible.
Conclusion
In conclusion, Koji versions up to 1.18.0 are vulnerable to a Directory Traversal attack, which can result in Privilege Escalation. It is crucial to upgrade to version 1.19.0 or later to fix this vulnerability. If immediate upgrading is not possible, implementing access controls and input validation can serve as a temporary workaround. For further support on vulnerability remediation, you can reach out to DevNack.com.
See every vulnerability recorded for koji →
FAQ
Koji is a package management system used for building and distributing software packages. It provides features such as package versioning, dependency management, and build automation.
Directory Traversal is a vulnerability that allows an attacker to access files and directories outside the intended scope. It can lead to unauthorized access to sensitive information or modification of critical files.
Privilege Escalation is the act of gaining elevated privileges or permissions beyond what is intended. In the context of this vulnerability, it refers to an attacker gaining higher privileges than they should have, potentially leading to unauthorized actions.
You can use the Vulert Playground (https://vulert.com/scanner) to check if your version of Koji is affected by this vulnerability. Simply provide your Pipfile.lock file, and Vulert will analyze it for any open-source vulnerabilities, including CVE-2019-17109.
At the time of this report, there are no known public exploits specifically targeting this vulnerability. However, it is crucial to apply the recommended fix or workaround to mitigate any potential risks.
Related vulnerabilities
Recent vulnerabilities recorded for koji.