mirror of
https://github.com/github/codeql.git
synced 2026-05-05 13:45:19 +02:00
Add sources for Jax-RS filters
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import jakarta.ws.rs.container.ContainerRequestContext;
|
||||
|
||||
public class JakartaContainerRequestContextSources {
|
||||
void sink(Object o) {}
|
||||
|
||||
void test(ContainerRequestContext context) throws Exception {
|
||||
sink(context.getAcceptableLanguages()); // $ hasValueFlow
|
||||
sink(context.getAcceptableMediaTypes().get(0).getType()); // $ hasTaintFlow
|
||||
sink(context.getCookies().get("someKey").getValue()); // $ hasTaintFlow
|
||||
byte[] buf = new byte[1024];
|
||||
context.getEntityStream().read(buf);
|
||||
sink(buf); // $ hasTaintFlow
|
||||
sink(context.getHeaders().getFirst("someKey")); // $ hasTaintFlow
|
||||
sink(context.getHeaderString("someKey")); // $ hasValueFlow
|
||||
sink(context.getUriInfo().getPath()); // $ hasTaintFlow
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user