-
Notifications
You must be signed in to change notification settings - Fork 727
Expand file tree
/
Copy pathArchiveEntryPathTraversalCheckTest.java
More file actions
64 lines (57 loc) · 2.03 KB
/
ArchiveEntryPathTraversalCheckTest.java
File metadata and controls
64 lines (57 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
* SonarQube Java
* Copyright (C) SonarSource Sàrl
* mailto:info AT sonarsource DOT com
*
* You can redistribute and/or modify this program under the terms of
* the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the Sonar Source-Available License for more details.
*
* You should have received a copy of the Sonar Source-Available License
* along with this program; if not, see https://sonarsource.com/license/ssal/
*/
package org.sonar.java.checks;
import org.junit.jupiter.api.Test;
import org.sonar.java.checks.verifier.CheckVerifier;
import static org.sonar.java.checks.verifier.TestUtils.mainCodeSourcesPath;
class ArchiveEntryPathTraversalCheckTest {
@Test
void test() {
CheckVerifier.newVerifier()
.onFile(mainCodeSourcesPath("checks/ArchiveEntryPathTraversalCheckSample.java"))
.withCheck(new ArchiveEntryPathTraversalCheck())
.verifyIssues();
}
@Test
void cve_2022_4494() {
CheckVerifier.newVerifier()
.onFile(mainCodeSourcesPath("checks/CVE_2022_4494_ArchiveEntryPathTraversal.java"))
.withCheck(new ArchiveEntryPathTraversalCheck())
.verifyIssues();
}
@Test
void cve_2022_39367() {
CheckVerifier.newVerifier()
.onFile(mainCodeSourcesPath("checks/CVE_2022_39367_ArchiveEntryPathTraversal.java"))
.withCheck(new ArchiveEntryPathTraversalCheck())
.verifyIssues();
}
@Test
void cve_2022_31194() {
CheckVerifier.newVerifier()
.onFile(mainCodeSourcesPath("checks/CVE_2022_31194_RequestPathTraversal.java"))
.withCheck(new ArchiveEntryPathTraversalCheck())
.verifyIssues();
}
@Test
void cve_2022_29253() {
CheckVerifier.newVerifier()
.onFile(mainCodeSourcesPath("checks/CVE_2022_29253_ClassLoaderPathTraversal.java"))
.withCheck(new ArchiveEntryPathTraversalCheck())
.verifyIssues();
}
}