mirror of
https://github.com/elicpeter/nyx.git
synced 2026-07-12 21:02:11 +02:00
[pitboss] phase 04: Track J.2 + Track L.2 — SSTI corpus + Jinja2 / ERB / Twig / Thymeleaf / Handlebars adapters
This commit is contained in:
parent
b5e6dddf2c
commit
8583b29796
34 changed files with 1868 additions and 29 deletions
14
tests/dynamic_fixtures/ssti/php_twig/vuln.php
Normal file
14
tests/dynamic_fixtures/ssti/php_twig/vuln.php
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<?php
|
||||
// Phase 04 (Track J.2) — PHP Twig SSTI vuln fixture.
|
||||
//
|
||||
// The body is handed straight to Twig\Environment::createTemplate so
|
||||
// an attacker who controls the body reaches Twig's expression
|
||||
// evaluator and can render arbitrary expressions.
|
||||
use Twig\Environment;
|
||||
use Twig\Loader\ArrayLoader;
|
||||
|
||||
function run(string $body): string {
|
||||
$twig = new Environment(new ArrayLoader([]));
|
||||
$template = $twig->createTemplate($body);
|
||||
return $template->render([]);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue