Apache2背后的Spring Boot防火墙:恶意字符串“ //”

时间:2020-04-09 12:59:32

标签: spring-boot apache2 firewall

我正在使用Spring Boot胖罐来提供后端和静态文件。我需要让它在apache2之后运行。但是我从防火墙收到“ //”的恶意字符串错误:

org.springframework.security.web.firewall.RequestRejectedException: The request was rejected because the URL contained a potentially malicious String "//"
        at org.springframework.security.web.firewall.StrictHttpFirewall.rejectedBlacklistedUrls(StrictHttpFirewall.java:369) ~[spring-security-web-5.2.1.RELEASE.jar!/:5.2.1.RELEASE]
        at org.springframework.security.web.firewall.StrictHttpFirewall.getFirewalledRequest(StrictHttpFirewall.java:336) ~[spring-security-web-5.2.1.RELEASE.jar!/:5.2.1.RELEASE]
        at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:194) ~[spring-security-web-5.2.1.RELEASE.jar!/:5.2.1.RELEASE]
...

我的应用程序属性是:

server:
  port: 9001
  address: 127.0.0.1
  forward-headers-strategy: framework

我的apache2虚拟主机是:

<VirtualHost *:80>
   ServerName XXX

   ProxyPreserveHost on
   RequestHeader set X-Forwarded-Proto https
   RequestHeader set X-Forwarded-Port 443
   ProxyPass / http://localhost:9001/
   ProxyPassReverse / http://localhost:9001/

   RewriteEngine on
   RewriteCond %{SERVER_NAME} =XXX
   RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

其中“ XXX”是服务器名。

我在这里想念什么?我真的不想重新配置防火墙,因为我认为必须有一个解决方案而不更改它。

1 个答案:

答案 0 :(得分:0)

要回答我的问题:我忘了用以下方式更改ssl配置:

<VirtualHost *:443>
  ...
</VirtualHost>

因此,如果您遇到相同的问题,则可能是正确配置中缺少的更改。

相关问题