@@ -20,17 +20,6 @@ import semmle.code.java.dataflow.TaintTracking2
2020//import DataFlow::PathGraph
2121import github.LocalSources
2222
23- module XXELocalConfig implements DataFlow:: ConfigSig {
24- predicate isSource ( DataFlow:: Node source ) {
25- source instanceof LocalUserInput and
26- not exists ( DataFlow:: Node src | src .asExpr ( ) instanceof SafeSaxSource ) }
27-
28- predicate isSink ( DataFlow:: Node sink ) { sink instanceof UnsafeXxeSink }
29- }
30-
31- module XXELocalFlow = TaintTracking:: Global< XXELocalConfig > ;
32- import XXELocalFlow:: PathGraph
33-
3423module SafeSAXSourceFlowConfig implements DataFlow:: ConfigSig {
3524 predicate isSource ( DataFlow:: Node src ) { src .asExpr ( ) instanceof SafeSaxSource }
3625
@@ -45,13 +34,25 @@ module SafeSAXSourceFlow = TaintTracking::Global<SafeSAXSourceFlowConfig>;
4534
4635class UnsafeXxeSink extends DataFlow:: ExprNode {
4736 UnsafeXxeSink ( ) {
48- not exists ( SafeSAXSourceFlow:: flowTo ( this ) ) and
37+ not SafeSAXSourceFlow:: flowTo ( this ) and
4938 exists ( XmlParserCall parse |
5039 parse .getSink ( ) = this .getExpr ( ) and
5140 not parse .isSafe ( )
5241 )
5342 }
5443}
44+
45+ module XXELocalConfig implements DataFlow:: ConfigSig {
46+ predicate isSource ( DataFlow:: Node source ) {
47+ source instanceof LocalUserInput and
48+ not exists ( DataFlow:: Node src | src .asExpr ( ) instanceof SafeSaxSource ) }
49+
50+ predicate isSink ( DataFlow:: Node sink ) { sink instanceof UnsafeXxeSink }
51+ }
52+
53+ module XXELocalFlow = TaintTracking:: Global< XXELocalConfig > ;
54+ import XXELocalFlow:: PathGraph
55+
5556from XXELocalFlow:: PathNode source , XXELocalFlow:: PathNode sink
5657where XXELocalFlow:: flowPath ( source , sink )
5758select sink .getNode ( ) , source , sink , "Unsafe parsing of XML file from $@." , source .getNode ( ) ,
0 commit comments