【发布时间】:2010-03-05 19:33:10
【问题描述】:
问题来了:当请求像 - http://server/path/to/file.html?param=../../something/something 这样的 url 时,我得到了响应:
500 Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
...
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
日志说:
xxx.xxx.xxx.xxx - - [05/Mar/2010:13:43:29 -0500] "GET /path/to/file.html?param=../../something/something HTTP/1.1" 404 - "-" ...
如果我在查询字符串(请求 http://server/path/to/file.html?param=../something/something)中删除一个 '../' 实例,我会得到请求的页面。它只在两个或多个'../'s 上给出错误。
这是在一些托管服务器上,同样的事情在我的本地服务器(LAMP、WAMP)上没有错误。我想这是关于 apache 配置的,但我不知道要检查哪些选项。
Apache2.2.14 (Unix) 有问题,安装了 PHP(但当我请求纯 ol' HTML 文件时,它显然与 PHP 没有任何关系),mod_rewrite 规则被禁用(没有 .htaccess 文件在请求文件的路径中)。
关于如何在查询字符串中成功传递多个 '../' 的任何想法?
【问题讨论】:
标签: apache query-string