fix: mitigate CVE-2026-42945 by using named captures in rewrite (#5769)

This commit is contained in:
纯白色冰淇淋
2026-05-14 17:19:59 +08:00
committed by GitHub
parent 4322f8a3c1
commit 6834d8b2c7
+2 -2
View File
@@ -12,7 +12,7 @@ location / {
# 本地CookieCloud # 本地CookieCloud
location /cookiecloud { location /cookiecloud {
proxy_pass http://backend_api; proxy_pass http://backend_api;
rewrite ^.+mock-server/?(.*)$ /$1 break; rewrite ^.+mock-server/?(?<suffix>.*)$ /$suffix break;
proxy_http_version 1.1; proxy_http_version 1.1;
proxy_buffering off; proxy_buffering off;
proxy_cache off; proxy_cache off;
@@ -54,7 +54,7 @@ location ~ ^/api/v1/system/(message|progress/) {
# API代理配置 # API代理配置
location /api { location /api {
proxy_pass http://backend_api; proxy_pass http://backend_api;
rewrite ^.+mock-server/?(.*)$ /$1 break; rewrite ^.+mock-server/?(?<api_path>.*)$ /$api_path break;
proxy_http_version 1.1; proxy_http_version 1.1;
proxy_buffering off; proxy_buffering off;
proxy_cache off; proxy_cache off;