Closed (fixed)
Project:
File Force Download
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
5 Mar 2013 at 06:26 UTC
Updated:
2 Apr 2013 at 20:10 UTC
Here's a test: upload two files with the same name (say "test.zip"). Drupal will rename second "test.zip" file into "test_0.zip". When downloading the second file, Drupal will take care of URI vs. final name (it stores the "uploaded" name in {file_managed} table 'filename' column).
Enable File Force, and the second file will be downloaded as "test_0.zip".
The culprit is the 'Content-Disposition' => $disposition . '; filename="' . basename($uri) . '"', line in file_force_file_download() which takes uri basename to name the downloaded file.
Comments
Comment #1
iva2k commentedI think the fix in #5 of #1834360: Security issue: Private files are allowed to download via download link, an attacker who knows the url can get any private file can be extended to find out the correct filename without trying to dig out which module's that file is... $headers will have 'Content-Disposition' element, we need simply extract filename=... from it.
I am not planning to roll a patch for this until #1834360: Security issue: Private files are allowed to download via download link, an attacker who knows the url can get any private file is committed.
Comment #2
arski commentedFixed in #1834360: Security issue: Private files are allowed to download via download link, an attacker who knows the url can get any private file - cheers