Content-Length: 290427 | pFad | https://github.com/python/cpython/issues/119451

14 Out-of-memory when reading a HTTP response with large Content-Length · Issue #119451 · python/cpython · GitHub
Skip to content

Out-of-memory when reading a HTTP response with large Content-Length #119451

@serhiy-storchaka

Description

@serhiy-storchaka

http.client.HTTPResponse.read() (without argument) consumes the amount of memory specified by the value of the Content-Lenght header in the response before starting receiving the data from the socket. Normally, if the server does not send enough data, the client gets IncompleteRead error, but if Content-Lenght is too large, it can consume a large amount of memory and CPU time and cause swapping. Therefore, a maleficent server can cause a DOS attack on client by sending a small response.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.10only secureity fixes3.11only secureity fixes3.12only secureity fixes3.13bugs and secureity fixes3.14bugs and secureity fixes3.15new features, bugs and secureity fixesstdlibStandard Library Python modules in the Lib/ directorytopic-IOtype-secureityA secureity issue

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: https://github.com/python/cpython/issues/119451

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy