-
Notifications
You must be signed in to change notification settings - Fork 900
ATLAS-5160: Remove deprecated X-XSS-PROTECTION header from HTTP response headers initialization and Atlas Spring Security Config #482
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
base: master
Are you sure you want to change the base?
Conversation
…nse headers initialization and Atlas Spring Security Config
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR removes the deprecated X-XSS-Protection header from Atlas HTTP responses. The X-XSS-Protection header is no longer supported by modern browsers and has been superseded by the Content-Security-Policy header.
Key Changes:
- Removed X_XSS_PROTECTION_KEY and X_XSS_PROTECTION_VAL constants from HeadersUtil
- Disabled XSS protection at the Spring Security level by adding
.xssProtection().disable()to prevent Spring Security from automatically adding the header - Updated test files to remove assertions and mock configurations related to the deprecated header
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| webapp/src/main/java/org/apache/atlas/web/filters/HeadersUtil.java | Removed X-XSS-Protection constants and removed initialization of the header in the HEADER_MAP |
| webapp/src/main/java/org/apache/atlas/web/security/AtlasSecurityConfig.java | Added .xssProtection().disable() to the Spring Security configuration to prevent automatic addition of the deprecated header |
| webapp/src/test/java/org/apache/atlas/web/filters/HeaderUtilsTest.java | Removed test assertion that validated the presence of X-XSS-Protection header |
| webapp/src/test/java/org/apache/atlas/web/security/AtlasSecurityConfigTest.java | Added mock setup for XXssConfig in both setupHttpSecurityMocksFor and setupHttpSecurityMocks methods to support the new xssProtection().disable() call chain |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| httpSecurity.authorizeRequests().anyRequest().authenticated() | ||
| .and() | ||
| .headers() | ||
| // Why disable() xssProtection -> By default Spring Security automatically adds security headers unless you disable them. No Modern Browsers support and its replaced by "Content-Security-Policy" |
Copilot
AI
Dec 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment contains a grammatical error. "No Modern Browsers support" should be "No modern browsers support" (lowercase 'm') and should say "support it" for clarity. Consider revising to: "By default Spring Security automatically adds security headers unless you disable them. No modern browsers support it and it's replaced by 'Content-Security-Policy'"
| // Why disable() xssProtection -> By default Spring Security automatically adds security headers unless you disable them. No Modern Browsers support and its replaced by "Content-Security-Policy" | |
| // Why disable() xssProtection -> By default Spring Security automatically adds security headers unless you disable them. No modern browsers support it and it's replaced by "Content-Security-Policy" |
| httpSecurity.authorizeRequests().anyRequest().authenticated() | ||
| .and() | ||
| .headers() | ||
| // Why disable() xssProtection -> By default Spring Security automatically adds security headers unless you disable them. No Modern Browsers support and its replaced by "Content-Security-Policy" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check if this comment is required here or make it precise and relevant
What changes were proposed in this pull request?
How was the patch tested?