mirror of
https://github.com/smarty-php/smarty.git
synced 2026-08-04 04:24:18 +02:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e27da524f7 | |||
| a21f59663c | |||
| 3148d406a0 | |||
| 4f634c0097 | |||
| c9272058d9 | |||
| e66e293a8a | |||
| 74cab5a56b | |||
| 8fc66e27a7 | |||
| 288a54f6b0 | |||
| 6463519a6c |
+4
-1
@@ -6,8 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [3.1.39] - 2021-02-17
|
||||
|
||||
### Security
|
||||
- Code injection vulnerability by using illegal function names in `{function name='blah'}{/function}`
|
||||
- Prevent access to `$smarty.template_object` in sandbox mode
|
||||
- Fixed code injection vulnerability by using illegal function names in `{function name='blah'}{/function}`
|
||||
|
||||
## [3.1.38] - 2021-01-08
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ class Smarty extends Smarty_Internal_TemplateBase
|
||||
/**
|
||||
* smarty version
|
||||
*/
|
||||
const SMARTY_VERSION = '3.1.38';
|
||||
const SMARTY_VERSION = '3.1.39';
|
||||
/**
|
||||
* define variable scopes
|
||||
*/
|
||||
|
||||
@@ -81,6 +81,10 @@ class Smarty_Internal_Compile_Private_Special_Variable extends Smarty_Internal_C
|
||||
case 'template':
|
||||
return 'basename($_smarty_tpl->source->filepath)';
|
||||
case 'template_object':
|
||||
if (isset($compiler->smarty->security_policy)) {
|
||||
$compiler->trigger_template_error("(secure mode) template_object not permitted");
|
||||
break;
|
||||
}
|
||||
return '$_smarty_tpl';
|
||||
case 'current_dir':
|
||||
return 'dirname($_smarty_tpl->source->filepath)';
|
||||
|
||||
+1
-1
@@ -14,6 +14,6 @@ git pull
|
||||
git merge --no-ff "release/$1"
|
||||
git branch -d "release/$1"
|
||||
git tag -a "v$1" -m "Release $1"
|
||||
git push --follow-tags
|
||||
|
||||
printf 'Done creating release %s\n' "$1"
|
||||
printf 'Run `git push --follow-tags origin` to publish it.\n'
|
||||
|
||||
@@ -382,6 +382,15 @@ class SecurityTest extends PHPUnit_Smarty
|
||||
$this->smarty->security_policy->trusted_uri = array();
|
||||
$this->assertContains('<title>Preface | Smarty</title>', $this->smarty->fetch('string:{fetch file="https://www.smarty.net/docs/en/preface.tpl"}'));
|
||||
}
|
||||
|
||||
/**
|
||||
* In security mode, accessing $smarty.template_object should be illegal.
|
||||
* @expectedException SmartyCompilerException
|
||||
*/
|
||||
public function testSmartyTemplateObject() {
|
||||
$this->smarty->display('string:{$smarty.template_object}');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class mysecuritystaticclass
|
||||
|
||||
Reference in New Issue
Block a user