Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SECURITY] Fix Temporary File Information Disclosure Vulnerability #188

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.util.Random;
import java.util.Scanner;

Expand Down Expand Up @@ -72,7 +73,7 @@ public static TestConfig buildGatewayConfigAndSeedDb(int routerPort) throws IOEx
"APPLICATION_CONNECTOR_PORT", String.valueOf(30000 + (int) (Math.random() * 1000)))
.replace("ADMIN_CONNECTOR_PORT", String.valueOf(31000 + (int) (Math.random() * 1000)));

File target = File.createTempFile("config-" + System.currentTimeMillis(), "config.yaml");
File target = Files.createTempFile("config-" + System.currentTimeMillis(), "config.yaml").toFile();

FileWriter fw = new FileWriter(target);
fw.append(configStr);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import java.io.File;
import java.io.FileWriter;
import java.nio.file.Files;
import java.util.Scanner;
import javax.servlet.http.HttpServletRequest;
import org.testng.Assert;
Expand Down Expand Up @@ -83,7 +84,7 @@ public void testByRoutingRulesEngineNoMatch(String rulesConfigPath) {
}

public void testByRoutingRulesEngineFileChange() throws Exception {
File file = File.createTempFile("routing_rules", ".yml");
File file = Files.createTempFile("routing_rules", ".yml").toFile();

FileWriter fw = new FileWriter(file);
fw.write(
Expand Down