mirror of
https://github.com/github/codeql.git
synced 2026-04-28 02:05:14 +02:00
Ruby: Model sanitize ActionView helper
This commit is contained in:
@@ -38,7 +38,7 @@ private class ActionViewHtmlSafeCall extends HtmlSafeCall {
|
||||
*/
|
||||
abstract class HtmlEscapeCall extends MethodCall {
|
||||
// "h" is aliased to "html_escape" in ActiveSupport
|
||||
HtmlEscapeCall() { this.getMethodName() = ["html_escape", "html_escape_once", "h"] }
|
||||
HtmlEscapeCall() { this.getMethodName() = ["html_escape", "html_escape_once", "h", "sanitize"] }
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -75,3 +75,6 @@
|
||||
|
||||
<%# BAD: javasript_include_tag called with remote input %>
|
||||
<%= javascript_include_tag params[:url] %>
|
||||
|
||||
<%# GOOD: input is sanitized %>
|
||||
<%= sanitize(params[:comment]).html_safe %>
|
||||
|
||||
Reference in New Issue
Block a user