Skip to content

Conversation

kingthorin
Copy link
Member

Overview

  • CHANGELOG > Add note.
  • CharsetMismatchScanRule > Add example alerts, adjust handling, some minor related clean code changes.
  • CharsetMismatchScanRuleUnitTest > Add test to assert the example details, use parameterized case where practical.
  • Messages.properties > Clarify one of the descriptions.

Related Issues

@psiinon
Copy link
Member

psiinon commented Jun 30, 2025

Logo
Checkmarx One – Scan Summary & Detailsa55f1d5c-6d59-4c1d-9a46-92771a4e4db2

Great job! No new security vulnerabilities introduced in this pull request


Use @Checkmarx to reach out to us for assistance.

Just send a PR comment with @Checkmarx followed by a natural language request.

Examples: @Checkmarx how are you able to help me? @Checkmarx rescan this PR

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.
Copy link
Member Author

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executive decision: Dropping 😀

@kingthorin kingthorin force-pushed the charset-examples branch 3 times, most recently from f78f727 to 74a1df3 Compare June 30, 2025 12:33
@kingthorin kingthorin requested a review from Copilot July 21, 2025 00:42
Copy link

@Copilot Copilot AI left a 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<>();

@kingthorin
Copy link
Member Author

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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants