GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add mkdirs check · github/codeql@1b216f8

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • java/ql
    • src/Security/CWE/CWE-200
      • TempDirLocalInformationDisclosure2.ql
    • test/query-tests/security/CWE-200/semmle/tests
      • Test.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎java/ql/src/Security/CWE/CWE-200/TempDirLocalInformationDisclosure2.ql‎

Copy file name to clipboardExpand all lines: java/ql/src/Security/CWE/CWE-200/TempDirLocalInformationDisclosure2.ql
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ private class MethodFileSystemFileCreation extends Method {
1616
MethodFileSystemFileCreation() {
1717
getDeclaringType() instanceof TypeFile and
1818
(
19-
hasName("mkdir") or
19+
hasName(["mkdir", "mkdirs"]) or
2020
hasName("createNewFile")
2121
)
2222
}
Collapse file

‎java/ql/test/query-tests/security/CWE-200/semmle/tests/Test.java‎

Copy file name to clipboardExpand all lines: java/ql/test/query-tests/security/CWE-200/semmle/tests/Test.java
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ void vulnerableFileCreateTempFileMkdirTainted() {
5050
tempDirChild.mkdir();
5151
}
5252

53+
void vulnerableFileCreateTempFileMkdirsTainted() {
54+
File tempDirChild = new File(System.getProperty("java.io.tmpdir"), "/child");
55+
tempDirChild.mkdir();
56+
}
57+
5358
void vulnerableFileCreateTempFilesWrite1() {
5459
File tempDirChild = new File(System.getProperty("java.io.tmpdir"), "/child");
5560
Files.write(tempDirChild.toPath(), Arrays.asList("secret"), StandardCharsets.UTF_8, StandardOpenOption.CREATE);

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.