@@ -13,6 +13,7 @@ import java
13
13
import semmle.code.java.dataflow.TaintTracking
14
14
import semmle.code.java.dataflow.FlowSources
15
15
import DataFlow:: PathGraph
16
+ private import semmle.code.java.dataflow.ExternalFlow
16
17
17
18
/**
18
19
* A message interpolator Type that perform Expression Language (EL) evaluations
@@ -50,19 +51,6 @@ class SetMessageInterpolatorCall extends MethodAccess {
50
51
predicate isSafe ( ) { not this .getAnArgument ( ) .getType ( ) instanceof ELMessageInterpolatorType }
51
52
}
52
53
53
- /**
54
- * A method named `buildConstraintViolationWithTemplate` declared on a subtype
55
- * of `javax.validation.ConstraintValidatorContext`.
56
- */
57
- class BuildConstraintViolationWithTemplateMethod extends Method {
58
- BuildConstraintViolationWithTemplateMethod ( ) {
59
- this .getDeclaringType ( )
60
- .getASupertype * ( )
61
- .hasQualifiedName ( "javax.validation" , "ConstraintValidatorContext" ) and
62
- this .hasName ( "buildConstraintViolationWithTemplate" )
63
- }
64
- }
65
-
66
54
/**
67
55
* Taint tracking BeanValidationConfiguration describing the flow of data from user input
68
56
* to the argument of a method that builds constraint error messages.
@@ -72,12 +60,7 @@ class BeanValidationConfig extends TaintTracking::Configuration {
72
60
73
61
override predicate isSource ( DataFlow:: Node source ) { source instanceof RemoteFlowSource }
74
62
75
- override predicate isSink ( DataFlow:: Node sink ) {
76
- exists ( MethodAccess ma |
77
- ma .getMethod ( ) instanceof BuildConstraintViolationWithTemplateMethod and
78
- sink .asExpr ( ) = ma .getArgument ( 0 )
79
- )
80
- }
63
+ override predicate isSink ( DataFlow:: Node sink ) { sinkNode ( sink , "bean-validation" ) }
81
64
}
82
65
83
66
from BeanValidationConfig cfg , DataFlow:: PathNode source , DataFlow:: PathNode sink
0 commit comments