PixelFrame gallery upload RCE
A client-proofing photo gallery. The extension blacklist misses .phtml.
0 solves
An upload handler that checks the wrong thing, or checks the right thing and stops there.
An upload handler that checks the wrong property of a file, or checks the right one but nothing else, lets an attacker get executable code onto the server, or a script into another user's browser, disguised as an ordinary file.
$blocked = ['php', 'php3', 'php4', 'php5']; $ext = pathinfo($_FILES['file']['name'], PATHINFO_EXTENSION); if (!in_array(strtolower($ext), $blocked, true)) { move_uploaded_file($_FILES['file']['tmp_name'], "uploads/{$_FILES['file']['name']}"); }
A blacklist has to enumerate every dangerous extension a server might ever
execute, such as .phtml or .pht on some stacks, and misses whatever it
forgot.
Remote code execution: the classic outcome of an under-restricted file upload landing in a web-reachable, script-executing directory.
Content-Type header for anything that
decides how a stored file is served back later.A client-proofing photo gallery. The extension blacklist misses .phtml.
0 solves
A small-business document store. The extension allow-list is correct; what serves the file back later trusts the wrong thing.
0 solves