Skip to content

Commit

Permalink
vuln-fix: Temporary Directory Hijacking or Information Disclosure
Browse files Browse the repository at this point in the history
This fixes either Temporary Directory Hijacking, or Temporary Directory Local Information Disclosure.

Weakness: CWE-379: Creation of Temporary File in Directory with Insecure Permissions
Severity: High
CVSSS: 7.3
Detection: CodeQL & OpenRewrite (https://public.moderne.io/recipes/org.openrewrite.java.security.UseFilesCreateTempDirectory)

Reported-by: Jonathan Leitschuh <[email protected]>
Signed-off-by: Jonathan Leitschuh <[email protected]>

Bug-tracker: JLLeitschuh/security-research#10

Co-authored-by: Moderne <[email protected]>
  • Loading branch information
JLLeitschuh and TeamModerne committed Jul 27, 2022
1 parent f03b2c5 commit 0972980
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/test/java/org/jenkinsci/plugins/sma/SMAPackageTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.junit.Test;

import java.io.File;
import java.nio.file.Files;
import java.util.Arrays;
import java.util.List;

Expand All @@ -24,9 +25,7 @@ public class SMAPackageTest
public void setUp() throws Exception
{
//Setup the fake workspace and package manifest
testWorkspace = File.createTempFile("TestWorkspace", "");
testWorkspace.delete();
testWorkspace.mkdirs();
testWorkspace = Files.createTempDirectory("TestWorkspace").toFile();
testWorkspacePath = testWorkspace.getPath();

String emptyString = "";
Expand Down

0 comments on commit 0972980

Please sign in to comment.