File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
lib/codeql/ruby/frameworks Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,21 @@ module Rails {
71
71
72
72
/** A render call that does not automatically set the HTTP response body. */
73
73
class RenderToCall extends MethodCall instanceof RenderToCallImpl { }
74
+
75
+ /**
76
+ * A `render` call seen as a file system access.
77
+ */
78
+ private class RenderAsFileSystemAccess extends FileSystemAccess:: Range , DataFlow:: CallNode {
79
+ RenderAsFileSystemAccess ( ) {
80
+ exists ( MethodCall call | this .asExpr ( ) .getExpr ( ) = call |
81
+ call instanceof RenderCall
82
+ or
83
+ call instanceof RenderToCall
84
+ )
85
+ }
86
+
87
+ override DataFlow:: Node getAPathArgument ( ) { result = this .getKeywordArgument ( "file" ) }
88
+ }
74
89
}
75
90
76
91
/**
Original file line number Diff line number Diff line change
1
+ ---
2
+ category : minorAnalysis
3
+ ---
4
+ * The ` rb/path-injection ` query now treats the ` file: ` argument of the Rails ` render ` method as a sink.
You can’t perform that action at this time.
0 commit comments