File tree Expand file tree Collapse file tree
lib/semmle/python/security/dataflow Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,9 +12,11 @@ import semmle.python.dataflow.new.TaintTracking
1212import XmlBombCustomizations:: XmlBomb
1313
1414/**
15+ * DEPRECATED: Use `XmlBombFlow` module instead.
16+ *
1517 * A taint-tracking configuration for detecting "XML bomb" vulnerabilities.
1618 */
17- class Configuration extends TaintTracking:: Configuration {
19+ deprecated class Configuration extends TaintTracking:: Configuration {
1820 Configuration ( ) { this = "XmlBomb" }
1921
2022 override predicate isSource ( DataFlow:: Node source ) { source instanceof Source }
@@ -26,3 +28,14 @@ class Configuration extends TaintTracking::Configuration {
2628 node instanceof Sanitizer
2729 }
2830}
31+
32+ private module XmlBombConfig implements DataFlow:: ConfigSig {
33+ predicate isSource ( DataFlow:: Node source ) { source instanceof Source }
34+
35+ predicate isSink ( DataFlow:: Node sink ) { sink instanceof Sink }
36+
37+ predicate isBarrier ( DataFlow:: Node node ) { node instanceof Sanitizer }
38+ }
39+
40+ /** Global taint-tracking for detecting "XML bomb" vulnerabilities. */
41+ module XmlBombFlow = TaintTracking:: Global< XmlBombConfig > ;
Original file line number Diff line number Diff line change 1414
1515import python
1616import semmle.python.security.dataflow.XmlBombQuery
17- import DataFlow :: PathGraph
17+ import XmlBombFlow :: PathGraph
1818
19- from Configuration cfg , DataFlow :: PathNode source , DataFlow :: PathNode sink
20- where cfg . hasFlowPath ( source , sink )
19+ from XmlBombFlow :: PathNode source , XmlBombFlow :: PathNode sink
20+ where XmlBombFlow :: flowPath ( source , sink )
2121select sink .getNode ( ) , source , sink ,
2222 "XML parsing depends on a $@ without guarding against uncontrolled entity expansion." ,
2323 source .getNode ( ) , "user-provided value"
You can’t perform that action at this time.
0 commit comments