@@ -44,9 +44,11 @@ private class InsecureXmlSink extends Sink {
44
44
abstract class Sanitizer extends DataFlow:: Node { }
45
45
46
46
/**
47
+ * DEPRECATED: Use `XmlEntityInjection` instead.
48
+ *
47
49
* A taint-tracking configuration for untrusted user input used in XML processing.
48
50
*/
49
- class TaintTrackingConfiguration extends TaintTracking:: Configuration {
51
+ deprecated class TaintTrackingConfiguration extends TaintTracking:: Configuration {
50
52
TaintTrackingConfiguration ( ) { this = "XMLInjection" }
51
53
52
54
override predicate isSource ( DataFlow:: Node source ) { source instanceof Source }
@@ -61,6 +63,36 @@ class TaintTrackingConfiguration extends TaintTracking::Configuration {
61
63
}
62
64
}
63
65
66
+ /**
67
+ * A taint-tracking configuration for untrusted user input used in XML processing.
68
+ */
69
+ private module XmlEntityInjectionConfig implements DataFlow:: ConfigSig {
70
+ predicate isSource ( DataFlow:: Node source ) { source instanceof Source }
71
+
72
+ predicate isSink ( DataFlow:: Node sink ) { sink instanceof Sink }
73
+
74
+ predicate isBarrier ( DataFlow:: Node node ) { node instanceof Sanitizer }
75
+ }
76
+
77
+ /**
78
+ * A taint-tracking module for untrusted user input used in XML processing.
79
+ */
80
+ module XmlEntityInjection implements DataFlow:: GlobalFlowSig {
81
+ import TaintTracking:: Global< XmlEntityInjectionConfig > as Super
82
+ import Super
83
+
84
+ /**
85
+ * Holds if data can flow from `source` to `sink`.
86
+ *
87
+ * The corresponding paths are generated from the end-points and the graph
88
+ * included in the module `PathGraph`.
89
+ */
90
+ predicate flowPath ( XmlEntityInjection:: PathNode source , XmlEntityInjection:: PathNode sink ) {
91
+ Super:: flowPath ( source , sink ) and
92
+ exists ( sink .getNode ( ) .( Sink ) .getReason ( ) )
93
+ }
94
+ }
95
+
64
96
private class SimpleTypeSanitizer extends Sanitizer , SimpleTypeSanitizedExpr { }
65
97
66
98
private class GuidSanitizer extends Sanitizer , GuidSanitizedExpr { }
0 commit comments