ascanrules: Reflected XSS introduce param object#6480
ascanrules: Reflected XSS introduce param object#6480kingthorin wants to merge 1 commit intozaproxy:mainfrom
Conversation
...scanrules/src/main/java/org/zaproxy/zap/extension/ascanrules/CrossSiteScriptingScanRule.java
Outdated
Show resolved
Hide resolved
...scanrules/src/main/java/org/zaproxy/zap/extension/ascanrules/CrossSiteScriptingScanRule.java
Outdated
Show resolved
Hide resolved
|
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: |
14d5a43 to
1132a0a
Compare
|
Added "clean code" commit. |
There was a problem hiding this comment.
Pull Request Overview
This pull request refactors the XSS scanning functionality to introduce a new parameter object (XssAttackParam) for improved readability and extendability, and adds an exception in HtmlContextAnalyser to prevent an infinite loop when the target parameter is empty. Key changes include:
- Adding a check in HtmlContextAnalyser to throw an exception for an empty target.
- Refactoring multiple performAttack methods in CrossSiteScriptingScanRule to use the new XssAttackParam.
- Updating the changelog with maintenance changes.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| addOns/ascanrules/src/main/java/org/zaproxy/zap/extension/ascanrules/httputils/HtmlContextAnalyser.java | Added a validation exception for an empty target parameter. |
| addOns/ascanrules/src/main/java/org/zaproxy/zap/extension/ascanrules/CrossSiteScriptingScanRule.java | Replaced overloaded performAttack methods with a unified method using XssAttackParam and applied necessary refactoring across various attack tests. |
| addOns/ascanrules/CHANGELOG.md | Updated changelog to include maintenance changes. |
...scanrules/src/main/java/org/zaproxy/zap/extension/ascanrules/CrossSiteScriptingScanRule.java
Show resolved
Hide resolved
|
Verified that the additional tests in #6638 also work here. I know this still requires attention, just making note. |
To facilitate further modifications and refactoring. - CHANGELOG > Maint note already exists. - CrossSiteScriptingScanRule > Introduce and leverage new param object. - HtmlContextAnalyser > Throw an exception if the target param is empty as that leads to an infinite loop. Signed-off-by: kingthorin <kingthorin@users.noreply.github.com> # Conflicts: # addOns/ascanrules/src/main/java/org/zaproxy/zap/extension/ascanrules/CrossSiteScriptingScanRule.java
819c2a9 to
65b204d
Compare

Overview
To facilitate further modifications and refactoring.
Related Issues