@@ -33,6 +33,20 @@ private class DefaultPathInjectionSink extends PathInjectionSink {
33
33
DefaultPathInjectionSink ( ) { sinkNode ( this , "path-injection" ) }
34
34
}
35
35
36
+ /**
37
+ * A sink that is a write to a global variable.
38
+ */
39
+ private class GlobalVariablePathInjectionSink extends PathInjectionSink {
40
+ GlobalVariablePathInjectionSink ( ) {
41
+ // value assigned to global variable `sqlite3_temp_directory`
42
+ // the sink should be the `DeclRefExpr` itself, but we don't currently have taint flow to globals.
43
+ exists ( AssignExpr ae |
44
+ ae .getDest ( ) .( DeclRefExpr ) .getDecl ( ) .( VarDecl ) .getName ( ) = "sqlite3_temp_directory" and
45
+ ae .getSource ( ) = this .asExpr ( )
46
+ )
47
+ }
48
+ }
49
+
36
50
private class DefaultPathInjectionBarrier extends PathInjectionBarrier {
37
51
DefaultPathInjectionBarrier ( ) {
38
52
// This is a simplified implementation.
@@ -139,7 +153,6 @@ private class PathInjectionSinks extends SinkModelCsv {
139
153
";;false;sqlite3_filename_journal(_:);;;Argument[0];path-injection" ,
140
154
";;false;sqlite3_filename_wal(_:);;;Argument[0];path-injection" ,
141
155
";;false;sqlite3_free_filename(_:);;;Argument[0];path-injection" ,
142
- ";;false;sqlite3_temp_directory;;;PostUpdate;path-injection" ,
143
156
// SQLite.swift
144
157
";Connection.Location.uri;true;init(_:parameters:);;;Argument[0];path-injection" ,
145
158
";Connection;true;init(_:readonly:);;;Argument[0];path-injection" ,
0 commit comments