File tree Expand file tree Collapse file tree
python/ql/src/experimental/semmle/python Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,16 +14,35 @@ private import semmle.python.dataflow.new.RemoteFlowSources
1414private import semmle.python.dataflow.new.TaintTracking
1515private import experimental.semmle.python.Frameworks
1616
17+ /** Provides classes for modeling HTTP Header APIs. */
1718module HeaderDeclaration {
19+ /**
20+ * A data-flow node that collects functions setting HTTP Headers' content.
21+ *
22+ * Extend this class to model new APIs. If you want to refine existing API models,
23+ * extend `HeaderDeclaration` instead.
24+ */
1825 abstract class Range extends DataFlow:: Node {
19- abstract DataFlow:: Node getHeaderInputNode ( ) ;
26+ /**
27+ * Gets the argument containing the header value.
28+ */
29+ abstract DataFlow:: Node getHeaderInput ( ) ;
2030 }
2131}
2232
33+ /**
34+ * A data-flow node that collects functions setting HTTP Headers' content.
35+ *
36+ * Extend this class to model new APIs. If you want to refine existing API models,
37+ * extend `HeaderDeclaration` instead.
38+ */
2339class HeaderDeclaration extends DataFlow:: Node {
2440 HeaderDeclaration:: Range range ;
2541
2642 HeaderDeclaration ( ) { this = range }
2743
28- DataFlow:: Node getHeaderInputNode ( ) { result = range .getHeaderInputNode ( ) }
44+ /**
45+ * Gets the argument containing the header value.
46+ */
47+ DataFlow:: Node getHeaderInput ( ) { result = range .getHeaderInput ( ) }
2948}
Original file line number Diff line number Diff line change @@ -4,12 +4,15 @@ import semmle.python.dataflow.new.DataFlow
44import semmle.python.dataflow.new.TaintTracking
55import semmle.python.dataflow.new.RemoteFlowSources
66
7+ /**
8+ * A taint-tracking configuration for detecting HTTP Header injections.
9+ */
710class HeaderInjectionFlowConfig extends TaintTracking:: Configuration {
811 HeaderInjectionFlowConfig ( ) { this = "HeaderInjectionFlowConfig" }
912
1013 override predicate isSource ( DataFlow:: Node source ) { source instanceof RemoteFlowSource }
1114
1215 override predicate isSink ( DataFlow:: Node sink ) {
13- sink = any ( HeaderDeclaration headerDeclaration ) .getHeaderInputNode ( )
16+ sink = any ( HeaderDeclaration headerDeclaration ) .getHeaderInput ( )
1417 }
1518}
You can’t perform that action at this time.
0 commit comments