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 #8

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 @@ -14,6 +14,7 @@
import java.io.IOException;
import java.io.Serializable;
import java.io.StringWriter;
import java.nio.file.Files;
import java.util.Properties;

/**
Expand Down Expand Up @@ -84,7 +85,7 @@ public void deploy(File bundle, TaskListener listener) throws IOException, Inter
public HttpResponse doDoDeploy(StaplerRequest req) throws IOException {
// The web interface can only support uploading self-contained .ipa files,
// not .app directory bundles, so give the temporary file a .ipa suffix
File f = File.createTempFile("jenkins",".ipa");
File f = Files.createTempFile("jenkins", ".ipa").toFile();
StringWriter w = new StringWriter();
try {
req.getFileItem("ipa").write(f);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.nio.file.Files;
import java.util.Collections;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -163,7 +164,7 @@ public List<iOSDevice> call() throws IOException {
if (!Platform.isMac())
return Collections.emptyList();

File exe = File.createTempFile("ios","list");
File exe = Files.createTempFile("ios", "list").toFile();
try {
PrintStream logger = listener.getLogger();
logger.println("Listing up iOS Devices");
Expand Down