mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-03 16:51:40 +09:00
RVE-2022-3 filter tpl_path in TemplateHandler class
- $tpl_path에 템플릿 문법으로 오인할 수 있는 특수문자가 포함된 경우 삭제 - path traversal은 여기에서 방어하지 않음
This commit is contained in:
parent
90e510091d
commit
1c33529377
1 changed files with 1 additions and 0 deletions
|
|
@ -93,6 +93,7 @@ class TemplateHandler
|
|||
{
|
||||
// verify arguments
|
||||
$tpl_path = trim(preg_replace('@^' . preg_quote(\RX_BASEDIR, '@') . '|\./@', '', str_replace('\\', '/', $tpl_path)), '/') . '/';
|
||||
$tpl_path = preg_replace('/[\{\}\(\)\[\]<>\$\'"]/', '', $tpl_path);
|
||||
if($tpl_path === '/')
|
||||
{
|
||||
$tpl_path = '';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue