Skip to content

Commit 408f1c2

Browse files
committed
Clean Code
Signed-off-by: kingthorin <[email protected]>
1 parent 9678048 commit 408f1c2

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

addOns/ascanrules/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ All notable changes to this add-on will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
55

66
## Unreleased
7-
7+
### Changed
8+
- Maintenance changes.
89

910
## [72] - 2025-06-20
1011
### Added

addOns/ascanrules/src/main/java/org/zaproxy/zap/extension/ascanrules/CrossSiteScriptingScanRule.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ private void raiseAlert(int confidence, String param, HtmlContext ctx, String ot
294294
.raise();
295295
}
296296

297-
private boolean performDirectAttack(HttpMessage msg, String param, String value) {
297+
private boolean performDirectAttack(HttpMessage msg, String param) {
298298
for (String scriptAlert : GENERIC_SCRIPT_ALERT_LIST) {
299299
List<HtmlContext> contexts2 =
300300
performAttack(
@@ -322,8 +322,7 @@ private boolean performDirectAttack(HttpMessage msg, String param, String value)
322322
return false;
323323
}
324324

325-
private boolean performTagAttack(
326-
HtmlContext context, HttpMessage msg, String param, String value) {
325+
private boolean performTagAttack(HtmlContext context, HttpMessage msg, String param) {
327326

328327
if (context.isInScriptAttribute()) {
329328
// Good chance this will be vulnerable
@@ -955,7 +954,7 @@ public void scan(HttpMessage msg, String param, String value) {
955954
contexts = hca.getHtmlContexts(value + Constant.getEyeCatcher(), null, 0);
956955
}
957956
if (contexts.isEmpty()) {
958-
attackWorked = performDirectAttack(msg, param, value);
957+
attackWorked = performDirectAttack(msg, param);
959958
}
960959

961960
for (HtmlContext context : contexts) {
@@ -966,7 +965,7 @@ public void scan(HttpMessage msg, String param, String value) {
966965
}
967966
if (context.getTagAttribute() != null) {
968967
// its in a tag attribute - lots of attack vectors possible
969-
attackWorked = performTagAttack(context, msg, param, value);
968+
attackWorked = performTagAttack(context, msg, param);
970969

971970
} else if (context.isInAttributeName()) {
972971

addOns/ascanrules/src/test/java/org/zaproxy/zap/extension/ascanrules/CrossSiteScriptingScanRuleUnitTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2152,8 +2152,7 @@ protected Response serve(IHTTPSession session) {
21522152
} else {
21532153
response = getHtml("NoInput.html");
21542154
}
2155-
Response resp = newFixedLengthResponse(response);
2156-
return resp;
2155+
return newFixedLengthResponse(response);
21572156
}
21582157
});
21592158

0 commit comments

Comments
 (0)