File tree Expand file tree Collapse file tree 2 files changed +24
-3
lines changed
Expand file tree Collapse file tree 2 files changed +24
-3
lines changed Original file line number Diff line number Diff line change @@ -298,6 +298,11 @@ module HTTP {
298298 * extend `RequestInputAccess::Range` instead.
299299 */
300300 class RequestInputAccess extends DataFlow:: Node instanceof RequestInputAccess:: Range {
301+ /**
302+ * Gets a string that describes the type of this input.
303+ *
304+ * This is typically the name of the method that gives rise to this input.
305+ */
301306 string getSourceType ( ) { result = super .getSourceType ( ) }
302307 }
303308
@@ -310,6 +315,11 @@ module HTTP {
310315 * extend `RequestInputAccess` instead.
311316 */
312317 abstract class Range extends DataFlow:: Node {
318+ /**
319+ * Gets a string that describes the type of this input.
320+ *
321+ * This is typically the name of the method that gives rise to this input.
322+ */
313323 abstract string getSourceType ( ) ;
314324 }
315325 }
Original file line number Diff line number Diff line change @@ -9,6 +9,11 @@ import codeql.ruby.DataFlow
99import codeql.ruby.dataflow.RemoteFlowSources
1010import codeql.ruby.Concepts
1111
12+ /**
13+ * Provides default sources, sinks and sanitizers for reasoning about
14+ * writing user-controlled data to files, as well as extension points
15+ * for adding your own.
16+ */
1217module HttpToFileAccess {
1318 /**
1419 * A data flow source for writing user-controlled data to files.
@@ -25,9 +30,15 @@ module HttpToFileAccess {
2530 */
2631 abstract class Sanitizer extends DataFlow:: Node { }
2732
28- /** A source of remote user input, considered as a flow source for writing user-controlled data to files. */
29- class RemoteFlowSourceAsSource extends Source {
30- RemoteFlowSourceAsSource ( ) { this instanceof RemoteFlowSource }
33+ /**
34+ * An access to a user-controlled HTTP request input, considered as a flow source for writing user-controlled data to files
35+ */
36+ private class RequestInputAccessAsSource extends Source instanceof HTTP:: Server:: RequestInputAccess {
37+ }
38+
39+ /** A response from an outgoing HTTP request, considered as a flow source for writing user-controlled data to files. */
40+ private class HttpResponseAsSource extends Source {
41+ HttpResponseAsSource ( ) { this = any ( HTTP:: Client:: Request r ) .getResponseBody ( ) }
3142 }
3243
3344 /** A sink that represents file access method (write, append) argument */
You can’t perform that action at this time.
0 commit comments