@@ -33,6 +33,20 @@ private class DefaultPathInjectionSink extends PathInjectionSink {
3333 DefaultPathInjectionSink ( ) { sinkNode ( this , "path-injection" ) }
3434}
3535
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+
3650private class DefaultPathInjectionBarrier extends PathInjectionBarrier {
3751 DefaultPathInjectionBarrier ( ) {
3852 // This is a simplified implementation.
@@ -139,7 +153,6 @@ private class PathInjectionSinks extends SinkModelCsv {
139153 ";;false;sqlite3_filename_journal(_:);;;Argument[0];path-injection" ,
140154 ";;false;sqlite3_filename_wal(_:);;;Argument[0];path-injection" ,
141155 ";;false;sqlite3_free_filename(_:);;;Argument[0];path-injection" ,
142- ";;false;sqlite3_temp_directory;;;PostUpdate;path-injection" ,
143156 // SQLite.swift
144157 ";Connection.Location.uri;true;init(_:parameters:);;;Argument[0];path-injection" ,
145158 ";Connection;true;init(_:readonly:);;;Argument[0];path-injection" ,
0 commit comments