【问题标题】:Apache Byte Range and Audio FileApache 字节范围和音频文件
【发布时间】:2013-02-16 05:22:39
【问题描述】:

我们服务器上的 Apache 配置为阻止字节范围 (CVE 2011-3192)。但是它使我们服务器上的音频不能播放,因为较新版本的 Safari 和 Chrome 以字节请求它们,但服务器会发送整个内容。

任何指针表示赞赏。

【问题讨论】:

    标签: apache security audio audio-streaming


    【解决方案1】:

    您可以尝试将 apache 设置为仅在发出过多请求时才阻止 Range 标头,而不是完全阻止 Range 标头。来自Apache Wiki:

    使用 SetEnvIf 或 mod_rewrite 检测大量范围,然后 要么忽略 Range: 标头,要么拒绝请求。

    选项 1:(Apache 2.2,需要 mod_setenvif 和 mod_headers)

          # Drop the Range header when more than 5 ranges.
          # CVE-2011-3192
          SetEnvIf Range (?:,.*?){5,5} bad-range=1
          RequestHeader unset Range env=bad-range
    
          # We always drop Request-Range; as this is a legacy
          # dating back to MSIE3 and Netscape 2 and 3.
          #
          RequestHeader unset Request-Range
    
          # optional logging.
          CustomLog logs/range-CVE-2011-3192.log common env=bad-range
    

    数字 5 是任意的。几个 10 应该不是问题,可能是 例如向非常高端的电子阅读器提供 PDF 的网站需要 或使用复杂的基于 http 的视频流。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-02-26
      • 1970-01-01
      相关资源
      最近更新 更多