Vulnerabilities

3 via 6 paths

Dependencies

25

Source

GitHub

Commit

609cb912

Find, fix and prevent vulnerabilities in your code.

Severity
  • 1
  • 2
Status
  • 3
  • 0
  • 0

high severity

Improper Control of Generation of Code ('Code Injection')

  • Vulnerable module: setuptools
  • Introduced through: setuptools@68.0.0

Detailed paths

  • Introduced through: TheGroundZero/openvasreporting@TheGroundZero/openvasreporting#609cb91263aa5bcf1f02afc10ecc0e1b7d85c62d setuptools@68.0.0
    Remediation: Upgrade to setuptools@70.0.0.

Overview

Affected versions of this package are vulnerable to Improper Control of Generation of Code ('Code Injection') through the package_index module's download functions due to the unsafe usage of os.system. An attacker can execute arbitrary commands on the system by providing malicious URLs or manipulating the URLs retrieved from package index servers.

Note

Because easy_install and package_index are deprecated, the exploitation surface is reduced, but it's conceivable through social engineering or minor compromise to a package index could grant remote access.

Remediation

Upgrade setuptools to version 70.0.0 or higher.

References

medium severity

Infinite loop

  • Vulnerable module: zipp
  • Introduced through: zipp@3.15.0, pep517@0.13.1 and others

Detailed paths

  • Introduced through: TheGroundZero/openvasreporting@TheGroundZero/openvasreporting#609cb91263aa5bcf1f02afc10ecc0e1b7d85c62d zipp@3.15.0
    Remediation: Upgrade to zipp@3.19.1.
  • Introduced through: TheGroundZero/openvasreporting@TheGroundZero/openvasreporting#609cb91263aa5bcf1f02afc10ecc0e1b7d85c62d pep517@0.13.1 zipp@3.15.0
  • Introduced through: TheGroundZero/openvasreporting@TheGroundZero/openvasreporting#609cb91263aa5bcf1f02afc10ecc0e1b7d85c62d build@1.1.1 importlib-metadata@6.7.0 zipp@3.15.0
    Remediation: Upgrade to build@1.1.1.
  • Introduced through: TheGroundZero/openvasreporting@TheGroundZero/openvasreporting#609cb91263aa5bcf1f02afc10ecc0e1b7d85c62d pep517@0.13.1 importlib-metadata@6.7.0 zipp@3.15.0
    Remediation: Upgrade to pep517@0.13.1.

Overview

Affected versions of this package are vulnerable to Infinite loop where an attacker can cause the application to stop responding by initiating a loop through functions affecting the Path module, such as joinpath, the overloaded division operator, and iterdir.

Details

Denial of Service (DoS) describes a family of attacks, all aimed at making a system inaccessible to its intended and legitimate users.

Unlike other vulnerabilities, DoS attacks usually do not aim at breaching security. Rather, they are focused on making websites and services unavailable to genuine users resulting in downtime.

One popular Denial of Service vulnerability is DDoS (a Distributed Denial of Service), an attack that attempts to clog network pipes to the system by generating a large volume of traffic from many machines.

When it comes to open source libraries, DoS vulnerabilities allow attackers to trigger such a crash or crippling of the service by using a flaw either in the application code or from the use of open source libraries.

Two common types of DoS vulnerabilities:

  • High CPU/Memory Consumption- An attacker sending crafted requests that could cause the system to take a disproportionate amount of time to process. For example, commons-fileupload:commons-fileupload.

  • Crash - An attacker sending crafted requests that could cause the system to crash. For Example, npm ws package

Remediation

Upgrade zipp to version 3.19.1 or higher.

References

medium severity

Directory Traversal

  • Vulnerable module: setuptools
  • Introduced through: setuptools@68.0.0

Detailed paths

  • Introduced through: TheGroundZero/openvasreporting@TheGroundZero/openvasreporting#609cb91263aa5bcf1f02afc10ecc0e1b7d85c62d setuptools@68.0.0
    Remediation: Upgrade to setuptools@78.1.1.

Overview

Affected versions of this package are vulnerable to Directory Traversal through the ‎PackageIndex._download_url method. Due to insufficient sanitization of special characters, an attacker can write files to arbitrary locations on the filesystem with the permissions of the process running the Python code. In certain scenarios, an attacker could potentially escalate to remote code execution by leveraging malicious URLs present in a package index.

PoC

python poc.py
# Payload file: http://localhost:8000/%2fhome%2fuser%2f.ssh%2fauthorized_keys
# Written to: /home/user/.ssh/authorized_keys

Details

A Directory Traversal attack (also known as path traversal) aims to access files and directories that are stored outside the intended folder. By manipulating files with "dot-dot-slash (../)" sequences and its variations, or by using absolute file paths, it may be possible to access arbitrary files and directories stored on file system, including application source code, configuration, and other critical system files.

Directory Traversal vulnerabilities can be generally divided into two types:

  • Information Disclosure: Allows the attacker to gain information about the folder structure or read the contents of sensitive files on the system.

st is a module for serving static files on web pages, and contains a vulnerability of this type. In our example, we will serve files from the public route.

If an attacker requests the following URL from our server, it will in turn leak the sensitive private key of the root user.

curl http://localhost:8080/public/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/root/.ssh/id_rsa

Note %2e is the URL encoded version of . (dot).

  • Writing arbitrary files: Allows the attacker to create or replace existing files. This type of vulnerability is also known as Zip-Slip.

One way to achieve this is by using a malicious zip archive that holds path traversal filenames. When each filename in the zip archive gets concatenated to the target extraction folder, without validation, the final path ends up outside of the target folder. If an executable or a configuration file is overwritten with a file containing malicious code, the problem can turn into an arbitrary code execution issue quite easily.

The following is an example of a zip archive with one benign file and one malicious file. Extracting the malicious file will result in traversing out of the target folder, ending up in /root/.ssh/ overwriting the authorized_keys file:

2018-04-15 22:04:29 .....           19           19  good.txt
2018-04-15 22:04:42 .....           20           20  ../../../../../../root/.ssh/authorized_keys

Remediation

Upgrade setuptools to version 78.1.1 or higher.

References