From aa3ba8d7a9da661ff94e6ce6fe0b36db457e3f70 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 24 Oct 2024 18:31:18 +0200 Subject: [PATCH] python311Packages.starlette: fix CVE-2024-47874 > Denial of service (DoS) via multipart/form-data https://github.com/encode/starlette/security/advisories/GHSA-f96h-pmfr-66vw --- pkgs/development/python-modules/starlette/default.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/development/python-modules/starlette/default.nix b/pkgs/development/python-modules/starlette/default.nix index 0fa7ded655d29..4a501b8b5b340 100644 --- a/pkgs/development/python-modules/starlette/default.nix +++ b/pkgs/development/python-modules/starlette/default.nix @@ -2,6 +2,7 @@ lib, buildPythonPackage, fetchFromGitHub, + fetchpatch2, # build-system hatchling, @@ -40,6 +41,15 @@ buildPythonPackage rec { hash = "sha256-GiCN1sfhLu9i19d2OcLZrlY8E64DFrFh+ITRSvLaxdE="; }; + patches = [ + (fetchpatch2 { + # https://github.com/encode/starlette/security/advisories/GHSA-f96h-pmfr-66vw + name = "CVE-2024-47874.patch"; + url = "https://github.com/encode/starlette/commit/fd038f3070c302bff17ef7d173dbb0b007617733.patch"; + hash = "sha256-N/v0xBa6e40ZrdHfDa5mlHJhh5IyDdC/XdmTtKNOYP4="; + }) + ]; + nativeBuildInputs = [ hatchling ]; propagatedBuildInputs = [ anyio ] ++ lib.optionals (pythonOlder "3.10") [ typing-extensions ];