From fe4a0bbe2088d0c2b331216dad21ccd0bb3ee80d Mon Sep 17 00:00:00 2001 From: Natalia <124304+nessita@users.noreply.github.com> Date: Wed, 20 Mar 2024 13:55:21 -0300 Subject: Fixed CVE-2024-39330 -- Added extra file name validation in Storage's save method. Thanks to Josh Schneier for the report, and to Carlton Gibson and Sarah Boyce for the reviews. --- tests/file_uploads/tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/file_uploads') diff --git a/tests/file_uploads/tests.py b/tests/file_uploads/tests.py index 6db8f9022d..c46f5a490b 100644 --- a/tests/file_uploads/tests.py +++ b/tests/file_uploads/tests.py @@ -880,7 +880,7 @@ class DirectoryCreationTests(SimpleTestCase): default_storage.delete(UPLOAD_TO) # Create a file with the upload directory name with SimpleUploadedFile(UPLOAD_TO, b"x") as file: - default_storage.save(UPLOAD_TO, file) + default_storage.save(UPLOAD_FOLDER, file) self.addCleanup(default_storage.delete, UPLOAD_TO) msg = "%s exists and is not a directory." % UPLOAD_TO with self.assertRaisesMessage(FileExistsError, msg): -- cgit v1.3