Skip to content

Commit 175d524

Browse files
committed
Ruby: rack - add Rack#Utils.parse_query summary
1 parent cc6f641 commit 175d524

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

ruby/ql/lib/codeql/ruby/frameworks/Rack.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ module Rack {
99
import rack.internal.App
1010
import rack.internal.Request
1111
import rack.internal.Response::Public as Response
12+
import rack.internal.Utils
1213

1314
/** DEPRECATED: Alias for App::AppCandidate */
1415
deprecated class AppCandidate = App::AppCandidate;
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/**
2+
* Provides modeling for the `Utils` component of the `Rack` library.
3+
*/
4+
5+
private import codeql.ruby.ApiGraphs
6+
private import codeql.ruby.dataflow.FlowSummary
7+
8+
/**
9+
* Provides modeling for the `Utils` component of the `Rack` library.
10+
*/
11+
module Utils {
12+
/** Flow summary for `Rack::Utils.parse_query`, which parses a query string. */
13+
private class ParseQuerySummary extends SummarizedCallable {
14+
ParseQuerySummary() { this = "Rack::Utils.parse_query" }
15+
16+
override MethodCall getACall() {
17+
result = API::getTopLevelMember("Rack").getMember("Utils").getAMethodCall("parse_query").asExpr().getExpr()
18+
}
19+
20+
override predicate propagatesFlowExt(string input, string output, boolean preservesValue) {
21+
input = "Argument[0]" and output = "ReturnValue" and preservesValue = false
22+
}
23+
}
24+
}

0 commit comments

Comments
 (0)