
Fix URL containing SPACES after Apache upgrade CVE-2023-25690
在最近的 Apache 升级后,我在 mod_rewrite 中遇到了“URL 中包含空格”的问题。 2023-04-25 - 升级 apache2:amd64 2.4.38-3+deb10u9 → 2.4.38-3+deb10u10
包含“空格”且已被替换为 %20 的 URL 开始被 Apache 返回 403 错误。
我发现此次更新实际上是为了修复以下问题: https://github.com/apache/httpd/commit/d78a166fedd9d02c23e4b71d5f53bd9b2c4b9a51
(https://security-tracker.debian.org/tracker/CVE-2023-25690 )
在 Ubuntu 下最近的 Apache 升级后,我通过在域配置文件的末尾添加 [NC,L,B,BNP] 解决了返回 403 的问题,并且它对我有效。
RewriteEngine On
RewriteBase /
RewriteRule ^([^/])/([^/])$ /index.php?lang=$1&page=$2 [NC,L,B,BNP]

希望这个修复对某些人有所帮助 :-)