-
Notifications
You must be signed in to change notification settings - Fork 8.9k
bugfix: fix deserialization failure when the XSS filter retrieved the default keyword #7596
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
Conversation
…er obtained the default keyword
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 2.x #7596 +/- ##
============================================
- Coverage 61.40% 61.38% -0.03%
Complexity 658 658
============================================
Files 1311 1310 -1
Lines 49575 49567 -8
Branches 5836 5836
============================================
- Hits 30443 30425 -18
- Misses 16412 16416 +4
- Partials 2720 2726 +6
🚀 New features to boost your workflow:
|
server/src/main/java/org/apache/seata/server/filter/XSSHttpRequestFilter.java
Outdated
Show resolved
Hide resolved
|
@slievrly PTAL |
server/src/main/java/org/apache/seata/server/filter/XSSHttpRequestFilter.java
Show resolved
Hide resolved
|
tag |
slievrly
left a comment
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.
Pls review these files:
https://github.com/apache/incubator-seata/blob/2.x/script/config-center/config.txt#L209
https://github.com/apache/incubator-seata/blob/2.x/server/src/main/resources/application.example.yml#L181
https://github.com/apache/incubator-seata/blob/2.x/server/src/main/resources/application.raft.example.yml#L157
slievrly
left a comment
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.
LGTM
… default keyword (apache#7596)
… default keyword (apache#7596)
Ⅰ. Describe what this PR did
When
xsskeywordis not explicitly specified, the default configuration will be used. Previously, the default configuration was a collection, which was converted byString.valueOf()when retrieved through the configuration class, causing deserialization to fail. This change modifies the default format from aList<String>to aString, so that when the project starts and retrieves the default configuration, deserialization will no longer fail.Modify the logic for obtaining keywords through XSSFilter: Previously, it was entirely specified by the user. If the user's configuration was incorrect or the configuration was overwritten, it might lead to the failure of security protection. After optimization, it ensures that the default xss keywords of the system are consistently effective, and at the same time, the user configuration is retained, but it is merged into the total xss keyword set in an appending manner only
Ⅱ. Does this pull request fix one issue?
fix #7595
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
When the configuration file does not specify the
xssKeyWordproperty, starting the service without any errors indicates that there is no issue.Ⅴ. Special notes for reviews