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 {
7171
7272 /** A render call that does not automatically set the HTTP response body. */
7373 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+ }
7489}
7590
7691/**
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