File tree Expand file tree Collapse file tree 2 files changed +39
-0
lines changed
javascript/ql/src/semmle/javascript Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -65,3 +65,27 @@ abstract class DatabaseAccess extends DataFlow::Node {
6565 /** Gets an argument to this database access that is interpreted as a query. */
6666 abstract DataFlow:: Node getAQueryArgument ( ) ;
6767}
68+
69+ /**
70+ * A data flow node that reads persistent data.
71+ */
72+ abstract class PersistentReadAccess extends DataFlow:: Node {
73+
74+ /**
75+ * Gets the corresponding persistent write, if any.
76+ */
77+ abstract PersistentWriteAccess getAWrite ( ) ;
78+
79+ }
80+
81+ /**
82+ * A data flow node that writes persistent data.
83+ */
84+ abstract class PersistentWriteAccess extends DataFlow:: Node {
85+
86+ /**
87+ * Gets the data flow node corresponding to the written value.
88+ */
89+ abstract DataFlow:: Node getValue ( ) ;
90+
91+ }
Original file line number Diff line number Diff line change @@ -232,6 +232,21 @@ module TaintTracking {
232232 }
233233 }
234234
235+ private class StorageTaintStep extends AdditionalTaintStep {
236+
237+ PersistentReadAccess read ;
238+
239+ StorageTaintStep ( ) {
240+ this = read
241+ }
242+
243+ override predicate step ( DataFlow:: Node pred , DataFlow:: Node succ ) {
244+ pred = read .getAWrite ( ) .getValue ( ) and
245+ succ = read
246+ }
247+
248+ }
249+
235250 /**
236251 * A taint propagating data flow edge caused by the builtin array functions.
237252 */
You can’t perform that action at this time.
0 commit comments