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