mirror of
https://github.com/github/codeql.git
synced 2026-01-30 06:42:57 +01:00
Tidy sanitizers, using instanceof not extends or a charpred where possible
This commit is contained in:
@@ -152,17 +152,13 @@ module ServerSideRequestForgery {
|
||||
* the binding function to run some validations for that field. If these binding functions returns
|
||||
* no error, then we consider these fields safe for SSRF.
|
||||
*/
|
||||
class BodySanitizer extends Sanitizer {
|
||||
BodySanitizer() { this instanceof CheckedAlphanumericStructFieldRead }
|
||||
}
|
||||
class BodySanitizer extends Sanitizer instanceof CheckedAlphanumericStructFieldRead { }
|
||||
|
||||
/**
|
||||
* The method Var of package validator is a sanitizer guard only if the check
|
||||
* of the error binding exists, and the tag to check is one of "alpha", "alphanum", "alphaunicode", "alphanumunicode", "number", "numeric".
|
||||
*/
|
||||
class ValidatorAsSanitizer extends SanitizerGuard {
|
||||
ValidatorAsSanitizer() { this instanceof ValidatorVarCheck }
|
||||
|
||||
class ValidatorAsSanitizer extends SanitizerGuard instanceof ValidatorVarCheck {
|
||||
override predicate checks(Expr e, boolean branch) { this.checks(e, branch) }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user