@@ -72,6 +72,39 @@ module FileSystemAccess {
7272 }
7373}
7474
75+ /**
76+ * A data flow node that writes data to the file system access.
77+ *
78+ * Extend this class to refine existing API models. If you want to model new APIs,
79+ * extend `FileSystemWriteAccess::Range` instead.
80+ */
81+ class FileSystemWriteAccess extends FileSystemAccess {
82+ override FileSystemWriteAccess:: Range range ;
83+
84+ /**
85+ * Gets a node that represents data to be written to the file system (possibly with
86+ * some transformation happening before it is written, like JSON encoding).
87+ */
88+ DataFlow:: Node getADataNode ( ) { result = range .getADataNode ( ) }
89+ }
90+
91+ /** Provides a class for modeling new file system writes. */
92+ module FileSystemWriteAccess {
93+ /**
94+ * A data flow node that writes data to the file system access.
95+ *
96+ * Extend this class to model new APIs. If you want to refine existing API models,
97+ * extend `FileSystemWriteAccess` instead.
98+ */
99+ abstract class Range extends FileSystemAccess:: Range {
100+ /**
101+ * Gets a node that represents data to be written to the file system (possibly with
102+ * some transformation happening before it is written, like JSON encoding).
103+ */
104+ abstract DataFlow:: Node getADataNode ( ) ;
105+ }
106+ }
107+
75108/** Provides classes for modeling path-related APIs. */
76109module Path {
77110 /**
@@ -235,6 +268,35 @@ private class EncodingAdditionalTaintStep extends TaintTracking::AdditionalTaint
235268 }
236269}
237270
271+ /**
272+ * A data-flow node that logs data.
273+ *
274+ * Extend this class to refine existing API models. If you want to model new APIs,
275+ * extend `Logging::Range` instead.
276+ */
277+ class Logging extends DataFlow:: Node {
278+ Logging:: Range range ;
279+
280+ Logging ( ) { this = range }
281+
282+ /** Gets an input that is logged. */
283+ DataFlow:: Node getAnInput ( ) { result = range .getAnInput ( ) }
284+ }
285+
286+ /** Provides a class for modeling new logging mechanisms. */
287+ module Logging {
288+ /**
289+ * A data-flow node that logs data.
290+ *
291+ * Extend this class to model new APIs. If you want to refine existing API models,
292+ * extend `Logging` instead.
293+ */
294+ abstract class Range extends DataFlow:: Node {
295+ /** Gets an input that is logged. */
296+ abstract DataFlow:: Node getAnInput ( ) ;
297+ }
298+ }
299+
238300/**
239301 * A data-flow node that dynamically executes Python code.
240302 *
@@ -594,6 +656,62 @@ module HTTP {
594656 abstract DataFlow:: Node getRedirectLocation ( ) ;
595657 }
596658 }
659+
660+ /**
661+ * A data-flow node that sets a cookie in an HTTP response.
662+ *
663+ * Extend this class to refine existing API models. If you want to model new APIs,
664+ * extend `HTTP::CookieWrite::Range` instead.
665+ */
666+ class CookieWrite extends DataFlow:: Node {
667+ CookieWrite:: Range range ;
668+
669+ CookieWrite ( ) { this = range }
670+
671+ /**
672+ * Gets the argument, if any, specifying the raw cookie header.
673+ */
674+ DataFlow:: Node getHeaderArg ( ) { result = range .getHeaderArg ( ) }
675+
676+ /**
677+ * Gets the argument, if any, specifying the cookie name.
678+ */
679+ DataFlow:: Node getNameArg ( ) { result = range .getNameArg ( ) }
680+
681+ /**
682+ * Gets the argument, if any, specifying the cookie value.
683+ */
684+ DataFlow:: Node getValueArg ( ) { result = range .getValueArg ( ) }
685+ }
686+
687+ /** Provides a class for modeling new cookie writes on HTTP responses. */
688+ module CookieWrite {
689+ /**
690+ * A data-flow node that sets a cookie in an HTTP response.
691+ *
692+ * Note: we don't require that this redirect must be sent to a client (a kind of
693+ * "if a tree falls in a forest and nobody hears it" situation).
694+ *
695+ * Extend this class to model new APIs. If you want to refine existing API models,
696+ * extend `HttpResponse` instead.
697+ */
698+ abstract class Range extends DataFlow:: Node {
699+ /**
700+ * Gets the argument, if any, specifying the raw cookie header.
701+ */
702+ abstract DataFlow:: Node getHeaderArg ( ) ;
703+
704+ /**
705+ * Gets the argument, if any, specifying the cookie name.
706+ */
707+ abstract DataFlow:: Node getNameArg ( ) ;
708+
709+ /**
710+ * Gets the argument, if any, specifying the cookie value.
711+ */
712+ abstract DataFlow:: Node getValueArg ( ) ;
713+ }
714+ }
597715 }
598716}
599717
0 commit comments