summaryrefslogtreecommitdiff
path: root/tests/file_uploads
diff options
context:
space:
mode:
authorNatalia <124304+nessita@users.noreply.github.com>2024-03-20 13:55:21 -0300
committerNatalia <124304+nessita@users.noreply.github.com>2024-07-09 10:40:48 -0300
commit2b00edc0151a660d1eb86da4059904a0fc4e095e (patch)
tree1ca6d18807f1b88b3b9133f44fb2abd764d07577 /tests/file_uploads
parent156d3186c96e3ec2ca73b8b25dc2ef366e38df14 (diff)
[4.2.x] 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.
Diffstat (limited to 'tests/file_uploads')
-rw-r--r--tests/file_uploads/tests.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/file_uploads/tests.py b/tests/file_uploads/tests.py
index 693efc4c62..24c703a309 100644
--- a/tests/file_uploads/tests.py
+++ b/tests/file_uploads/tests.py
@@ -826,7 +826,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):