Skip to content

Commit f580caf

Browse files
Run ./gradlew spotlessApply after all the changes
Signed-off-by: mikhail.evtikhov <[email protected]>
1 parent 054fd33 commit f580caf

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

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

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -697,19 +697,26 @@ public String match(String contents) {
697697
}
698698

699699
private String matchNixDirectories(String contents) {
700-
Pattern procPattern = Pattern.compile("(?:^|\\W)proc(?:\\W|$)", Pattern.CASE_INSENSITIVE);
700+
Pattern procPattern =
701+
Pattern.compile("(?:^|\\W)proc(?:\\W|$)", Pattern.CASE_INSENSITIVE);
701702
Pattern etcPattern = Pattern.compile("(?:^|\\W)etc(?:\\W|$)", Pattern.CASE_INSENSITIVE);
702-
Pattern bootPattern = Pattern.compile("(?:^|\\W)boot(?:\\W|$)", Pattern.CASE_INSENSITIVE);
703+
Pattern bootPattern =
704+
Pattern.compile("(?:^|\\W)boot(?:\\W|$)", Pattern.CASE_INSENSITIVE);
703705
Pattern tmpPattern = Pattern.compile("(?:^|\\W)tmp(?:\\W|$)", Pattern.CASE_INSENSITIVE);
704-
Pattern homePattern = Pattern.compile("(?:^|\\W)home(?:\\W|$)", Pattern.CASE_INSENSITIVE);
706+
Pattern homePattern =
707+
Pattern.compile("(?:^|\\W)home(?:\\W|$)", Pattern.CASE_INSENSITIVE);
705708

706709
Matcher procMatcher = procPattern.matcher(contents);
707710
Matcher etcMatcher = etcPattern.matcher(contents);
708711
Matcher bootMatcher = bootPattern.matcher(contents);
709712
Matcher tmpMatcher = tmpPattern.matcher(contents);
710713
Matcher homeMatcher = homePattern.matcher(contents);
711714

712-
if (procMatcher.find() && etcMatcher.find() && bootMatcher.find() && tmpMatcher.find() && homeMatcher.find()) {
715+
if (procMatcher.find()
716+
&& etcMatcher.find()
717+
&& bootMatcher.find()
718+
&& tmpMatcher.find()
719+
&& homeMatcher.find()) {
713720
return "etc";
714721
}
715722

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ void shouldAlertIfAttackResponseListsLinuxDirectoriesInPlainText() throws Except
202202
assertThat(alertsRaised.get(0).getAlertRef(), is(equalTo("6-3")));
203203
}
204204

205-
206205
@Test
207206
void shouldNotAlertIfAttackResponseListsHasFalsePositivePattern() throws Exception {
208207
// Given
@@ -420,8 +419,7 @@ protected String getDirs() {
420419

421420
private static class ListLinuxDirsOnAttackPlainText extends ListDirsOnAttack {
422421

423-
private static final String DIRS_LISTING =
424-
"etc root tmp bin boot dev home mnt opt proc";
422+
private static final String DIRS_LISTING = "etc root tmp bin boot dev home mnt opt proc";
425423

426424
public ListLinuxDirsOnAttackPlainText(String path, String param, String attack) {
427425
super(path, param, attack);

0 commit comments

Comments
 (0)