Skip to content

Commit a555880

Browse files
committed
java: add more tests for java/maven/non-https-url
1 parent eb6f8da commit a555880

3 files changed

Lines changed: 29 additions & 2 deletions

File tree

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
| insecure-pom.xml:19:9:24:22 | repository | Downloading or uploading artifacts over insecure protocol (eg. http or ftp) to/from repository http://insecure-repository.example |
22
| insecure-pom.xml:25:9:30:30 | snapshotRepository | Downloading or uploading artifacts over insecure protocol (eg. http or ftp) to/from repository http://insecure-repository.example |
3-
| insecure-pom.xml:33:9:38:22 | repository | Downloading or uploading artifacts over insecure protocol (eg. http or ftp) to/from repository http://insecure-repository.example |
4-
| insecure-pom.xml:41:9:46:28 | pluginRepository | Downloading or uploading artifacts over insecure protocol (eg. http or ftp) to/from repository http://insecure-repository.example |
3+
| insecure-pom.xml:31:9:36:30 | snapshotRepository | Downloading or uploading artifacts over insecure protocol (eg. http or ftp) to/from repository http://localhost.example |
4+
| insecure-pom.xml:39:9:44:22 | repository | Downloading or uploading artifacts over insecure protocol (eg. http or ftp) to/from repository http://insecure-repository.example |
5+
| insecure-pom.xml:47:9:52:28 | pluginRepository | Downloading or uploading artifacts over insecure protocol (eg. http or ftp) to/from repository http://insecure-repository.example |
6+
| secure-pom.xml:31:9:36:30 | snapshotRepository | Downloading or uploading artifacts over insecure protocol (eg. http or ftp) to/from repository http://localhost/snaphots |
7+
| secure-pom.xml:37:9:42:30 | snapshotRepository | Downloading or uploading artifacts over insecure protocol (eg. http or ftp) to/from repository http://localhost:82 |
8+
| secure-pom.xml:51:9:55:22 | repository | Downloading or uploading artifacts over insecure protocol (eg. http or ftp) to/from repository http://localhost:${deploy.webserver.port}/repo |

java/ql/test/query-tests/security/CWE-829/semmle/tests/insecure-pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@
2828
<!-- BAD! Use HTTPS -->
2929
<url>http://insecure-repository.example</url>
3030
</snapshotRepository>
31+
<snapshotRepository>
32+
<id>insecure-snapshots</id>
33+
<name>Insecure Repository Snapshots</name>
34+
<!-- BAD! Use HTTPS -->
35+
<url>http://localhost.example</url>
36+
</snapshotRepository>
3137
</distributionManagement>
3238
<repositories>
3339
<repository>

java/ql/test/query-tests/security/CWE-829/semmle/tests/secure-pom.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,18 @@
2828
<!-- GOOD! Use HTTPS -->
2929
<url>https://insecure-repository.example</url>
3030
</snapshotRepository>
31+
<snapshotRepository>
32+
<id>insecure-snapshots</id>
33+
<name>Secure Repository Snapshots</name>
34+
<!-- GOOD! Use HTTP, but for localhost -->
35+
<url>http://localhost/snaphots</url>
36+
</snapshotRepository>
37+
<snapshotRepository>
38+
<id>insecure-snapshots</id>
39+
<name>Secure Repository Snapshots</name>
40+
<!-- GOOD! Use HTTP, but for localhost -->
41+
<url>http://localhost:82</url>
42+
</snapshotRepository>
3143
</distributionManagement>
3244
<repositories>
3345
<repository>
@@ -36,6 +48,11 @@
3648
<!-- GOOD! Use HTTPS -->
3749
<url>https://insecure-repository.example</url>
3850
</repository>
51+
<repository>
52+
<id>test</id>
53+
<!-- GOOD! Use HTTP, but for localhost -->
54+
<url>http://localhost:${deploy.webserver.port}/repo</url>
55+
</repository>
3956
</repositories>
4057
<pluginRepositories>
4158
<pluginRepository>

0 commit comments

Comments
 (0)