Skip to content

Commit 9bc9d34

Browse files
committed
Fix Uncontrolled data used in path expression
1 parent d5f2233 commit 9bc9d34

File tree

1 file changed

+4
-9
lines changed
  • fj-doc-playground-quarkus/src/main/java/org/fugerit/java/doc/playground/init

1 file changed

+4
-9
lines changed

fj-doc-playground-quarkus/src/main/java/org/fugerit/java/doc/playground/init/ProjectRest.java

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,6 @@ public Response extensionsList() {
4141
);
4242
}
4343

44-
private File initConfigWorker( String base ) {
45-
String tempDir = System.getProperty("java.io.tmpdir");
46-
File outputFolder = new File( tempDir, base+"_"+ System.currentTimeMillis() );
47-
outputFolder.mkdir();
48-
log.info( "tempDir : {}, outputFolder : {}", tempDir, outputFolder);
49-
return outputFolder;
50-
}
51-
5244
@POST
5345
@Consumes(MediaType.APPLICATION_JSON)
5446
@Produces(MediaType.APPLICATION_JSON)
@@ -60,7 +52,10 @@ public Response init( @Valid ProjectInitInput data ) {
6052
String groupIdData = data.getGroupId();
6153
String artifactIdData = data.getArtifactId();
6254
try ( ByteArrayOutputStream buffer = new ByteArrayOutputStream() ) {
63-
File projectDir = this.initConfigWorker( artifactIdData );
55+
String tempDir = System.getProperty("java.io.tmpdir");
56+
File projectDir = new File( tempDir, artifactIdData+"_"+ System.currentTimeMillis() );
57+
projectDir.mkdir();
58+
log.info( "tempDir : {}, outputFolder : {}", tempDir, projectDir);
6459
checkIfInTempFolder( projectDir ); // security check
6560
File realDir = new File( projectDir, artifactIdData );
6661
checkIfInTempFolder( realDir ); // security check

0 commit comments

Comments
 (0)