mirror of
https://github.com/github/codeql.git
synced 2026-04-30 03:05:15 +02:00
Add ERB Template Injection Sink
This commit is contained in:
@@ -400,3 +400,19 @@ private class AccessLocalsKeySummary extends SummarizedCallable {
|
||||
preservesValue = true
|
||||
}
|
||||
}
|
||||
|
||||
/** A call to `render inline: foo`, considered as a ERB template rendering. */
|
||||
private class RailsTemplateRendering extends TemplateRendering::Range, DataFlow::CallNode {
|
||||
private DataFlow::Node template;
|
||||
|
||||
RailsTemplateRendering() {
|
||||
(
|
||||
this.asExpr().getExpr() instanceof Rails::RenderCall
|
||||
or
|
||||
this.asExpr().getExpr() instanceof Rails::RenderToCall
|
||||
) and
|
||||
template = this.getKeywordArgument("inline")
|
||||
}
|
||||
|
||||
override DataFlow::Node getTemplate() { result = template }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user