-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XSS protection should be set to 0 by default per updated OWASP recommendation #9631
Labels
in: web
An issue in web modules (web, webmvc)
type: breaks-passivity
A change that breaks passivity with the previous release
type: enhancement
A general enhancement
Milestone
Comments
candrews
added
status: waiting-for-triage
An issue we've not yet triaged
type: enhancement
A general enhancement
labels
Apr 13, 2021
candrews
changed the title
XSS protection should be disabled by default per update OWASP recommendation
XSS protection should be disabled by default per updated OWASP recommendation
Apr 13, 2021
rwinch
added
in: web
An issue in web modules (web, webmvc)
type: breaks-passivity
A change that breaks passivity with the previous release
and removed
status: waiting-for-triage
An issue we've not yet triaged
labels
Apr 13, 2021
Thanks for the report. Given this breaks passivity, I've assigned it for the 6.x release |
While this can be easily configured in HeadersConfigurer.xssProtection():
It is more complicated with ServerHttpSecurity.HeaderSpec.xssProtection() as the header can only be removed (instead of configured to 0 / the recommended value). |
rwinch
changed the title
XSS protection should be disabled by default per updated OWASP recommendation
XSS protection should be set to 0 by default per updated OWASP recommendation
Jun 6, 2022
Hey there 👋 I'm interested in picking this one up. |
Kehrlann
added a commit
to Kehrlann/spring-security
that referenced
this issue
Sep 30, 2022
OWASP recommends using "X-Xss-Protection: 0". The default is currently "X-Xss-Protection: 1; mode=block". In 6.0, the default will be "0". This commits adds the ability to configure the xssProtection header value in ServerHttpSecurity. This commit deprecates the use of "enabled" and "block" booleans to configure XSS protection, as the state "!enabled + block" is invalid. This impacts HttpSecurity. Issue spring-projectsgh-9631
sjohnr
pushed a commit
that referenced
this issue
Sep 30, 2022
OWASP recommends using "X-Xss-Protection: 0". The default is currently "X-Xss-Protection: 1; mode=block". In 6.0, the default will be "0". This commits adds the ability to configure the xssProtection header value in ServerHttpSecurity. This commit deprecates the use of "enabled" and "block" booleans to configure XSS protection, as the state "!enabled + block" is invalid. This impacts HttpSecurity. Issue gh-9631
Kehrlann
added a commit
to Kehrlann/spring-security
that referenced
this issue
Oct 3, 2022
sjohnr
pushed a commit
that referenced
this issue
Oct 3, 2022
sjohnr
added a commit
that referenced
this issue
Oct 3, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
in: web
An issue in web modules (web, webmvc)
type: breaks-passivity
A change that breaks passivity with the previous release
type: enhancement
A general enhancement
Expected Behavior
By default, Spring Security should send this HTTP header:
X-XSS-Protection: 0
Current Behavior
By default, Spring Security sends this HTTP header:
X-XSS-Protection: 1; mode=block
Context
OWASP has updated its recommendation regarding the
X-XSS-Protection
HTTP header.OWASP used to recommend the header be set to
1; mode=block
, which is what Spring Security does by default today. See https://docs.spring.io/spring-security/site/docs/current/reference/html5/#headers-xss-protectionHowever, they now recommend the header be set to
0
See OWASP/CheatSheetSeries#376
The text was updated successfully, but these errors were encountered: