Files
codeql/java/ql/test/library-tests/dataflow/taintsources/SpringMultiPart.java
Owen Mansel-Chan ef345a3279 Java: Inline expectation should have space after $
This was a regex-find-replace from `// \$(?! )` (using a negative lookahead) to `// $ `.
2026-03-04 12:44:54 +00:00

28 lines
1006 B
Java

import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartRequest;
public class SpringMultiPart {
MultipartFile file;
private static void sink(Object o) {}
public void test() throws Exception {
sink(file.getBytes()); // $ hasRemoteValueFlow
sink(file.isEmpty()); // Safe
sink(file.getInputStream()); // $ hasRemoteValueFlow
sink(file.getResource()); // $ hasRemoteValueFlow
sink(file.getName()); // $ hasRemoteValueFlow
sink(file.getContentType()); // $ hasRemoteValueFlow
sink(file.getOriginalFilename()); // $ hasRemoteValueFlow
}
public void test(MultipartRequest request) {
sink(request.getFile("name"));// $ hasRemoteValueFlow
sink(request.getFileMap());// $ hasRemoteValueFlow
sink(request.getFileNames());// $ hasRemoteValueFlow
sink(request.getFiles("name"));// $ hasRemoteValueFlow
sink(request.getMultiFileMap());// $ hasRemoteValueFlow
sink(request.getMultipartContentType("name")); // $ hasRemoteValueFlow
}
}