diff options
| author | Tim Graham <timograham@gmail.com> | 2014-08-08 10:20:08 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-08-20 14:39:40 -0400 |
| commit | 0d8d30b7ddfe83ab03120f4560c7aa153f4d0ed1 (patch) | |
| tree | 36523aca0c14222c8b30241e2e0a8fe3a8af511c /docs/howto | |
| parent | 28e765810df46a3f28ff4785491e9973593382fd (diff) | |
Fixed #23157 -- Removed O(n) algorithm when uploading duplicate file names.
This is a security fix. Disclosure following shortly.
Diffstat (limited to 'docs/howto')
| -rw-r--r-- | docs/howto/custom-file-storage.txt | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/docs/howto/custom-file-storage.txt b/docs/howto/custom-file-storage.txt index 5109986d45..afa1c9a908 100644 --- a/docs/howto/custom-file-storage.txt +++ b/docs/howto/custom-file-storage.txt @@ -90,5 +90,14 @@ the provided filename into account. The ``name`` argument passed to this method will have already cleaned to a filename valid for the storage system, according to the ``get_valid_name()`` method described above. -The code provided on ``Storage`` simply appends ``"_1"``, ``"_2"``, etc. to the -filename until it finds one that's available in the destination directory. +.. versionchanged:: 1.7 + + If a file with ``name`` already exists, an underscore plus a random 7 + character alphanumeric string is appended to the filename before the + extension. + + Previously, an underscore followed by a number (e.g. ``"_1"``, ``"_2"``, + etc.) was appended to the filename until an avaible name in the destination + directory was found. A malicious user could exploit this deterministic + algorithm to create a denial-of-service attack. This change was also made + in Django 1.6.6, 1.5.9, and 1.4.14. |
