-
-
Notifications
You must be signed in to change notification settings - Fork 738
pscanrules: Charset Mismatch add example alerts #6544
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: main
Are you sure you want to change the base?
Conversation
Great job! No new security vulnerabilities introduced in this pull requestUse @Checkmarx to reach out to us for assistance. Just send a PR comment with Examples: |
pscanrules.charsetmismatch.extrainfo.html.header_metacontentype_mismatch = There was a charset mismatch between the HTTP Header and the META content-type encoding declarations: [{0}] and [{1}] do not match. | ||
pscanrules.charsetmismatch.extrainfo.html.metacontenttype_metacharset_mismatch = There was a charset mismatch between the META charset and the META content-type encoding declaration: [{0}] and [{1}] do not match. | ||
pscanrules.charsetmismatch.extrainfo.html.no_mismatch_metacontenttype_missing = Charset is defined only by META charset, older clients that expect character set to be defined by META content-type may not correctly display this content. | ||
pscanrules.charsetmismatch.extrainfo.html.no_mismatch_metacontenttype_missing = Charset is defined only by META charset, older clients that do not expect character set to be defined by META content-type may not correctly display this content. |
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.
It's 2025 should we actually just drop this alert variant?
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.
Executive decision: Dropping 😀
f78f727
to
74a1df3
Compare
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 enhances the Charset Mismatch scan rule by adding example alert functionality for documentation generation and improving alert handling. The changes include adding example alerts for all mismatch types, implementing alert references, and removing a previously flagged variant about META content-type missing that affected older clients.
Key changes:
- Added example alert functionality and alert references to the scan rule
- Removed the "META Content-Type Charset Missing" alert variant and related functionality
- Refactored test structure to use parameterized tests and simplified test setup
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
CharsetMismatchScanRule.java | Added example alerts, alert references, refactored MismatchType enum, and removed deprecated alert variant |
CharsetMismatchScanRuleUnitTest.java | Updated tests to verify example alerts, converted to parameterized tests, and removed tests for deprecated functionality |
Messages.properties | Removed message keys for deprecated META content-type missing alert variant |
pscanrules.html | Removed documentation for deprecated META content-type missing alert |
CHANGELOG.md | Added changelog entries documenting the additions and removals |
Comments suppressed due to low confidence (1)
addOns/pscanrules/src/main/java/org/zaproxy/zap/extension/pscanrules/CharsetMismatchScanRule.java:56
- The string literal is missing the closing '\n' character. It should be 'Content-Type: text/html;charset=UTF-8\r\n'.
Map<String, String> alertTags = new HashMap<>();
74a1df3
to
0208fb4
Compare
Deconflicted |
- CHANGELOG > Add note. - CharsetMismatchScanRule > Add example alerts, adjust handling, some minor related clean code changes. Drop alert related to "older clients". - CharsetMismatchScanRuleUnitTest > Add test to assert the example details, use parameterized case where practical. - Messages.properties > Clarify one of the descriptions. - Help > Drop details related to "older clients" alert. Signed-off-by: kingthorin <[email protected]>
0208fb4
to
06bff07
Compare
Overview
Related Issues