diff options
| author | 2014-12-05 10:51:34 +0100 | |
|---|---|---|
| committer | 2014-12-05 10:54:44 +0100 | |
| commit | a2da70fd119cc43438f8dd88de54a7d19fafbe1a (patch) | |
| tree | 7d7f2523760e12627c87b2a66de19d913ab1d366 /lib/Minz/Extension.php | |
| parent | f1fd1091b9ef0cb0818659e0ce1c9699506cac97 (diff) | |
Fix security hole from ext.php script.
Now, ext.php can only serve file under a EXTENSIONS_PATH/ext_dir/static/ directory.
A 400 Bad Request error will be returned for other files.
See https://github.com/FreshRSS/FreshRSS/issues/252
And https://github.com/FreshRSS/FreshRSS/commit/f9b037742a0aeb49cab86782d1a59913c2de47b
Diffstat (limited to 'lib/Minz/Extension.php')
| -rw-r--r-- | lib/Minz/Extension.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Minz/Extension.php b/lib/Minz/Extension.php index 72a375a6d..ecf510ea2 100644 --- a/lib/Minz/Extension.php +++ b/lib/Minz/Extension.php @@ -106,9 +106,9 @@ class Minz_Extension { */ public function getFileUrl($filename, $type) { $dir = end(explode('/', $this->path)); - $file_name_url = urlencode($dir . '/' . $filename); + $file_name_url = urlencode($dir . '/static/' . $filename); - $absolute_path = $this->path . '/' . $filename; + $absolute_path = $this->path . '/static/' . $filename; $mtime = @filemtime($absolute_path); $url = '/ext.php?f=' . $file_name_url . |
