-
-
Notifications
You must be signed in to change notification settings - Fork 750
ascanrules: Tidy up External Redirect Scan Rule #6458
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
6fe59c1 to
8001895
Compare
|
Great job! No new security vulnerabilities introduced in this pull request |
8001895 to
7d6c7ee
Compare
|
Is there any good reason for the type ints to be instantiated in the 0x## format? L85-92 |
.../ascanrules/src/main/java/org/zaproxy/zap/extension/ascanrules/ExternalRedirectScanRule.java
Outdated
Show resolved
Hide resolved
.../ascanrules/src/main/java/org/zaproxy/zap/extension/ascanrules/ExternalRedirectScanRule.java
Outdated
Show resolved
Hide resolved
|
No, and it would be better to use an enum to avoid duplication like in |
743e1f4 to
71fc43e
Compare
|
Done (I think) |
.../ascanrules/src/main/java/org/zaproxy/zap/extension/ascanrules/ExternalRedirectScanRule.java
Outdated
Show resolved
Hide resolved
|
The point of changing to enum was to also get rid of |
7268c09 to
7fe4a10
Compare
|
Got all those. |
9eee5d9 to
8949b5f
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 tidies up the ExternalRedirectScanRule functionality by refactoring the payload and redirect type handling into enums and cleaning up test code.
- Replace integer constants with enums for redirect types and payloads.
- Refactor payload injection and payload count logic with switch expressions.
- Update unit tests to use .isEmpty() instead of length checks and remove redundant assignments.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| addOns/ascanrules/src/test/java/org/zaproxy/zap/extension/ascanrules/ExternalRedirectScanRuleUnitTest.java | Refactored empty string checks and cleaned up some redundant assignments. |
| addOns/ascanrules/src/main/java/org/zaproxy/zap/extension/ascanrules/ExternalRedirectScanRule.java | Replaced integer-based redirect types with enums and refactored payload injection and alert-building logic. |
| addOns/ascanrules/CHANGELOG.md | Added a maintenance note reflecting the code improvements. |
.../ascanrules/src/main/java/org/zaproxy/zap/extension/ascanrules/ExternalRedirectScanRule.java
Show resolved
Hide resolved
| NEITHER, | ||
| ALLOW_LIST, | ||
| CONCAT_PARAM, | ||
| CONCAT_PATH |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
d9e6907 to
affee0e
Compare
7853896 to
5a1d500
Compare
d1e42de to
ca2ff06
Compare
| - SQL Injection - PostgreSQL | ||
| - The Remote OS Command Injection scan rule has been broken into two rules; one feedback based, and one time based (Issue 7341). This includes assigning the time based rule ID 90037. | ||
| - For Alerts raised by the SQL Injection scan rules the Attack field values are now simply the payload, not an assembled description. | ||
| - Maintenance changes. |
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 at the top of the list.
ca2ff06 to
93c0ed2
Compare
- CHANGELOG > Add re-ordering note. - ExternalRedirectScanRule > Use an enum for payloads & types. Move some logic to be within the payloads enum for simplicity. Move alert reference logic within the types enum. Move payload counts per Strength logic to init method and use a simplified case structure. Remove unnecessary comments. - ExternalRedirectScanRuleUnitTest > Remove unnecessary assignments. Use isEmpty vs length greater than zero. Signed-off-by: kingthorin <[email protected]>
93c0ed2 to
07531d6
Compare
|
Thank you! |

Overview
Related Issues
Checklist
./gradlew spotlessApplyfor code formatting