mirror of
https://github.com/github/codeql.git
synced 2026-05-04 13:15:21 +02:00
Merge pull request #8032 from JLLeitschuh/feat/JLL/check_os
Java: Add Guard Classes for checking OS & unify System Property Access
This commit is contained in:
@@ -6,125 +6,152 @@ edges
|
||||
| Files.java:10:33:10:68 | getProperty(...) : String | Files.java:15:17:15:23 | tempDir |
|
||||
| Files.java:14:28:14:64 | new File(...) : File | Files.java:15:17:15:23 | tempDir |
|
||||
| Files.java:14:37:14:43 | baseDir : File | Files.java:14:28:14:64 | new File(...) : File |
|
||||
| Test.java:34:24:34:69 | new File(...) : File | Test.java:37:63:37:69 | tempDir |
|
||||
| Test.java:34:33:34:68 | getProperty(...) : String | Test.java:34:24:34:69 | new File(...) : File |
|
||||
| Test.java:34:33:34:68 | getProperty(...) : String | Test.java:37:63:37:69 | tempDir |
|
||||
| Test.java:48:29:48:94 | new File(...) : File | Test.java:51:63:51:74 | tempDirChild |
|
||||
| Test.java:48:38:48:83 | new File(...) : File | Test.java:48:29:48:94 | new File(...) : File |
|
||||
| Test.java:48:38:48:83 | new File(...) : File | Test.java:51:63:51:74 | tempDirChild |
|
||||
| Test.java:48:47:48:82 | getProperty(...) : String | Test.java:48:38:48:83 | new File(...) : File |
|
||||
| Test.java:48:47:48:82 | getProperty(...) : String | Test.java:51:63:51:74 | tempDirChild |
|
||||
| Test.java:59:24:59:69 | new File(...) : File | Test.java:62:63:62:69 | tempDir |
|
||||
| Test.java:59:33:59:68 | getProperty(...) : String | Test.java:59:24:59:69 | new File(...) : File |
|
||||
| Test.java:59:33:59:68 | getProperty(...) : String | Test.java:62:63:62:69 | tempDir |
|
||||
| Test.java:73:24:73:69 | new File(...) : File | Test.java:76:63:76:69 | tempDir |
|
||||
| Test.java:73:33:73:68 | getProperty(...) : String | Test.java:73:24:73:69 | new File(...) : File |
|
||||
| Test.java:73:33:73:68 | getProperty(...) : String | Test.java:76:63:76:69 | tempDir |
|
||||
| Test.java:108:29:108:84 | new File(...) : File | Test.java:111:9:111:20 | tempDirChild |
|
||||
| Test.java:108:38:108:73 | getProperty(...) : String | Test.java:108:29:108:84 | new File(...) : File |
|
||||
| Test.java:108:38:108:73 | getProperty(...) : String | Test.java:111:9:111:20 | tempDirChild |
|
||||
| Test.java:132:29:132:84 | new File(...) : File | Test.java:135:9:135:20 | tempDirChild |
|
||||
| Test.java:132:38:132:73 | getProperty(...) : String | Test.java:132:29:132:84 | new File(...) : File |
|
||||
| Test.java:132:38:132:73 | getProperty(...) : String | Test.java:135:9:135:20 | tempDirChild |
|
||||
| Test.java:156:29:156:88 | new File(...) : File | Test.java:157:21:157:32 | tempDirChild : File |
|
||||
| Test.java:156:38:156:73 | getProperty(...) : String | Test.java:156:29:156:88 | new File(...) : File |
|
||||
| Test.java:156:38:156:73 | getProperty(...) : String | Test.java:157:21:157:32 | tempDirChild : File |
|
||||
| Test.java:157:21:157:32 | tempDirChild : File | Test.java:157:21:157:41 | toPath(...) |
|
||||
| Test.java:185:29:185:88 | new File(...) : File | Test.java:186:21:186:32 | tempDirChild : File |
|
||||
| Test.java:185:38:185:73 | getProperty(...) : String | Test.java:185:29:185:88 | new File(...) : File |
|
||||
| Test.java:185:38:185:73 | getProperty(...) : String | Test.java:186:21:186:32 | tempDirChild : File |
|
||||
| Test.java:186:21:186:32 | tempDirChild : File | Test.java:186:21:186:41 | toPath(...) |
|
||||
| Test.java:202:29:202:104 | new File(...) : File | Test.java:202:29:202:113 | toPath(...) : Path |
|
||||
| Test.java:202:29:202:113 | toPath(...) : Path | Test.java:205:33:205:44 | tempDirChild |
|
||||
| Test.java:202:38:202:73 | getProperty(...) : String | Test.java:202:29:202:104 | new File(...) : File |
|
||||
| Test.java:214:29:214:102 | new File(...) : File | Test.java:214:29:214:111 | toPath(...) : Path |
|
||||
| Test.java:214:29:214:111 | toPath(...) : Path | Test.java:217:31:217:42 | tempDirChild |
|
||||
| Test.java:214:38:214:73 | getProperty(...) : String | Test.java:214:29:214:102 | new File(...) : File |
|
||||
| Test.java:226:29:226:100 | new File(...) : File | Test.java:229:26:229:37 | tempDirChild : File |
|
||||
| Test.java:226:38:226:73 | getProperty(...) : String | Test.java:226:29:226:100 | new File(...) : File |
|
||||
| Test.java:226:38:226:73 | getProperty(...) : String | Test.java:229:26:229:37 | tempDirChild : File |
|
||||
| Test.java:229:26:229:37 | tempDirChild : File | Test.java:229:26:229:46 | toPath(...) |
|
||||
| Test.java:247:29:247:101 | new File(...) : File | Test.java:250:31:250:42 | tempDirChild : File |
|
||||
| Test.java:247:38:247:73 | getProperty(...) : String | Test.java:247:29:247:101 | new File(...) : File |
|
||||
| Test.java:247:38:247:73 | getProperty(...) : String | Test.java:250:31:250:42 | tempDirChild : File |
|
||||
| Test.java:250:31:250:42 | tempDirChild : File | Test.java:250:31:250:51 | toPath(...) |
|
||||
| Test.java:258:29:258:109 | new File(...) : File | Test.java:261:33:261:44 | tempDirChild : File |
|
||||
| Test.java:258:38:258:73 | getProperty(...) : String | Test.java:258:29:258:109 | new File(...) : File |
|
||||
| Test.java:258:38:258:73 | getProperty(...) : String | Test.java:261:33:261:44 | tempDirChild : File |
|
||||
| Test.java:261:33:261:44 | tempDirChild : File | Test.java:261:33:261:53 | toPath(...) |
|
||||
| Test.java:36:24:36:69 | new File(...) : File | Test.java:39:63:39:69 | tempDir |
|
||||
| Test.java:36:33:36:68 | getProperty(...) : String | Test.java:36:24:36:69 | new File(...) : File |
|
||||
| Test.java:36:33:36:68 | getProperty(...) : String | Test.java:39:63:39:69 | tempDir |
|
||||
| Test.java:50:29:50:94 | new File(...) : File | Test.java:53:63:53:74 | tempDirChild |
|
||||
| Test.java:50:38:50:83 | new File(...) : File | Test.java:50:29:50:94 | new File(...) : File |
|
||||
| Test.java:50:38:50:83 | new File(...) : File | Test.java:53:63:53:74 | tempDirChild |
|
||||
| Test.java:50:47:50:82 | getProperty(...) : String | Test.java:50:38:50:83 | new File(...) : File |
|
||||
| Test.java:50:47:50:82 | getProperty(...) : String | Test.java:53:63:53:74 | tempDirChild |
|
||||
| Test.java:61:24:61:69 | new File(...) : File | Test.java:64:63:64:69 | tempDir |
|
||||
| Test.java:61:33:61:68 | getProperty(...) : String | Test.java:61:24:61:69 | new File(...) : File |
|
||||
| Test.java:61:33:61:68 | getProperty(...) : String | Test.java:64:63:64:69 | tempDir |
|
||||
| Test.java:75:24:75:69 | new File(...) : File | Test.java:78:63:78:69 | tempDir |
|
||||
| Test.java:75:33:75:68 | getProperty(...) : String | Test.java:75:24:75:69 | new File(...) : File |
|
||||
| Test.java:75:33:75:68 | getProperty(...) : String | Test.java:78:63:78:69 | tempDir |
|
||||
| Test.java:110:29:110:84 | new File(...) : File | Test.java:113:9:113:20 | tempDirChild |
|
||||
| Test.java:110:38:110:73 | getProperty(...) : String | Test.java:110:29:110:84 | new File(...) : File |
|
||||
| Test.java:110:38:110:73 | getProperty(...) : String | Test.java:113:9:113:20 | tempDirChild |
|
||||
| Test.java:134:29:134:84 | new File(...) : File | Test.java:137:9:137:20 | tempDirChild |
|
||||
| Test.java:134:38:134:73 | getProperty(...) : String | Test.java:134:29:134:84 | new File(...) : File |
|
||||
| Test.java:134:38:134:73 | getProperty(...) : String | Test.java:137:9:137:20 | tempDirChild |
|
||||
| Test.java:158:29:158:88 | new File(...) : File | Test.java:159:21:159:32 | tempDirChild : File |
|
||||
| Test.java:158:38:158:73 | getProperty(...) : String | Test.java:158:29:158:88 | new File(...) : File |
|
||||
| Test.java:158:38:158:73 | getProperty(...) : String | Test.java:159:21:159:32 | tempDirChild : File |
|
||||
| Test.java:159:21:159:32 | tempDirChild : File | Test.java:159:21:159:41 | toPath(...) |
|
||||
| Test.java:187:29:187:88 | new File(...) : File | Test.java:188:21:188:32 | tempDirChild : File |
|
||||
| Test.java:187:38:187:73 | getProperty(...) : String | Test.java:187:29:187:88 | new File(...) : File |
|
||||
| Test.java:187:38:187:73 | getProperty(...) : String | Test.java:188:21:188:32 | tempDirChild : File |
|
||||
| Test.java:188:21:188:32 | tempDirChild : File | Test.java:188:21:188:41 | toPath(...) |
|
||||
| Test.java:204:29:204:104 | new File(...) : File | Test.java:204:29:204:113 | toPath(...) : Path |
|
||||
| Test.java:204:29:204:113 | toPath(...) : Path | Test.java:207:33:207:44 | tempDirChild |
|
||||
| Test.java:204:38:204:73 | getProperty(...) : String | Test.java:204:29:204:104 | new File(...) : File |
|
||||
| Test.java:216:29:216:102 | new File(...) : File | Test.java:216:29:216:111 | toPath(...) : Path |
|
||||
| Test.java:216:29:216:111 | toPath(...) : Path | Test.java:219:31:219:42 | tempDirChild |
|
||||
| Test.java:216:38:216:73 | getProperty(...) : String | Test.java:216:29:216:102 | new File(...) : File |
|
||||
| Test.java:228:29:228:100 | new File(...) : File | Test.java:231:26:231:37 | tempDirChild : File |
|
||||
| Test.java:228:38:228:73 | getProperty(...) : String | Test.java:228:29:228:100 | new File(...) : File |
|
||||
| Test.java:228:38:228:73 | getProperty(...) : String | Test.java:231:26:231:37 | tempDirChild : File |
|
||||
| Test.java:231:26:231:37 | tempDirChild : File | Test.java:231:26:231:46 | toPath(...) |
|
||||
| Test.java:249:29:249:101 | new File(...) : File | Test.java:252:31:252:42 | tempDirChild : File |
|
||||
| Test.java:249:38:249:73 | getProperty(...) : String | Test.java:249:29:249:101 | new File(...) : File |
|
||||
| Test.java:249:38:249:73 | getProperty(...) : String | Test.java:252:31:252:42 | tempDirChild : File |
|
||||
| Test.java:252:31:252:42 | tempDirChild : File | Test.java:252:31:252:51 | toPath(...) |
|
||||
| Test.java:260:29:260:109 | new File(...) : File | Test.java:263:33:263:44 | tempDirChild : File |
|
||||
| Test.java:260:38:260:73 | getProperty(...) : String | Test.java:260:29:260:109 | new File(...) : File |
|
||||
| Test.java:260:38:260:73 | getProperty(...) : String | Test.java:263:33:263:44 | tempDirChild : File |
|
||||
| Test.java:263:33:263:44 | tempDirChild : File | Test.java:263:33:263:53 | toPath(...) |
|
||||
| Test.java:294:29:294:101 | new File(...) : File | Test.java:298:35:298:46 | tempDirChild : File |
|
||||
| Test.java:294:38:294:73 | getProperty(...) : String | Test.java:294:29:294:101 | new File(...) : File |
|
||||
| Test.java:294:38:294:73 | getProperty(...) : String | Test.java:298:35:298:46 | tempDirChild : File |
|
||||
| Test.java:298:35:298:46 | tempDirChild : File | Test.java:298:35:298:55 | toPath(...) |
|
||||
| Test.java:313:29:313:101 | new File(...) : File | Test.java:316:35:316:46 | tempDirChild : File |
|
||||
| Test.java:313:38:313:73 | getProperty(...) : String | Test.java:313:29:313:101 | new File(...) : File |
|
||||
| Test.java:313:38:313:73 | getProperty(...) : String | Test.java:316:35:316:46 | tempDirChild : File |
|
||||
| Test.java:316:35:316:46 | tempDirChild : File | Test.java:316:35:316:55 | toPath(...) |
|
||||
| Test.java:322:29:322:101 | new File(...) : File | Test.java:326:35:326:46 | tempDirChild : File |
|
||||
| Test.java:322:38:322:73 | getProperty(...) : String | Test.java:322:29:322:101 | new File(...) : File |
|
||||
| Test.java:322:38:322:73 | getProperty(...) : String | Test.java:326:35:326:46 | tempDirChild : File |
|
||||
| Test.java:326:35:326:46 | tempDirChild : File | Test.java:326:35:326:55 | toPath(...) |
|
||||
nodes
|
||||
| Files.java:10:24:10:69 | new File(...) : File | semmle.label | new File(...) : File |
|
||||
| Files.java:10:33:10:68 | getProperty(...) : String | semmle.label | getProperty(...) : String |
|
||||
| Files.java:14:28:14:64 | new File(...) : File | semmle.label | new File(...) : File |
|
||||
| Files.java:14:37:14:43 | baseDir : File | semmle.label | baseDir : File |
|
||||
| Files.java:15:17:15:23 | tempDir | semmle.label | tempDir |
|
||||
| Test.java:18:25:18:61 | createTempFile(...) | semmle.label | createTempFile(...) |
|
||||
| Test.java:26:25:26:67 | createTempFile(...) | semmle.label | createTempFile(...) |
|
||||
| Test.java:34:24:34:69 | new File(...) : File | semmle.label | new File(...) : File |
|
||||
| Test.java:34:33:34:68 | getProperty(...) : String | semmle.label | getProperty(...) : String |
|
||||
| Test.java:37:63:37:69 | tempDir | semmle.label | tempDir |
|
||||
| Test.java:48:29:48:94 | new File(...) : File | semmle.label | new File(...) : File |
|
||||
| Test.java:48:38:48:83 | new File(...) : File | semmle.label | new File(...) : File |
|
||||
| Test.java:48:47:48:82 | getProperty(...) : String | semmle.label | getProperty(...) : String |
|
||||
| Test.java:51:63:51:74 | tempDirChild | semmle.label | tempDirChild |
|
||||
| Test.java:59:24:59:69 | new File(...) : File | semmle.label | new File(...) : File |
|
||||
| Test.java:59:33:59:68 | getProperty(...) : String | semmle.label | getProperty(...) : String |
|
||||
| Test.java:62:63:62:69 | tempDir | semmle.label | tempDir |
|
||||
| Test.java:73:24:73:69 | new File(...) : File | semmle.label | new File(...) : File |
|
||||
| Test.java:73:33:73:68 | getProperty(...) : String | semmle.label | getProperty(...) : String |
|
||||
| Test.java:76:63:76:69 | tempDir | semmle.label | tempDir |
|
||||
| Test.java:95:24:95:65 | createTempDir(...) | semmle.label | createTempDir(...) |
|
||||
| Test.java:108:29:108:84 | new File(...) : File | semmle.label | new File(...) : File |
|
||||
| Test.java:108:38:108:73 | getProperty(...) : String | semmle.label | getProperty(...) : String |
|
||||
| Test.java:111:9:111:20 | tempDirChild | semmle.label | tempDirChild |
|
||||
| Test.java:132:29:132:84 | new File(...) : File | semmle.label | new File(...) : File |
|
||||
| Test.java:132:38:132:73 | getProperty(...) : String | semmle.label | getProperty(...) : String |
|
||||
| Test.java:135:9:135:20 | tempDirChild | semmle.label | tempDirChild |
|
||||
| Test.java:156:29:156:88 | new File(...) : File | semmle.label | new File(...) : File |
|
||||
| Test.java:156:38:156:73 | getProperty(...) : String | semmle.label | getProperty(...) : String |
|
||||
| Test.java:157:21:157:32 | tempDirChild : File | semmle.label | tempDirChild : File |
|
||||
| Test.java:157:21:157:41 | toPath(...) | semmle.label | toPath(...) |
|
||||
| Test.java:185:29:185:88 | new File(...) : File | semmle.label | new File(...) : File |
|
||||
| Test.java:185:38:185:73 | getProperty(...) : String | semmle.label | getProperty(...) : String |
|
||||
| Test.java:186:21:186:32 | tempDirChild : File | semmle.label | tempDirChild : File |
|
||||
| Test.java:186:21:186:41 | toPath(...) | semmle.label | toPath(...) |
|
||||
| Test.java:202:29:202:104 | new File(...) : File | semmle.label | new File(...) : File |
|
||||
| Test.java:202:29:202:113 | toPath(...) : Path | semmle.label | toPath(...) : Path |
|
||||
| Test.java:202:38:202:73 | getProperty(...) : String | semmle.label | getProperty(...) : String |
|
||||
| Test.java:205:33:205:44 | tempDirChild | semmle.label | tempDirChild |
|
||||
| Test.java:214:29:214:102 | new File(...) : File | semmle.label | new File(...) : File |
|
||||
| Test.java:214:29:214:111 | toPath(...) : Path | semmle.label | toPath(...) : Path |
|
||||
| Test.java:214:38:214:73 | getProperty(...) : String | semmle.label | getProperty(...) : String |
|
||||
| Test.java:217:31:217:42 | tempDirChild | semmle.label | tempDirChild |
|
||||
| Test.java:226:29:226:100 | new File(...) : File | semmle.label | new File(...) : File |
|
||||
| Test.java:226:38:226:73 | getProperty(...) : String | semmle.label | getProperty(...) : String |
|
||||
| Test.java:229:26:229:37 | tempDirChild : File | semmle.label | tempDirChild : File |
|
||||
| Test.java:229:26:229:46 | toPath(...) | semmle.label | toPath(...) |
|
||||
| Test.java:247:29:247:101 | new File(...) : File | semmle.label | new File(...) : File |
|
||||
| Test.java:247:38:247:73 | getProperty(...) : String | semmle.label | getProperty(...) : String |
|
||||
| Test.java:250:31:250:42 | tempDirChild : File | semmle.label | tempDirChild : File |
|
||||
| Test.java:250:31:250:51 | toPath(...) | semmle.label | toPath(...) |
|
||||
| Test.java:258:29:258:109 | new File(...) : File | semmle.label | new File(...) : File |
|
||||
| Test.java:258:38:258:73 | getProperty(...) : String | semmle.label | getProperty(...) : String |
|
||||
| Test.java:261:33:261:44 | tempDirChild : File | semmle.label | tempDirChild : File |
|
||||
| Test.java:261:33:261:53 | toPath(...) | semmle.label | toPath(...) |
|
||||
| Test.java:268:25:268:63 | createTempFile(...) | semmle.label | createTempFile(...) |
|
||||
| Test.java:20:25:20:61 | createTempFile(...) | semmle.label | createTempFile(...) |
|
||||
| Test.java:28:25:28:67 | createTempFile(...) | semmle.label | createTempFile(...) |
|
||||
| Test.java:36:24:36:69 | new File(...) : File | semmle.label | new File(...) : File |
|
||||
| Test.java:36:33:36:68 | getProperty(...) : String | semmle.label | getProperty(...) : String |
|
||||
| Test.java:39:63:39:69 | tempDir | semmle.label | tempDir |
|
||||
| Test.java:50:29:50:94 | new File(...) : File | semmle.label | new File(...) : File |
|
||||
| Test.java:50:38:50:83 | new File(...) : File | semmle.label | new File(...) : File |
|
||||
| Test.java:50:47:50:82 | getProperty(...) : String | semmle.label | getProperty(...) : String |
|
||||
| Test.java:53:63:53:74 | tempDirChild | semmle.label | tempDirChild |
|
||||
| Test.java:61:24:61:69 | new File(...) : File | semmle.label | new File(...) : File |
|
||||
| Test.java:61:33:61:68 | getProperty(...) : String | semmle.label | getProperty(...) : String |
|
||||
| Test.java:64:63:64:69 | tempDir | semmle.label | tempDir |
|
||||
| Test.java:75:24:75:69 | new File(...) : File | semmle.label | new File(...) : File |
|
||||
| Test.java:75:33:75:68 | getProperty(...) : String | semmle.label | getProperty(...) : String |
|
||||
| Test.java:78:63:78:69 | tempDir | semmle.label | tempDir |
|
||||
| Test.java:97:24:97:65 | createTempDir(...) | semmle.label | createTempDir(...) |
|
||||
| Test.java:110:29:110:84 | new File(...) : File | semmle.label | new File(...) : File |
|
||||
| Test.java:110:38:110:73 | getProperty(...) : String | semmle.label | getProperty(...) : String |
|
||||
| Test.java:113:9:113:20 | tempDirChild | semmle.label | tempDirChild |
|
||||
| Test.java:134:29:134:84 | new File(...) : File | semmle.label | new File(...) : File |
|
||||
| Test.java:134:38:134:73 | getProperty(...) : String | semmle.label | getProperty(...) : String |
|
||||
| Test.java:137:9:137:20 | tempDirChild | semmle.label | tempDirChild |
|
||||
| Test.java:158:29:158:88 | new File(...) : File | semmle.label | new File(...) : File |
|
||||
| Test.java:158:38:158:73 | getProperty(...) : String | semmle.label | getProperty(...) : String |
|
||||
| Test.java:159:21:159:32 | tempDirChild : File | semmle.label | tempDirChild : File |
|
||||
| Test.java:159:21:159:41 | toPath(...) | semmle.label | toPath(...) |
|
||||
| Test.java:187:29:187:88 | new File(...) : File | semmle.label | new File(...) : File |
|
||||
| Test.java:187:38:187:73 | getProperty(...) : String | semmle.label | getProperty(...) : String |
|
||||
| Test.java:188:21:188:32 | tempDirChild : File | semmle.label | tempDirChild : File |
|
||||
| Test.java:188:21:188:41 | toPath(...) | semmle.label | toPath(...) |
|
||||
| Test.java:204:29:204:104 | new File(...) : File | semmle.label | new File(...) : File |
|
||||
| Test.java:204:29:204:113 | toPath(...) : Path | semmle.label | toPath(...) : Path |
|
||||
| Test.java:204:38:204:73 | getProperty(...) : String | semmle.label | getProperty(...) : String |
|
||||
| Test.java:207:33:207:44 | tempDirChild | semmle.label | tempDirChild |
|
||||
| Test.java:216:29:216:102 | new File(...) : File | semmle.label | new File(...) : File |
|
||||
| Test.java:216:29:216:111 | toPath(...) : Path | semmle.label | toPath(...) : Path |
|
||||
| Test.java:216:38:216:73 | getProperty(...) : String | semmle.label | getProperty(...) : String |
|
||||
| Test.java:219:31:219:42 | tempDirChild | semmle.label | tempDirChild |
|
||||
| Test.java:228:29:228:100 | new File(...) : File | semmle.label | new File(...) : File |
|
||||
| Test.java:228:38:228:73 | getProperty(...) : String | semmle.label | getProperty(...) : String |
|
||||
| Test.java:231:26:231:37 | tempDirChild : File | semmle.label | tempDirChild : File |
|
||||
| Test.java:231:26:231:46 | toPath(...) | semmle.label | toPath(...) |
|
||||
| Test.java:249:29:249:101 | new File(...) : File | semmle.label | new File(...) : File |
|
||||
| Test.java:249:38:249:73 | getProperty(...) : String | semmle.label | getProperty(...) : String |
|
||||
| Test.java:252:31:252:42 | tempDirChild : File | semmle.label | tempDirChild : File |
|
||||
| Test.java:252:31:252:51 | toPath(...) | semmle.label | toPath(...) |
|
||||
| Test.java:260:29:260:109 | new File(...) : File | semmle.label | new File(...) : File |
|
||||
| Test.java:260:38:260:73 | getProperty(...) : String | semmle.label | getProperty(...) : String |
|
||||
| Test.java:263:33:263:44 | tempDirChild : File | semmle.label | tempDirChild : File |
|
||||
| Test.java:263:33:263:53 | toPath(...) | semmle.label | toPath(...) |
|
||||
| Test.java:270:25:270:63 | createTempFile(...) | semmle.label | createTempFile(...) |
|
||||
| Test.java:294:29:294:101 | new File(...) : File | semmle.label | new File(...) : File |
|
||||
| Test.java:294:38:294:73 | getProperty(...) : String | semmle.label | getProperty(...) : String |
|
||||
| Test.java:298:35:298:46 | tempDirChild : File | semmle.label | tempDirChild : File |
|
||||
| Test.java:298:35:298:55 | toPath(...) | semmle.label | toPath(...) |
|
||||
| Test.java:313:29:313:101 | new File(...) : File | semmle.label | new File(...) : File |
|
||||
| Test.java:313:38:313:73 | getProperty(...) : String | semmle.label | getProperty(...) : String |
|
||||
| Test.java:316:35:316:46 | tempDirChild : File | semmle.label | tempDirChild : File |
|
||||
| Test.java:316:35:316:55 | toPath(...) | semmle.label | toPath(...) |
|
||||
| Test.java:322:29:322:101 | new File(...) : File | semmle.label | new File(...) : File |
|
||||
| Test.java:322:38:322:73 | getProperty(...) : String | semmle.label | getProperty(...) : String |
|
||||
| Test.java:326:35:326:46 | tempDirChild : File | semmle.label | tempDirChild : File |
|
||||
| Test.java:326:35:326:55 | toPath(...) | semmle.label | toPath(...) |
|
||||
subpaths
|
||||
#select
|
||||
| Files.java:10:33:10:68 | getProperty(...) | Files.java:10:33:10:68 | getProperty(...) : String | Files.java:15:17:15:23 | tempDir | Local information disclosure vulnerability from $@ due to use of file or directory readable by other local users. | Files.java:10:33:10:68 | getProperty(...) | system temp directory |
|
||||
| Test.java:18:25:18:61 | createTempFile(...) | Test.java:18:25:18:61 | createTempFile(...) | Test.java:18:25:18:61 | createTempFile(...) | Local information disclosure vulnerability due to use of file readable by other local users. | Test.java:18:25:18:61 | createTempFile(...) | system temp directory |
|
||||
| Test.java:26:25:26:67 | createTempFile(...) | Test.java:26:25:26:67 | createTempFile(...) | Test.java:26:25:26:67 | createTempFile(...) | Local information disclosure vulnerability due to use of file readable by other local users. | Test.java:26:25:26:67 | createTempFile(...) | system temp directory |
|
||||
| Test.java:34:33:34:68 | getProperty(...) | Test.java:34:33:34:68 | getProperty(...) : String | Test.java:37:63:37:69 | tempDir | Local information disclosure vulnerability from $@ due to use of file or directory readable by other local users. | Test.java:34:33:34:68 | getProperty(...) | system temp directory |
|
||||
| Test.java:48:47:48:82 | getProperty(...) | Test.java:48:47:48:82 | getProperty(...) : String | Test.java:51:63:51:74 | tempDirChild | Local information disclosure vulnerability from $@ due to use of file or directory readable by other local users. | Test.java:48:47:48:82 | getProperty(...) | system temp directory |
|
||||
| Test.java:59:33:59:68 | getProperty(...) | Test.java:59:33:59:68 | getProperty(...) : String | Test.java:62:63:62:69 | tempDir | Local information disclosure vulnerability from $@ due to use of file or directory readable by other local users. | Test.java:59:33:59:68 | getProperty(...) | system temp directory |
|
||||
| Test.java:73:33:73:68 | getProperty(...) | Test.java:73:33:73:68 | getProperty(...) : String | Test.java:76:63:76:69 | tempDir | Local information disclosure vulnerability from $@ due to use of file or directory readable by other local users. | Test.java:73:33:73:68 | getProperty(...) | system temp directory |
|
||||
| Test.java:95:24:95:65 | createTempDir(...) | Test.java:95:24:95:65 | createTempDir(...) | Test.java:95:24:95:65 | createTempDir(...) | Local information disclosure vulnerability due to use of directory readable by other local users. | Test.java:95:24:95:65 | createTempDir(...) | system temp directory |
|
||||
| Test.java:108:38:108:73 | getProperty(...) | Test.java:108:38:108:73 | getProperty(...) : String | Test.java:111:9:111:20 | tempDirChild | Local information disclosure vulnerability from $@ due to use of file or directory readable by other local users. | Test.java:108:38:108:73 | getProperty(...) | system temp directory |
|
||||
| Test.java:132:38:132:73 | getProperty(...) | Test.java:132:38:132:73 | getProperty(...) : String | Test.java:135:9:135:20 | tempDirChild | Local information disclosure vulnerability from $@ due to use of file or directory readable by other local users. | Test.java:132:38:132:73 | getProperty(...) | system temp directory |
|
||||
| Test.java:156:38:156:73 | getProperty(...) | Test.java:156:38:156:73 | getProperty(...) : String | Test.java:157:21:157:41 | toPath(...) | Local information disclosure vulnerability from $@ due to use of file or directory readable by other local users. | Test.java:156:38:156:73 | getProperty(...) | system temp directory |
|
||||
| Test.java:185:38:185:73 | getProperty(...) | Test.java:185:38:185:73 | getProperty(...) : String | Test.java:186:21:186:41 | toPath(...) | Local information disclosure vulnerability from $@ due to use of file or directory readable by other local users. | Test.java:185:38:185:73 | getProperty(...) | system temp directory |
|
||||
| Test.java:202:38:202:73 | getProperty(...) | Test.java:202:38:202:73 | getProperty(...) : String | Test.java:205:33:205:44 | tempDirChild | Local information disclosure vulnerability from $@ due to use of file or directory readable by other local users. | Test.java:202:38:202:73 | getProperty(...) | system temp directory |
|
||||
| Test.java:214:38:214:73 | getProperty(...) | Test.java:214:38:214:73 | getProperty(...) : String | Test.java:217:31:217:42 | tempDirChild | Local information disclosure vulnerability from $@ due to use of file or directory readable by other local users. | Test.java:214:38:214:73 | getProperty(...) | system temp directory |
|
||||
| Test.java:226:38:226:73 | getProperty(...) | Test.java:226:38:226:73 | getProperty(...) : String | Test.java:229:26:229:46 | toPath(...) | Local information disclosure vulnerability from $@ due to use of file or directory readable by other local users. | Test.java:226:38:226:73 | getProperty(...) | system temp directory |
|
||||
| Test.java:247:38:247:73 | getProperty(...) | Test.java:247:38:247:73 | getProperty(...) : String | Test.java:250:31:250:51 | toPath(...) | Local information disclosure vulnerability from $@ due to use of file or directory readable by other local users. | Test.java:247:38:247:73 | getProperty(...) | system temp directory |
|
||||
| Test.java:258:38:258:73 | getProperty(...) | Test.java:258:38:258:73 | getProperty(...) : String | Test.java:261:33:261:53 | toPath(...) | Local information disclosure vulnerability from $@ due to use of file or directory readable by other local users. | Test.java:258:38:258:73 | getProperty(...) | system temp directory |
|
||||
| Test.java:20:25:20:61 | createTempFile(...) | Test.java:20:25:20:61 | createTempFile(...) | Test.java:20:25:20:61 | createTempFile(...) | Local information disclosure vulnerability due to use of file readable by other local users. | Test.java:20:25:20:61 | createTempFile(...) | system temp directory |
|
||||
| Test.java:28:25:28:67 | createTempFile(...) | Test.java:28:25:28:67 | createTempFile(...) | Test.java:28:25:28:67 | createTempFile(...) | Local information disclosure vulnerability due to use of file readable by other local users. | Test.java:28:25:28:67 | createTempFile(...) | system temp directory |
|
||||
| Test.java:36:33:36:68 | getProperty(...) | Test.java:36:33:36:68 | getProperty(...) : String | Test.java:39:63:39:69 | tempDir | Local information disclosure vulnerability from $@ due to use of file or directory readable by other local users. | Test.java:36:33:36:68 | getProperty(...) | system temp directory |
|
||||
| Test.java:50:47:50:82 | getProperty(...) | Test.java:50:47:50:82 | getProperty(...) : String | Test.java:53:63:53:74 | tempDirChild | Local information disclosure vulnerability from $@ due to use of file or directory readable by other local users. | Test.java:50:47:50:82 | getProperty(...) | system temp directory |
|
||||
| Test.java:61:33:61:68 | getProperty(...) | Test.java:61:33:61:68 | getProperty(...) : String | Test.java:64:63:64:69 | tempDir | Local information disclosure vulnerability from $@ due to use of file or directory readable by other local users. | Test.java:61:33:61:68 | getProperty(...) | system temp directory |
|
||||
| Test.java:75:33:75:68 | getProperty(...) | Test.java:75:33:75:68 | getProperty(...) : String | Test.java:78:63:78:69 | tempDir | Local information disclosure vulnerability from $@ due to use of file or directory readable by other local users. | Test.java:75:33:75:68 | getProperty(...) | system temp directory |
|
||||
| Test.java:97:24:97:65 | createTempDir(...) | Test.java:97:24:97:65 | createTempDir(...) | Test.java:97:24:97:65 | createTempDir(...) | Local information disclosure vulnerability due to use of directory readable by other local users. | Test.java:97:24:97:65 | createTempDir(...) | system temp directory |
|
||||
| Test.java:110:38:110:73 | getProperty(...) | Test.java:110:38:110:73 | getProperty(...) : String | Test.java:113:9:113:20 | tempDirChild | Local information disclosure vulnerability from $@ due to use of file or directory readable by other local users. | Test.java:110:38:110:73 | getProperty(...) | system temp directory |
|
||||
| Test.java:134:38:134:73 | getProperty(...) | Test.java:134:38:134:73 | getProperty(...) : String | Test.java:137:9:137:20 | tempDirChild | Local information disclosure vulnerability from $@ due to use of file or directory readable by other local users. | Test.java:134:38:134:73 | getProperty(...) | system temp directory |
|
||||
| Test.java:158:38:158:73 | getProperty(...) | Test.java:158:38:158:73 | getProperty(...) : String | Test.java:159:21:159:41 | toPath(...) | Local information disclosure vulnerability from $@ due to use of file or directory readable by other local users. | Test.java:158:38:158:73 | getProperty(...) | system temp directory |
|
||||
| Test.java:187:38:187:73 | getProperty(...) | Test.java:187:38:187:73 | getProperty(...) : String | Test.java:188:21:188:41 | toPath(...) | Local information disclosure vulnerability from $@ due to use of file or directory readable by other local users. | Test.java:187:38:187:73 | getProperty(...) | system temp directory |
|
||||
| Test.java:204:38:204:73 | getProperty(...) | Test.java:204:38:204:73 | getProperty(...) : String | Test.java:207:33:207:44 | tempDirChild | Local information disclosure vulnerability from $@ due to use of file or directory readable by other local users. | Test.java:204:38:204:73 | getProperty(...) | system temp directory |
|
||||
| Test.java:216:38:216:73 | getProperty(...) | Test.java:216:38:216:73 | getProperty(...) : String | Test.java:219:31:219:42 | tempDirChild | Local information disclosure vulnerability from $@ due to use of file or directory readable by other local users. | Test.java:216:38:216:73 | getProperty(...) | system temp directory |
|
||||
| Test.java:228:38:228:73 | getProperty(...) | Test.java:228:38:228:73 | getProperty(...) : String | Test.java:231:26:231:46 | toPath(...) | Local information disclosure vulnerability from $@ due to use of file or directory readable by other local users. | Test.java:228:38:228:73 | getProperty(...) | system temp directory |
|
||||
| Test.java:249:38:249:73 | getProperty(...) | Test.java:249:38:249:73 | getProperty(...) : String | Test.java:252:31:252:51 | toPath(...) | Local information disclosure vulnerability from $@ due to use of file or directory readable by other local users. | Test.java:249:38:249:73 | getProperty(...) | system temp directory |
|
||||
| Test.java:260:38:260:73 | getProperty(...) | Test.java:260:38:260:73 | getProperty(...) : String | Test.java:263:33:263:53 | toPath(...) | Local information disclosure vulnerability from $@ due to use of file or directory readable by other local users. | Test.java:260:38:260:73 | getProperty(...) | system temp directory |
|
||||
| Test.java:294:38:294:73 | getProperty(...) | Test.java:294:38:294:73 | getProperty(...) : String | Test.java:298:35:298:55 | toPath(...) | Local information disclosure vulnerability from $@ due to use of file or directory readable by other local users. | Test.java:294:38:294:73 | getProperty(...) | system temp directory |
|
||||
| Test.java:313:38:313:73 | getProperty(...) | Test.java:313:38:313:73 | getProperty(...) : String | Test.java:316:35:316:55 | toPath(...) | Local information disclosure vulnerability from $@ due to use of file or directory readable by other local users. | Test.java:313:38:313:73 | getProperty(...) | system temp directory |
|
||||
| Test.java:322:38:322:73 | getProperty(...) | Test.java:322:38:322:73 | getProperty(...) : String | Test.java:326:35:326:55 | toPath(...) | Local information disclosure vulnerability from $@ due to use of file or directory readable by other local users. | Test.java:322:38:322:73 | getProperty(...) | system temp directory |
|
||||
|
||||
@@ -11,6 +11,8 @@ import java.nio.file.attribute.PosixFilePermission;
|
||||
import java.nio.file.attribute.PosixFilePermissions;
|
||||
import java.util.EnumSet;
|
||||
|
||||
import org.apache.commons.lang3.SystemUtils;
|
||||
|
||||
public class Test {
|
||||
|
||||
void vulnerableFileCreateTempFile() throws IOException {
|
||||
@@ -279,4 +281,67 @@ public class Test {
|
||||
File tempDir = new File(System.getProperty("java.io.tmpdir"));
|
||||
tempDir.mkdirs();
|
||||
}
|
||||
|
||||
void safeBecauseWindows() {
|
||||
File tempDir = new File(System.getProperty("java.io.tmpdir"), "child");
|
||||
if (System.getProperty("os.name").toLowerCase().contains("windows")) {
|
||||
tempDir.mkdir(); // Safe on windows
|
||||
}
|
||||
}
|
||||
|
||||
void vulnerableBecauseInvertedPosixCheck() throws IOException {
|
||||
// GIVEN:
|
||||
File tempDirChild = new File(System.getProperty("java.io.tmpdir"), "/child-create-directory");
|
||||
|
||||
// Oops, this check should be inverted
|
||||
if (tempDirChild.toPath().getFileSystem().supportedFileAttributeViews().contains("posix")) {
|
||||
Files.createDirectory(tempDirChild.toPath()); // Creates with permissions 'drwxr-xr-x'
|
||||
}
|
||||
}
|
||||
|
||||
void safeBecauseCheckingForWindowsVersion() throws IOException {
|
||||
// GIVEN:
|
||||
File tempDirChild = new File(System.getProperty("java.io.tmpdir"), "/child-create-directory");
|
||||
|
||||
if (SystemUtils.IS_OS_WINDOWS_10) {
|
||||
Files.createDirectory(tempDirChild.toPath());
|
||||
}
|
||||
}
|
||||
|
||||
void vulnerableBecauseCheckingForNotLinux() throws IOException {
|
||||
// GIVEN:
|
||||
File tempDirChild = new File(System.getProperty("java.io.tmpdir"), "/child-create-directory");
|
||||
|
||||
if (!SystemUtils.IS_OS_LINUX) {
|
||||
Files.createDirectory(tempDirChild.toPath());
|
||||
}
|
||||
}
|
||||
|
||||
void vulnerableBecauseInvertedFileSeparatorCheck() throws IOException {
|
||||
// GIVEN:
|
||||
File tempDirChild = new File(System.getProperty("java.io.tmpdir"), "/child-create-directory");
|
||||
|
||||
// Oops, this check should be inverted
|
||||
if (File.separatorChar != '\\') {
|
||||
Files.createDirectory(tempDirChild.toPath()); // Creates with permissions 'drwxr-xr-x'
|
||||
}
|
||||
}
|
||||
|
||||
void safeBecauseFileSeparatorCheck() throws IOException {
|
||||
// GIVEN:
|
||||
File tempDirChild = new File(System.getProperty("java.io.tmpdir"), "/child-create-directory");
|
||||
|
||||
if (File.separatorChar == '\\') {
|
||||
Files.createDirectory(tempDirChild.toPath());
|
||||
}
|
||||
}
|
||||
|
||||
void safeBecauseInvertedFileSeperatorCheck() throws IOException {
|
||||
// GIVEN:
|
||||
File tempDirChild = new File(System.getProperty("java.io.tmpdir"), "/child-create-directory");
|
||||
|
||||
if (File.separatorChar != '/') {
|
||||
Files.createDirectory(tempDirChild.toPath());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.UncheckedIOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.attribute.PosixFilePermission;
|
||||
import java.nio.file.attribute.PosixFilePermissions;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
public class TestSafe {
|
||||
/*
|
||||
* An example of a safe use of createFile or createDirectory if your code must support windows and unix-like systems.
|
||||
*/
|
||||
void exampleSafeWithWindowsSupportFile() {
|
||||
// Creating a temporary file with a non-randomly generated name
|
||||
File tempChildFile = new File(System.getProperty("java.io.tmpdir"), "/child-create-file.txt");
|
||||
createTempFile(tempChildFile.toPath()); // GOOD: Good has permissions `-rw-------`
|
||||
}
|
||||
|
||||
static void createTempFile(Path tempDirChild) {
|
||||
try {
|
||||
if (tempDirChild.getFileSystem().supportedFileAttributeViews().contains("posix")) {
|
||||
// Explicit permissions setting is only required on unix-like systems because
|
||||
// the temporary directory is shared between all users.
|
||||
// This is not necessary on Windows, each user has their own temp directory
|
||||
final EnumSet<PosixFilePermission> posixFilePermissions =
|
||||
EnumSet.of(
|
||||
PosixFilePermission.OWNER_READ,
|
||||
PosixFilePermission.OWNER_WRITE
|
||||
);
|
||||
if (!Files.exists(tempDirChild)) {
|
||||
Files.createFile(
|
||||
tempDirChild,
|
||||
PosixFilePermissions.asFileAttribute(posixFilePermissions)
|
||||
); // GOOD: Directory has permissions `-rw-------`
|
||||
} else {
|
||||
Files.setPosixFilePermissions(
|
||||
tempDirChild,
|
||||
posixFilePermissions
|
||||
); // GOOD: Good has permissions `-rw-------`, or will throw an exception if this fails
|
||||
}
|
||||
} else if (!Files.exists(tempDirChild)) {
|
||||
// On Windows, we still need to create the directory, when it doesn't already exist.
|
||||
Files.createDirectory(tempDirChild); // GOOD: Windows doesn't share the temp directory between users
|
||||
}
|
||||
} catch (IOException exception) {
|
||||
throw new UncheckedIOException("Failed to create temp file", exception);
|
||||
}
|
||||
}
|
||||
|
||||
void exampleSafeWithWindowsSupportDirectory() {
|
||||
File tempDirChildDir = new File(System.getProperty("java.io.tmpdir"), "/child-dir");
|
||||
createTempDirectories(tempDirChildDir.toPath()); // GOOD: Directory has permissions `drwx------`
|
||||
}
|
||||
|
||||
static void createTempDirectories(Path tempDirChild) {
|
||||
try {
|
||||
if (tempDirChild.getFileSystem().supportedFileAttributeViews().contains("posix")) {
|
||||
// Explicit permissions setting is only required on unix-like systems because
|
||||
// the temporary directory is shared between all users.
|
||||
// This is not necessary on Windows, each user has their own temp directory
|
||||
final EnumSet<PosixFilePermission> posixFilePermissions =
|
||||
EnumSet.of(
|
||||
PosixFilePermission.OWNER_READ,
|
||||
PosixFilePermission.OWNER_WRITE,
|
||||
PosixFilePermission.OWNER_EXECUTE
|
||||
);
|
||||
if (!Files.exists(tempDirChild)) {
|
||||
Files.createDirectories(
|
||||
tempDirChild,
|
||||
PosixFilePermissions.asFileAttribute(posixFilePermissions)
|
||||
); // GOOD: Directory has permissions `drwx------`
|
||||
} else {
|
||||
Files.setPosixFilePermissions(
|
||||
tempDirChild,
|
||||
posixFilePermissions
|
||||
); // GOOD: Good has permissions `drwx------`, or will throw an exception if this fails
|
||||
}
|
||||
} else if (!Files.exists(tempDirChild)) {
|
||||
// On Windows, we still need to create the directory, when it doesn't already exist.
|
||||
Files.createDirectories(tempDirChild); // GOOD: Windows doesn't share the temp directory between users
|
||||
}
|
||||
} catch (IOException exception) {
|
||||
throw new UncheckedIOException("Failed to create temp dir", exception);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
//semmle-extractor-options: --javac-args -cp ${testdir}/../../../../../stubs/apache-commons-lang3-3.7/
|
||||
Reference in New Issue
Block a user