File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
spring-web/src/main/java/org/springframework/web/multipart Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2018 the original author or authors.
2
+ * Copyright 2002-2021 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -53,10 +53,16 @@ public interface MultipartFile extends InputStreamSource {
53
53
* Return the original filename in the client's filesystem.
54
54
* <p>This may contain path information depending on the browser used,
55
55
* but it typically will not with any other than Opera.
56
+ * <p><strong>Note:</strong> Please keep in mind this filename is supplied
57
+ * by the client and should not be used blindly. In addition to not using
58
+ * the directory portion, the file name could also contain characters * such
59
+ * as ".." and others that can be used maliciously.
56
60
* @return the original filename, or the empty String if no file has been chosen
57
61
* in the multipart form, or {@code null} if not defined or not available
58
62
* @see org.apache.commons.fileupload.FileItem#getName()
59
63
* @see org.springframework.web.multipart.commons.CommonsMultipartFile#setPreserveFilename
64
+ * @see <a href="https://tools.ietf.org/html/rfc7578#section-4.2">RFC 7578, Section 3.4</a>
65
+ * @see <a href="https://owasp.org/www-community/vulnerabilities/Unrestricted_File_Upload">Unrestricted File Upload</a>
60
66
*/
61
67
@ Nullable
62
68
String getOriginalFilename ();
You can’t perform that action at this time.
0 commit comments