nyx/tests/dynamic_fixtures/php/fileio_positive.php
2026-06-05 10:16:30 -05:00

14 lines
452 B
PHP

<?php
// File I/O — positive fixture.
// Vulnerable: reads file at user-controlled path without sanitization.
// Entry: runReadFile($userPath) Cap: FILE_IO
// Expected verdict: Confirmed (../../../../etc/passwd → "root:" in output)
function runReadFile($userPath) {
$filePath = '/var/data/' . $userPath;
echo "__NYX_SINK_HIT__\n";
$content = @file_get_contents($filePath);
if ($content !== false) {
echo $content;
}
}