【问题标题】:Apache: multiple ../ in query string = internal server error (error 500)Apache:查询字符串中的多个 ../ = 内部服务器错误(错误 500)
【发布时间】: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


    【解决方案1】:

    原来是托管服务提供商默认启用的安全预防措施 - 不允许“反向路径”,但我不确定是哪一个,以及它的设置位置。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-02-12
      • 2015-11-22
      • 2018-11-14
      • 2011-10-04
      • 1970-01-01
      • 2016-02-16
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多