aiohttp@3.6.0a2

Async http client/server framework (asyncio)

  • latest version

    3.14.3

  • latest non vulnerable version

  • first published

    12 years ago

  • latest version published

    2 months ago

  • licenses detected

  • Direct Vulnerabilities

    Known vulnerabilities in the aiohttp package. This does not include vulnerabilities belonging to this package’s dependencies.

    Fix vulnerabilities automatically

    Snyk's AI Trust Platform automatically finds the best upgrade path and integrates with your development workflows. Secure your code at zero cost.

    Fix for free
    VulnerabilityVulnerable Version
    • M
    HTTP Request Smuggling

    Affected versions of this package are vulnerable to HTTP Request Smuggling in the WebSocket upgrade. An attacker can bypass request boundaries and interfere with HTTP request processing by crafting specially constructed HTTP requests.

    How to fix HTTP Request Smuggling?

    Upgrade aiohttp to version 3.14.2 or higher.

    [,3.14.2)
    • M
    Allocation of Resources Without Limits or Throttling

    Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling via the WebSocket client. An attacker can cause unexpected decompression of WebSocket frames by sending frames with the RSV1 bit set without proper negotiation, potentially leading to increased CPU or memory consumption.

    How to fix Allocation of Resources Without Limits or Throttling?

    Upgrade aiohttp to version 3.14.2 or higher.

    [,3.14.2)
    • H
    Use After Free

    Affected versions of this package are vulnerable to Use After Free in the C HTTP response parser error handling. An attacker can cause the application to crash or become unresponsive by sending a specially crafted malformed chunked response.

    How to fix Use After Free?

    Upgrade aiohttp to version 3.14.3 or higher.

    [,3.14.3)
    • H
    Allocation of Resources Without Limits or Throttling

    Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling through the handling of HTTP/1 pipelined requests queue without a limit. An attacker can exhaust system memory by sending a large number of pipelined requests, potentially causing service disruption.

    How to fix Allocation of Resources Without Limits or Throttling?

    Upgrade aiohttp to version 3.14.1 or higher.

    [,3.14.1)
    • M
    Improper Resource Shutdown or Release

    Affected versions of this package are vulnerable to Improper Resource Shutdown or Release in the payload response resources when a client disconnects during a write operation. An attacker can cause temporary resource exhaustion by repeatedly initiating connections and disconnecting mid-transfer, leading to open files or similar resources not being released until garbage collection occurs.

    How to fix Improper Resource Shutdown or Release?

    Upgrade aiohttp to version 3.14.1 or higher.

    [,3.14.1)
    • H
    Improper Handling of Highly Compressed Data (Data Amplification)

    Affected versions of this package are vulnerable to Improper Handling of Highly Compressed Data (Data Amplification) during cleanup. An attacker can exhaust system memory by sending a specially crafted compressed payload that is decompressed into memory in a single chunk.

    How to fix Improper Handling of Highly Compressed Data (Data Amplification)?

    Upgrade aiohttp to version 3.14.1 or higher.

    [,3.14.1)
    • H
    Allocation of Resources Without Limits or Throttling

    Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling in the C HTTP parser when the max_line_size check is bypassed for fragmented lines. An attacker can cause excessive memory consumption by sending oversized HTTP request lines, potentially resulting in resource exhaustion and service disruption.

    How to fix Allocation of Resources Without Limits or Throttling?

    Upgrade aiohttp to version 3.14.1 or higher.

    [,3.14.1)
    • M
    Improper Validation of Certificate with Host Mismatch

    Affected versions of this package are vulnerable to Improper Validation of Certificate with Host Mismatch in the server_hostname parameter handling during HTTPS connection reuse. An attacker can bypass intended TLS SNI checks by reusing an existing connection with a different server_hostname, potentially allowing connections to unintended hosts.

    How to fix Improper Validation of Certificate with Host Mismatch?

    Upgrade aiohttp to version 3.14.1 or higher.

    [,3.14.1)
    • M
    Exposure of Private Personal Information to an Unauthorized Actor

    Affected versions of this package are vulnerable to Exposure of Private Personal Information to an Unauthorized Actor in the CookieJar.save and CookieJar.load functions. An attacker can cause cookies intended for a specific host to be sent to subdomains by persisting and restoring cookies, potentially leading to unintended information disclosure.

    How to fix Exposure of Private Personal Information to an Unauthorized Actor?

    Upgrade aiohttp to version 3.14.1 or higher.

    [,3.14.1)
    • M
    HTTP Response Splitting

    Affected versions of this package are vulnerable to HTTP Response Splitting via MultipartWriter.append or Payload.headers when attacker-controlled input is included in multipart or payload headers. An attacker can inject additional headers or alter the contents of a request by supplying specially crafted input.

    Note: This is only exploitable if user-controlled strings are passed into the headers parameter of MultipartWriter.append or Payload.headers.

    How to fix HTTP Response Splitting?

    Upgrade aiohttp to version 3.14.0 or higher.

    [,3.14.0)
    • M
    Insufficiently Protected Credentials

    Affected versions of this package are vulnerable to Insufficiently Protected Credentials via the DigestAuthMiddleware class when authentication responses are sent after following cross-origin redirects. An attacker can obtain authentication digests by leveraging an open redirect or similar issue to redirect a client to an attacker-controlled domain.

    Note: This is only exploitable if the client follows redirects to attacker-controlled domains.

    How to fix Insufficiently Protected Credentials?

    Upgrade aiohttp to version 3.14.1 or higher.

    [,3.14.1)
    • H
    Allocation of Resources Without Limits or Throttling

    Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling via the websocket checks. An attacker can exhaust system memory by sending large incomplete frame payloads, potentially leading to service disruption.

    How to fix Allocation of Resources Without Limits or Throttling?

    Upgrade aiohttp to version 3.14.1 or higher.

    [,3.14.1)
    • M
    Origin Validation Error

    Affected versions of this package are vulnerable to Origin Validation Error via the cookies parameter, which is processed by _connect_and_send_request() in client.py. An attacker who can control a redirect on a request that passes cookies on a per-request basis can expose data from those requests.

    How to fix Origin Validation Error?

    Upgrade aiohttp to version 3.14.0 or higher.

    [,3.14.0)
    • H
    Deserialization of Untrusted Data

    Affected versions of this package are vulnerable to Deserialization of Untrusted Data via the CookieJar.load() function. A user who convinces another user to load a malicious serialized object can cause the execution of arbitrary code.

    How to fix Deserialization of Untrusted Data?

    Upgrade aiohttp to version 3.14.0 or higher.

    [,3.14.0)
    • M
    Allocation of Resources Without Limits or Throttling

    Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling due to insufficient restrictions in the handling of HTTP headers and trailers. An attacker can exhaust system memory by sending specially crafted requests, potentially leading to service unavailability.

    How to fix Allocation of Resources Without Limits or Throttling?

    Upgrade aiohttp to version 3.13.4 or higher.

    [,3.13.4)
    • H
    Server-side Request Forgery (SSRF)

    Affected versions of this package are vulnerable to Server-side Request Forgery (SSRF) in the static resource handler on Windows. An attacker can extract NTLMv2 credential hashes by accessing specially crafted remote paths, potentially leading to credential theft.

    How to fix Server-side Request Forgery (SSRF)?

    Upgrade aiohttp to version 3.13.4 or higher.

    [,3.13.4)
    • M
    Allocation of Resources Without Limits or Throttling

    Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling in the TCPConnector function. An attacker can cause excessive memory consumption by making requests to a very large number of hosts, leading to resource exhaustion.

    How to fix Allocation of Resources Without Limits or Throttling?

    Upgrade aiohttp to version 3.13.4 or higher.

    [,3.13.4)
    • M
    HTTP Response Splitting

    Affected versions of this package are vulnerable to HTTP Response Splitting in the construction of multipart request headers when untrusted input is used for the content_type parameter. An attacker can inject arbitrary headers or manipulate HTTP requests by supplying specially crafted values.

    How to fix HTTP Response Splitting?

    Upgrade aiohttp to version 3.13.4 or higher.

    [,3.13.4)
    • M
    Information Exposure

    Affected versions of this package are vulnerable to Information Exposure in the handling of cross-origin redirects, where Cookie and Proxy-Authorization headers are not properly removed. An attacker can obtain sensitive information by causing a user to follow a redirect to a malicious origin.

    How to fix Information Exposure?

    Upgrade aiohttp to version 3.13.4 or higher.

    [,3.13.4)
    • M
    Allocation of Resources Without Limits or Throttling

    Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling in the Request.post function. An attacker can cause excessive memory allocation by sending a specially crafted multipart request containing large non-file fields.

    How to fix Allocation of Resources Without Limits or Throttling?

    Upgrade aiohttp to version 3.13.4 or higher.

    [,3.13.4)
    • M
    HTTP Request Smuggling

    Affected versions of this package are vulnerable to HTTP Request Smuggling via the processing of duplicate Host headers. An attacker can bypass security checks enforced by a reverse proxy by sending requests with multiple Host headers, potentially causing the proxy and the backend to interpret different host values and allowing unauthorized access to privileged sub-applications.

    Note:

    This is only exploitable if a reverse proxy applies security rules based on the Host header and the backend uses domain-based routing.

    How to fix HTTP Request Smuggling?

    Upgrade aiohttp to version 3.13.4 or higher.

    [,3.13.4)
    • H
    Allocation of Resources Without Limits or Throttling

    Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling in the processing of multipart headers. An attacker can cause excessive memory consumption by sending a response with an unusually large number of multipart headers.

    How to fix Allocation of Resources Without Limits or Throttling?

    Upgrade aiohttp to version 3.13.4 or higher.

    [,3.13.4)
    • M
    HTTP Response Splitting

    Affected versions of this package are vulnerable to HTTP Response Splitting via the reason parameter in the HTTP response creation process. An attacker can inject unauthorized headers or manipulate the HTTP response by supplying specially crafted input containing carriage return characters.

    How to fix HTTP Response Splitting?

    Upgrade aiohttp to version 3.13.4 or higher.

    [,3.13.4)
    • M
    HTTP Response Splitting

    Affected versions of this package are vulnerable to HTTP Response Splitting in the llhttp component. An attacker can manipulate HTTP response headers by injecting null bytes or control characters, causing headers to be interpreted differently by various components, which may lead to security bypass or inconsistent behavior between the application and reverse proxies.

    How to fix HTTP Response Splitting?

    Upgrade aiohttp to version 3.13.4 or higher.

    [,3.13.4)
    • M
    Logging of Excessive Data

    Affected versions of this package are vulnerable to Logging of Excessive Data via the cookies attribute. An attacker can generate excessive warning-level log entries by sending specially crafted Cookie headers.

    How to fix Logging of Excessive Data?

    Upgrade aiohttp to version 3.13.3 or higher.

    [,3.13.3)
    • H
    Infinite loop

    Affected versions of this package are vulnerable to Infinite loop in the Request.post() function. An attacker can cause the application to exhaust system resources by sending a POST request.

    Note: This is only exploitable if Python optimizations are enabled (using the -O flag or setting PYTHONOPTIMIZE=1).

    How to fix Infinite loop?

    Upgrade aiohttp to version 3.13.3 or higher.

    [,3.13.3)
    • M
    Allocation of Resources Without Limits or Throttling

    Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling in the request.read() method. An attacker can cause the server to consume excessive CPU resources by sending a large number of chunked messages.

    How to fix Allocation of Resources Without Limits or Throttling?

    Upgrade aiohttp to version 3.13.3 or higher.

    [,3.13.3)
    • M
    HTTP Request Smuggling

    Affected versions of this package are vulnerable to HTTP Request Smuggling via the parsing of Range headers. An attacker can potentially interfere with HTTP request processing by supplying non-ASCII decimals in the header, which may lead to unexpected parser mismatches.

    How to fix HTTP Request Smuggling?

    Upgrade aiohttp to version 3.13.3 or higher.

    [,3.13.3)
    • M
    Information Exposure

    Affected versions of this package are vulnerable to Information Exposure over the /static endpoint. An attacker can determine the existence of internal path components by sending requests to probe for absolute path elements.

    How to fix Information Exposure?

    Upgrade aiohttp to version 3.13.3 or higher.

    [,3.13.3)
    • H
    Allocation of Resources Without Limits or Throttling

    Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling in the Request.post function. An attacker can cause the server to exhaust available memory and become unresponsive.

    How to fix Allocation of Resources Without Limits or Throttling?

    Upgrade aiohttp to version 3.13.3 or higher.

    [,3.13.3)
    • H
    Allocation of Resources Without Limits or Throttling

    Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling via the auto_decompress feature in the ZLibDecompressor class. An attacker can exhaust system memory by sending a compressed request that, when decompressed, consumes excessive resources.

    How to fix Allocation of Resources Without Limits or Throttling?

    Upgrade aiohttp to version 3.13.3 or higher.

    [,3.13.3)
    • M
    HTTP Request Smuggling

    Affected versions of this package are vulnerable to HTTP Request Smuggling via the unicode processing of HTTP header values. An attacker can bypass firewall or proxy protections by sending requests containing non-ASCII characters.

    Note: This is only exploitable if C extensions are not in use (pure python installation) or if the AIOHTTP_NO_EXTENSIONS environment variable is enabled.

    How to fix HTTP Request Smuggling?

    Upgrade aiohttp to version 3.13.3 or higher.

    [,3.13.3)
    • H
    HTTP Request Smuggling

    Affected versions of this package are vulnerable to HTTP Request Smuggling via incorrect parsing of the trailer section in HTTP requests. An attacker can bypass firewall or proxy protections by crafting specially formed HTTP requests.

    Note: This is exploitable if the pure Python version of aiohttp is installed or the AIOHTTP_NO_EXTENSIONS environment variable is enabled.

    How to fix HTTP Request Smuggling?

    Upgrade aiohttp to version 3.12.14 or higher.

    [,3.12.14)
    • H
    HTTP Request Smuggling

    Affected versions of this package are vulnerable to HTTP Request Smuggling due to incorrect parsing of newlines in chunk extensions via the feed_data function. An attacker can bypass firewall or proxy protections by sending specially crafted requests.

    Note:

    Exploiting this vulnerability is possible when a pure Python version of aiohttp is installed (Without the usual C extensions) or AIOHTTP_NO_EXTENSIONS is enabled.

    How to fix HTTP Request Smuggling?

    Upgrade aiohttp to version 3.10.11 or higher.

    [,3.10.11)
    • M
    UNIX Symbolic Link (Symlink) Following

    Affected versions of this package are vulnerable to UNIX Symbolic Link (Symlink) Following through the FileResponse class due to improper validation for compressed variants. An attacker can access files outside the intended directory by manipulating symbolic links to point to restricted areas by performing Path.stat() and Path.open() to send the file.

    Note

    This vulnerability impacts servers with static routes that contain compressed variants as symbolic links pointing outside the root directory or that permit users to upload or create such links.

    How to fix UNIX Symbolic Link (Symlink) Following?

    Upgrade aiohttp to version 3.10.2 or higher.

    [,3.10.2)
    • H
    Infinite loop

    Affected versions of this package are vulnerable to Infinite loop when processing a multipart/form-data POST request with malicious CONTENT_DISPOSITION values. An attacker can cause the server to deny all other requests while stuck in the loop.

    How to fix Infinite loop?

    Upgrade aiohttp to version 3.9.4 or higher.

    [,3.9.4)
    • M
    Cross-site Scripting (XSS)

    Affected versions of this package are vulnerable to Cross-site Scripting (XSS) due to improper handling of index pages for static file serving when show_index is set to True. If users have the ability to upload files with arbitrary filenames to the static directory, an attacker can inject malicious scripts that will be executed in the context of the victim's browser session by crafting a file name that includes executable script content.

    Note:

    This is only exploitable if the server is configured to allow users to upload files to the static directory and show_index is enabled.

    How to fix Cross-site Scripting (XSS)?

    Upgrade aiohttp to version 3.9.4 or higher.

    [,3.9.4)
    • M
    HTTP Request Smuggling

    Affected versions of this package are vulnerable to HTTP Request Smuggling due to improper validation of HTTP request elements. An attacker can potentially inject additional requests or cause unhandled exceptions leading to excessive resource consumption by exploiting leniencies in the HTTP parser and inconsistencies in error handling.

    How to fix HTTP Request Smuggling?

    Upgrade aiohttp to version 3.9.2 or higher.

    [,3.9.2)
    • M
    Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

    Affected versions of this package are vulnerable to Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') via the configuration of static routes when the follow_symlinks option is set to True. An attacker can read arbitrary files on the system by exploiting the lack of validation for file paths to ensure they are within the specified root directory for static files.

    Notes:

    This vulnerability has been present since the introduction of the follow_symlinks parameter.

    An application is only vulnerable with setup code like:

    app.router.add_routes([
        web.static("/static", "static/", follow_symlinks=True),  # Remove follow_symlinks to avoid the vulnerability
    ])
    

    How to fix Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')?

    Upgrade aiohttp to version 3.9.2 or higher.

    [1.0.5,3.9.2)
    • M
    Improper Input Validation

    Affected versions of this package are vulnerable to Improper Input Validation via the ClientSession method. An attacker can modify the HTTP request or create a new HTTP request if they control the HTTP method.

    Note: This is only exploitable if the attacker can control the HTTP method of the request.

    How to fix Improper Input Validation?

    Upgrade aiohttp to version 3.9.0 or higher.

    [,3.9.0)
    • M
    Improper Input Validation

    Affected versions of this package are vulnerable to Improper Input Validation in the ClientSession. An attacker can modify the HTTP request or create a new HTTP request by controlling the HTTP version of the request. If a list is passed, then it bypasses validation and it is possible to perform CRLF injection.

    Note: The vulnerability only occurs if the attacker can control the HTTP version of the request (including its type).

    How to fix Improper Input Validation?

    Upgrade aiohttp to version 3.9.0 or higher.

    [,3.9.0)
    • M
    HTTP Request Smuggling

    Affected versions of this package are vulnerable to HTTP Request Smuggling due to a vulnerable dependency. An attacker can exploit request smuggling vulnerabilities.

    How to fix HTTP Request Smuggling?

    Upgrade aiohttp to version 3.8.6 or higher.

    [,3.8.6)
    • M
    Inconsistent Interpretation of HTTP Messages

    Affected versions of this package are vulnerable to Inconsistent Interpretation of HTTP Messages due to the inconsistent interpretation of Content-Length vs. Transfer-Encoding in both C and Python fallbacks. An attacker can bypass proxy rules and poison sockets to other users, potentially passing Authentication Headers.

    Note:

    This is only exploitable if a configuration with a reverse proxy that accepts both Content-Length and Transfer-Encoding headers and aiohttp as backend is present.

    Additionally, if an Open Redirect is present, it can be combined to redirect random users to an attacker's website and log the request.

    How to fix Inconsistent Interpretation of HTTP Messages?

    Upgrade aiohttp to version 3.8.0 or higher.

    [,3.8.0)
    • M
    HTTP Request Smuggling

    Affected versions of this package are vulnerable to HTTP Request Smuggling via the HTTP parser. An attacker can manipulate the header parsing, leading to potential request smuggling by exploiting the incorrect usage of the int constructor for Content-Length values, improper handling of NUL, CR, and LF in header values, and improper stripping of whitespace before colon in HTTP headers.

    Note:

    This is only exploitable if AIOHTTP_NO_EXTENSIONS is enabled or not using a prebuilt wheel.

    How to fix HTTP Request Smuggling?

    Upgrade aiohttp to version 3.8.6 or higher.

    [,3.8.6)
    • M
    HTTP Request Smuggling

    Affected versions of this package are vulnerable to HTTP Request Smuggling in that aiohttp is bundled with llhttp v6.0.6, which is vulnerable to CVE-2023-30589. The vulnerable code is used by aiohttp for its HTTP request parser, when available, which is the default case when installing from a wheel.

    Note

    This vulnerability only affects users of aiohttp as an HTTP server (i.e. aiohttp.Application). Users are not affected by this vulnerability if they use aiohttp as an HTTP client library (i.e. aiohttp.ClientSession).

    How to fix HTTP Request Smuggling?

    Upgrade aiohttp to version 3.8.5 or higher.

    [,3.8.5)
    • H
    HTTP Header Injection

    Affected versions of this package are vulnerable to HTTP Header Injection since aiohttp simply concatenated headers without any validation. This allowed an attacker to inject arbitrary content into the headers, including CRLF characters.

    PoC

    // For this code
    import aiohttp.web
    async def handler(req: aiohttp.web.Request):
        return aiohttp.web.Response(headers={
            'X-Debug-Param': req.query.get('param', ''),
        })
    app = aiohttp.web.Application()
    app.add_get('/', handler)
    
    // Send the following requests to the webapp
    /?param=%0d%0aLocation:%20https://malware.host/  # open redirect
    /?param=%0d%0aSet-Cookie:%20...                  # set some cookie
    /?param=%0d%0aContent-Length:%2040%0d%0a         # skip next headers
    

    How to fix HTTP Header Injection?

    Upgrade aiohttp to version 3.8.0 or higher.

    [,3.8.0)
    • M
    Open Redirect

    Affected versions of this package are vulnerable to Open Redirect. Redirects are possible within the aiohttp.web.normalize_path_middleware.

    How to fix Open Redirect?

    Upgrade aiohttp to version 3.7.4 or higher.

    [,3.7.4)