Subject: | StaticHandler gives "dangerous path error" |
POE::Component::Server::HTTPServer::StaticHandler.pm
Windows XP
perl 5.8.3
Using this simple web page, the first image is not rendered but the other are rendered OK.
<html>
<head>
</head>
<body>
<img src="/art/fmtv10/04/qd04t07.wmf">
<img src="/ems_wd01/icons/xplode.bmp">
<img src="/ems_wd01/icons/qd04t07.wmf">
</body>
</html>
This seems to be related to fact there is a subdirectory with a length of 2 characters. In the example above, the first link has an image file in the "04" directory.
I am confused by the reason for the if statement on lines 39 to 42 in StaticHandler.pm. If this code is commented out, the file is rendered OK.
if ( $cpath =~ m[(^|/)..(/|$)] ) {
warn "Will not serve dangerous path '$cpath'\n"; # should keep silent here
return H_CONT;
}