The product allows an entity to perform a legitimate but expensive operation before authentication or authorization has taken place.
N/A
Threat Mapped score: 0.0
Industry: Finiancial
Threat priority: Unclassified
CVE: CVE-2004-2458
Tool creates directories before authenticating user.
N/A
N/A
Phase | Note |
---|---|
Architecture and Design | N/A |
Implementation | N/A |
Intro: This function prints the contents of a specified file requested by a user.
Body: This code first reads a specified file into memory, then prints the file if the user is authorized to see its contents. The read of the file into memory may be resource intensive and is unnecessary if the user is not allowed to see the file anyway.
function printFile($username,$filename){ //read file into string $file = file_get_contents($filename); if ($file && isOwnerOf($username,$filename)){ echo $file; return true; } else{ echo 'You are not authorized to view this file'; } return false; }