Skip to content

Commit 3333e7d

Browse files
committed
Java SSRF query: sanitize primitives
Even 'char' isn't a realistic vector for an exploit, unless somebody is copying out a string char by char.
1 parent 93a9f47 commit 3333e7d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

java/ql/src/Security/CWE/CWE-918/RequestForgery.qll

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,10 @@ private class SpringRestTemplateUrlMethods extends Method {
199199
/** A sanitizer for request forgery vulnerabilities. */
200200
abstract class RequestForgerySanitizer extends DataFlow::Node { }
201201

202+
private class PrimitiveSanitizer extends RequestForgerySanitizer {
203+
PrimitiveSanitizer() { this.getType() instanceof PrimitiveType }
204+
}
205+
202206
private class HostnameSanitizingPrefix extends CompileTimeConstantExpr {
203207
int offset;
204208

0 commit comments

Comments
 (0)