Security
Headlines
HeadlinesLatestCVEs

Headline

CVE-2022-39261: security #cve- Fix a security issue on filesystem loader (possibility… · twigphp/Twig@35f3035

Twig is a template language for PHP. Versions 1.x prior to 1.44.7, 2.x prior to 2.15.3, and 3.x prior to 3.4.3 encounter an issue when the filesystem loader loads templates for which the name is a user input. It is possible to use the source or include statement to read arbitrary files from outside the templates’ directory when using a namespace like @somewhere/../some.file. In such a case, validation is bypassed. Versions 1.44.7, 2.15.3, and 3.4.3 contain a fix for validation of such template names. There are no known workarounds aside from upgrading.

CVE
#php

@@ -31,6 +31,7 @@ public function testGetSourceContext()

public function testSecurity($template)

{

$loader = new FilesystemLoader([__DIR__.’/…/Fixtures’]);

$loader->addPath(__DIR__.’/…/Fixtures’, ‘foo’);

try {

$loader->getCacheKey($template);

@@ -62,6 +63,10 @@ public function getSecurityTests()

[‘filters\\\\…\\\\…\\\\AutoloaderTest.php’],

[‘filters\\//…/\\/\\…\\AutoloaderTest.php’],

[‘/…/AutoloaderTest.php’],

[‘@__main__/…/AutoloaderTest.php’],

[‘@foo/…/AutoloaderTest.php’],

[‘@__main__/…/…/AutoloaderTest.php’],

[‘@foo/…/…/AutoloaderTest.php’],

];

}

Related news

Ubuntu Security Notice USN-5947-1

Ubuntu Security Notice 5947-1 - Fabien Potencier discovered that Twig was not properly enforcing sandbox policies when dealing with objects automatically cast to strings by PHP. An attacker could possibly use this issue to expose sensitive information. This issue was only fixed in Ubuntu 16.04 ESM and Ubuntu 18.04 ESM. Marlon Starkloff discovered that Twig was not properly enforcing closure constraints in some of its array filtering functions. An attacker could possibly use this issue to execute arbitrary code. This issue was only fixed in Ubuntu 20.04 ESM.

GHSA-52m2-vc4m-jj33: Twig may load a template outside a configured directory when using the filesystem loader

# Description When using the filesystem loader to load templates for which the name is a user input, it is possible to use the `source` or `include` statement to read arbitrary files from outside the templates directory when using a namespace like `@somewhere/../some.file` (in such a case, validation is bypassed). # Resolution We fixed validation for such template names. Even if the 1.x branch is not maintained anymore, a new version has been released. # Credits We would like to thank Dariusz Tytko for reporting the issue and Fabien Potencier for fixing the issue.

CVE: Latest News

CVE-2023-50976: Transactions API Authorization by oleiman · Pull Request #14969 · redpanda-data/redpanda
CVE-2023-6905
CVE-2023-6903
CVE-2023-6904
CVE-2023-3907