mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
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.
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user