Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 4d62e72

Browse files
committed
MAGETWO-83584: Filesystem write access with path traversal on "static.php"
1 parent d6e5b1f commit 4d62e72

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/internal/Magento/Framework/App/StaticResource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ protected function parsePath($path)
165165
{
166166
$path = ltrim($path, '/');
167167
$parts = explode('/', $path, 6);
168-
if (count($parts) < 5 || mb_strpos($path, '..') !== false) {
168+
if (count($parts) < 5 || preg_match('/\.\.(\\\|\/)/', $path)) {
169169
//Checking that path contains all required parts and is not above static folder.
170170
throw new \InvalidArgumentException("Requested path '$path' is wrong.");
171171
}

0 commit comments

Comments
 (0)