@@ -44,9 +44,11 @@ private class InsecureXmlSink extends Sink {
4444abstract class Sanitizer extends DataFlow:: Node { }
4545
4646/**
47+ * DEPRECATED: Use `XmlEntityInjection` instead.
48+ *
4749 * A taint-tracking configuration for untrusted user input used in XML processing.
4850 */
49- class TaintTrackingConfiguration extends TaintTracking:: Configuration {
51+ deprecated class TaintTrackingConfiguration extends TaintTracking:: Configuration {
5052 TaintTrackingConfiguration ( ) { this = "XMLInjection" }
5153
5254 override predicate isSource ( DataFlow:: Node source ) { source instanceof Source }
@@ -61,6 +63,36 @@ class TaintTrackingConfiguration extends TaintTracking::Configuration {
6163 }
6264}
6365
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+
6496private class SimpleTypeSanitizer extends Sanitizer , SimpleTypeSanitizedExpr { }
6597
6698private class GuidSanitizer extends Sanitizer , GuidSanitizedExpr { }
0 commit comments