mirror of
https://github.com/getgrav/grav.git
synced 2025-02-20 19:56:53 +01:00
fixed path traversal by santize checking fiilename
This commit is contained in:
parent
15dc7568a5
commit
5928411b86
|
|
@ -6,6 +6,7 @@
|
|||
1. [](#bugfix)
|
||||
* Fixed some multibyte issues in Inflector class [#732](https://github.com/getgrav/grav/issues/732)
|
||||
* Fallback to page modified date if Page date provided is invalid and can't be parsed [getgrav/grav-plugin-admin#2394](https://github.com/getgrav/grav-plugin-admin/issues/2394)
|
||||
* Fixed a path traversal vulnerability with file uploads [GHSA-m7hx-hw6h-mqmc](https://github.com/getgrav/grav/security/advisories/GHSA-m7hx-hw6h-mqmc)
|
||||
|
||||
# v1.7.44
|
||||
## 01/05/2024
|
||||
|
|
|
|||
|
|
@ -989,6 +989,8 @@ abstract class Utils
|
|||
|| strtr($filename, "\t\v\n\r\0\\/", '_______') !== $filename
|
||||
// Filename should not start or end with dot or space.
|
||||
|| trim($filename, '. ') !== $filename
|
||||
// Filename should not contain path traversal
|
||||
|| str_replace('..', '', $filename) !== $filename
|
||||
// File extension should not be part of configured dangerous extensions
|
||||
|| in_array($extension, $dangerous_extensions)
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user