This commit is contained in:
Eli Peter 2026-06-05 10:16:30 -05:00 committed by GitHub
parent 55247b7fcd
commit 991c84a1eb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
1464 changed files with 225448 additions and 1985 deletions

View file

@ -0,0 +1,35 @@
<?php
// Symfony-style route via RouteCollection and HttpKernel, benign sanitised payload.
namespace App\Controller;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Routing\Route as SymfonyRoute;
use Symfony\Component\Routing\RouteCollection;
function nyx_register_routes(RouteCollection $routes): void
{
$routes->add('nyx_run', new SymfonyRoute(
'/run/{payload}',
['_controller' => [new UserController(), 'run']],
[],
[],
'',
[],
['GET']
));
}
class UserController
{
#[Route('/run/{payload}', methods: ['GET'])]
public function run(string $payload): Response
{
echo "__NYX_SINK_HIT__\n";
$cmd = "true " . escapeshellarg($payload);
$out = shell_exec($cmd) ?? '';
echo $out;
return new Response($out);
}
}

View file

@ -0,0 +1,9 @@
{
"name": "nyx/fixture-symfony",
"require": {
"php": ">=8.1",
"symfony/framework-bundle": "^7.0",
"symfony/routing": "^7.0",
"symfony/http-kernel": "^7.0"
}
}

View file

@ -0,0 +1,35 @@
<?php
// Symfony-style route via RouteCollection and HttpKernel, vulnerable.
namespace App\Controller;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Routing\Route as SymfonyRoute;
use Symfony\Component\Routing\RouteCollection;
function nyx_register_routes(RouteCollection $routes): void
{
$routes->add('nyx_run', new SymfonyRoute(
'/run/{payload}',
['_controller' => [new UserController(), 'run']],
[],
[],
'',
[],
['GET']
));
}
class UserController
{
#[Route('/run/{payload}', methods: ['GET'])]
public function run(string $payload): Response
{
echo "__NYX_SINK_HIT__\n";
$cmd = "echo hello " . $payload;
$out = shell_exec($cmd) ?? '';
echo $out;
return new Response($out);
}
}