@@ -13,6 +13,7 @@ import java
1313import semmle.code.java.dataflow.TaintTracking
1414import semmle.code.java.dataflow.FlowSources
1515import DataFlow:: PathGraph
16+ private import semmle.code.java.dataflow.ExternalFlow
1617
1718/**
1819 * A message interpolator Type that perform Expression Language (EL) evaluations
@@ -50,19 +51,6 @@ class SetMessageInterpolatorCall extends MethodAccess {
5051 predicate isSafe ( ) { not this .getAnArgument ( ) .getType ( ) instanceof ELMessageInterpolatorType }
5152}
5253
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-
6654/**
6755 * Taint tracking BeanValidationConfiguration describing the flow of data from user input
6856 * to the argument of a method that builds constraint error messages.
@@ -72,12 +60,7 @@ class BeanValidationConfig extends TaintTracking::Configuration {
7260
7361 override predicate isSource ( DataFlow:: Node source ) { source instanceof RemoteFlowSource }
7462
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" ) }
8164}
8265
8366from BeanValidationConfig cfg , DataFlow:: PathNode source , DataFlow:: PathNode sink
0 commit comments