Skip to content

Commit

Permalink
Remove File Type Override
Browse files Browse the repository at this point in the history
Remove file type overwrite previously used to force downloads. This
addresses potential XSS where an attacker could pass "image" resulting in
the file being displayed in line.
  • Loading branch information
protich committed Jun 13, 2019
1 parent fac1c2d commit 539d343
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions include/class.file.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,6 @@ function download($disposition=false, $expires=false) {
$ttl = ($expires) ? $expires - Misc::gmtime() : false;
$this->makeCacheable($ttl);
$type = $this->getType() ?: 'application/octet-stream';
if (isset($_REQUEST['overridetype']))
$type = $_REQUEST['overridetype'];
Http::download($this->getName(), $type, null, 'inline');
header('Content-Length: '.$this->getSize());
$this->sendData(false);
Expand Down

0 comments on commit 539d343

Please sign in to comment.