Skip to content

Commit

Permalink
[IMPORTANT SECURITY] Fix critical directory traversal vulnerability i…
Browse files Browse the repository at this point in the history
…n file seeding mechanism
  • Loading branch information
Jill Stingray committed Jun 14, 2020
1 parent 02dd373 commit cf6cda2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Web/Presenters/BlobPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ private function getDirName($dir): string
function renderFile(/*string*/ $dir, string $name, string $format)
{
$dir = $this->getDirName($dir);
$name = preg_replace("%[^a-zA-Z0-9_\-]++%", "", $name);
$path = OPENVK_ROOT . "/storage/$dir/$name.$format";
if(!file_exists($path)) {
$this->notFound();
Expand Down

0 comments on commit cf6cda2

Please sign in to comment.