gpt4 book ai didi

spring-security - Spring security 中的 Xss 保护是否默认启用?

转载 作者:行者123 更新时间:2023-12-04 02:11:37 25 4
gpt4 key购买 nike

我想在我的应用程序中启用 Spring Security XSS 保护。

1)阅读文档和博客,https://spring.io/blog/2013/08/23/spring-security-3-2-0-rc1-highlights-security-headers/表示默认存在XSS

2) http://docs.spring.io/spring-security/site/docs/current/reference/html/headers.html 表示默认不存在

3)如果我在扩展 http.headers().xssProtection() 的类的配置方法中使用 WebSecurityConfigurerAdapter :这是否禁用了所有其他默认 header ?

最佳答案

除非您专门包含以下代码以禁用默认值,否则不会禁用默认值。

http.headers().defaultsDisabled()

注册点 1 和 2,我的理解是 blog 和 doc 具有相同的信息。
X-XSS-Protection: 1; mode=block

The filtering (filtering out XSS attacks) is typically enabled by default, so adding the header typically just ensures it is enabled and instructs the browser what to do when a XSS attack is detected.

关于spring-security - Spring security 中的 Xss 保护是否默认启用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37606227/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com