Version in base suite: 0.0.20-1 Base version: python-multipart_0.0.20-1 Target version: python-multipart_0.0.20-1.1~deb13u1 Base file: /srv/ftp-master.debian.org/ftp/pool/main/p/python-multipart/python-multipart_0.0.20-1.dsc Target file: /srv/ftp-master.debian.org/policy/pool/main/p/python-multipart/python-multipart_0.0.20-1.1~deb13u1.dsc changelog | 15 +++++ patches/CVE-2026-24486.patch | 63 ++++++++++++++++++++++++ patches/chore-add-return-type-on-test-221.patch | 25 +++++++++ patches/series | 2 4 files changed, 105 insertions(+) dpkg-source: warning: cannot verify inline signature for /srv/release.debian.org/tmp/tmpken0henn/python-multipart_0.0.20-1.dsc: no acceptable signature found dpkg-source: warning: cannot verify inline signature for /srv/release.debian.org/tmp/tmpken0henn/python-multipart_0.0.20-1.1~deb13u1.dsc: no acceptable signature found diff -Nru python-multipart-0.0.20/debian/changelog python-multipart-0.0.20/debian/changelog --- python-multipart-0.0.20/debian/changelog 2025-03-14 05:14:13.000000000 +0000 +++ python-multipart-0.0.20/debian/changelog 2026-03-08 18:08:51.000000000 +0000 @@ -1,3 +1,18 @@ +python-multipart (0.0.20-1.1~deb13u1) trixie; urgency=medium + + * Rebuild for trixie + + -- Salvatore Bonaccorso Sun, 08 Mar 2026 19:08:51 +0100 + +python-multipart (0.0.20-1.1) unstable; urgency=medium + + * Non-maintainer upload. + * Arbitrary file write via a non-default configuration (CVE-2026-24486) + (Closes: #1126557) + * chore: add return type on test + + -- Salvatore Bonaccorso Sun, 01 Feb 2026 16:22:52 +0100 + python-multipart (0.0.20-1) unstable; urgency=medium * New upstream release diff -Nru python-multipart-0.0.20/debian/patches/CVE-2026-24486.patch python-multipart-0.0.20/debian/patches/CVE-2026-24486.patch --- python-multipart-0.0.20/debian/patches/CVE-2026-24486.patch 1970-01-01 00:00:00.000000000 +0000 +++ python-multipart-0.0.20/debian/patches/CVE-2026-24486.patch 2026-03-08 18:08:14.000000000 +0000 @@ -0,0 +1,63 @@ +From: Marcelo Trylesinski +Date: Sun, 25 Jan 2026 10:37:09 +0100 +Subject: Merge commit from fork +Origin: https://github.com/Kludex/python-multipart/commit/9433f4bbc9652bdde82bbe380984e32f8cfc89c4 +Bug-Debian: https://bugs.debian.org/1126557 +Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2026-24486 + +--- + python_multipart/multipart.py | 4 +++- + tests/test_file.py | 26 ++++++++++++++++++++++++++ + 2 files changed, 29 insertions(+), 1 deletion(-) + create mode 100644 tests/test_file.py + +diff --git a/python_multipart/multipart.py b/python_multipart/multipart.py +index 0cc4c82ebdf6..1489b7afd55d 100644 +--- a/python_multipart/multipart.py ++++ b/python_multipart/multipart.py +@@ -375,7 +375,9 @@ class File: + + # Split the extension from the filename. + if file_name is not None: +- base, ext = os.path.splitext(file_name) ++ # Extract just the basename to avoid directory traversal ++ basename = os.path.basename(file_name) ++ base, ext = os.path.splitext(basename) + self._file_base = base + self._ext = ext + +diff --git a/tests/test_file.py b/tests/test_file.py +new file mode 100644 +index 000000000000..4d65232e1ad3 +--- /dev/null ++++ b/tests/test_file.py +@@ -0,0 +1,26 @@ ++from pathlib import Path ++ ++from python_multipart.multipart import File ++ ++ ++def test_upload_dir_with_leading_slash_in_filename(tmp_path: Path): ++ upload_dir = tmp_path / "upload" ++ upload_dir.mkdir() ++ ++ # When the file_name provided has a leading slash, we should only use the basename. ++ # This is to avoid directory traversal. ++ to_upload = tmp_path / "foo.txt" ++ ++ file = File( ++ bytes(to_upload), ++ config={ ++ "UPLOAD_DIR": bytes(upload_dir), ++ "UPLOAD_KEEP_FILENAME": True, ++ "UPLOAD_KEEP_EXTENSIONS": True, ++ "MAX_MEMORY_FILE_SIZE": 10, ++ }, ++ ) ++ file.write(b"123456789012") ++ assert not file.in_memory ++ assert Path(upload_dir / "foo.txt").exists() ++ assert Path(upload_dir / "foo.txt").read_bytes() == b"123456789012" +-- +2.51.0 + diff -Nru python-multipart-0.0.20/debian/patches/chore-add-return-type-on-test-221.patch python-multipart-0.0.20/debian/patches/chore-add-return-type-on-test-221.patch --- python-multipart-0.0.20/debian/patches/chore-add-return-type-on-test-221.patch 1970-01-01 00:00:00.000000000 +0000 +++ python-multipart-0.0.20/debian/patches/chore-add-return-type-on-test-221.patch 2026-03-08 18:08:14.000000000 +0000 @@ -0,0 +1,25 @@ +From: Marcelo Trylesinski +Date: Sun, 25 Jan 2026 10:41:09 +0100 +Subject: chore: add return type on test (#221) +Origin: https://github.com/Kludex/python-multipart/commit/0fb59a9df0f273bfde99740b302ccb2ae45e2b8a + +--- + tests/test_file.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/test_file.py b/tests/test_file.py +index 4d65232e1ad3..a2aa1348afdf 100644 +--- a/tests/test_file.py ++++ b/tests/test_file.py +@@ -3,7 +3,7 @@ from pathlib import Path + from python_multipart.multipart import File + + +-def test_upload_dir_with_leading_slash_in_filename(tmp_path: Path): ++def test_upload_dir_with_leading_slash_in_filename(tmp_path: Path) -> None: + upload_dir = tmp_path / "upload" + upload_dir.mkdir() + +-- +2.51.0 + diff -Nru python-multipart-0.0.20/debian/patches/series python-multipart-0.0.20/debian/patches/series --- python-multipart-0.0.20/debian/patches/series 2025-03-14 05:14:13.000000000 +0000 +++ python-multipart-0.0.20/debian/patches/series 2026-03-08 18:08:14.000000000 +0000 @@ -1 +1,3 @@ install-only-python_multipart.patch +CVE-2026-24486.patch +chore-add-return-type-on-test-221.patch