check that either there are no custom message interpolator configured, or there is at least one that is insecure

This commit is contained in:
Alvaro Muñoz
2020-11-11 12:53:54 +01:00
parent c3bc0d6c15
commit 30d8dce389

View File

@@ -85,7 +85,11 @@ class BeanValidationConfig extends TaintTracking::Configuration {
from BeanValidationConfig cfg, DataFlow::PathNode source, DataFlow::PathNode sink
where
not forall(SetMessageInterpolatorCall c | c.isSafe()) and
(
not exists(SetMessageInterpolatorCall c)
or
exists(SetMessageInterpolatorCall c | not c.isSafe())
) and
cfg.hasFlowPath(source, sink)
select sink.getNode(), source, sink,
"Custom constraint error message contains unsanitized user data"