Skip to content

Commit 30d8dce

Browse files
committed
check that either there are no custom message interpolator configured, or there is at least one that is insecure
1 parent c3bc0d6 commit 30d8dce

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

java/ql/src/Security/CWE/CWE-094/InsecureBeanValidation.ql

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,11 @@ class BeanValidationConfig extends TaintTracking::Configuration {
8585

8686
from BeanValidationConfig cfg, DataFlow::PathNode source, DataFlow::PathNode sink
8787
where
88-
not forall(SetMessageInterpolatorCall c | c.isSafe()) and
88+
(
89+
not exists(SetMessageInterpolatorCall c)
90+
or
91+
exists(SetMessageInterpolatorCall c | not c.isSafe())
92+
) and
8993
cfg.hasFlowPath(source, sink)
9094
select sink.getNode(), source, sink,
9195
"Custom constraint error message contains unsanitized user data"

0 commit comments

Comments
 (0)