@@ -19,19 +19,40 @@ module HardcodedDataInterpretedAsCode {
19
19
* Flow states used to distinguish value-preserving flow from taint flow.
20
20
*/
21
21
module FlowState {
22
- /** Flow state used to track value-preserving flow. */
23
- DataFlow:: FlowState data ( ) { result = "data" }
22
+ /**
23
+ * Flow state used to track value-preserving flow.
24
+ * DEPRECATED: Use `Data()`
25
+ */
26
+ deprecated DataFlow:: FlowState data ( ) { result = "data" }
24
27
25
- /** Flow state used to tainted data (non-value preserving flow). */
26
- DataFlow:: FlowState taint ( ) { result = "taint" }
28
+ /**
29
+ * Flow state used to tainted data (non-value preserving flow).
30
+ * DEPRECATED: Use `Taint()`
31
+ */
32
+ deprecated DataFlow:: FlowState taint ( ) { result = "taint" }
33
+
34
+ /**
35
+ * Flow states used to distinguish value-preserving flow from taint flow.
36
+ */
37
+ newtype State =
38
+ Data ( ) or
39
+ Taint ( )
27
40
}
28
41
29
42
/**
30
43
* A data flow source for hard-coded data.
31
44
*/
32
45
abstract class Source extends DataFlow:: Node {
33
- /** Gets a flow label for which this is a source. */
34
- DataFlow:: FlowState getLabel ( ) { result = FlowState:: data ( ) }
46
+ /**
47
+ * Gets a flow label for which this is a source.
48
+ * DEPRECATED: Use `getALabel()`
49
+ */
50
+ deprecated DataFlow:: FlowState getLabel ( ) { result = FlowState:: data ( ) }
51
+
52
+ /**
53
+ * Gets a flow label for which this is a source.
54
+ */
55
+ FlowState:: State getALabel ( ) { result = FlowState:: Data ( ) }
35
56
}
36
57
37
58
/**
@@ -41,13 +62,26 @@ module HardcodedDataInterpretedAsCode {
41
62
/** Gets a description of what kind of sink this is. */
42
63
abstract string getKind ( ) ;
43
64
44
- /** Gets a flow label for which this is a sink. */
45
- DataFlow:: FlowState getLabel ( ) {
65
+ /**
66
+ * Gets a flow label for which this is a sink.
67
+ * DEPRECATED: Use `getALabel()`
68
+ */
69
+ deprecated DataFlow:: FlowState getLabel ( ) {
46
70
// We want to ignore value-flow and only consider taint-flow, since the
47
71
// source is just a hex string, and evaluating that directly will just
48
72
// cause a syntax error.
49
73
result = FlowState:: taint ( )
50
74
}
75
+
76
+ /**
77
+ * Gets a flow label for which this is a sink.
78
+ */
79
+ FlowState:: State getALabel ( ) {
80
+ // We want to ignore value-flow and only consider taint-flow, since the
81
+ // source is just a hex string, and evaluating that directly will just
82
+ // cause a syntax error.
83
+ result = FlowState:: Taint ( )
84
+ }
51
85
}
52
86
53
87
/** A sanitizer for hard-coded data. */
0 commit comments