RVE-2022-3 filter tpl_path in TemplateHandler class

- $tpl_path에 템플릿 문법으로 오인할 수 있는 특수문자가 포함된 경우 삭제
- path traversal은 여기에서 방어하지 않음
This commit is contained in:
Kijin Sung 2022-06-29 15:36:23 +09:00
parent 90e510091d
commit 1c33529377

View file

@ -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 = '';