Skip to content
Merged
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
5 changes: 5 additions & 0 deletions feign-form/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@

<name>Open Feign Forms Core</name>
<dependencies>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>1.12.0</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
Expand Down
4 changes: 3 additions & 1 deletion feign-form/src/test/java/feign/form/Server.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import java.io.IOException;
import java.util.Collection;
import java.util.List;
import org.apache.commons.text.StringEscapeUtils;
import lombok.val;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.http.HttpStatus;
Expand Down Expand Up @@ -166,8 +167,9 @@
@PostMapping(path = "/upload/form_data", consumes = MULTIPART_FORM_DATA_VALUE)
public ResponseEntity<String> uploadFormData(@RequestPart("file") MultipartFile file) {
val status = file != null ? OK : I_AM_A_TEAPOT;
String sanitizedFilename = StringEscapeUtils.escapeHtml4(file.getOriginalFilename());
return ResponseEntity.status(status)
.body(file.getOriginalFilename() + ':' + file.getContentType());
.body(sanitizedFilename + ':' + file.getContentType());
Comment on lines 171 to +172

Check warning

Code scanning / CodeQL

Cross-site scripting Medium test

Cross-site scripting vulnerability due to a
user-provided value
.
Cross-site scripting vulnerability due to a
user-provided value
.

Copilot Autofix

AI 12 months ago

Copilot could not generate an autofix suggestion

Copilot could not generate an autofix suggestion for this alert. Try pushing a new commit or if the problem persists contact support.

}

@PostMapping(path = "/submit/url", consumes = APPLICATION_FORM_URLENCODED_VALUE)
Expand Down
Loading