Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
社会瑞弟呀
brakeman
提交
cc66c44c
B
brakeman
项目概览
社会瑞弟呀
/
brakeman
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
B
brakeman
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
cc66c44c
编写于
8月 13, 2012
作者:
J
Justin Collins
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'select_warning_in_rails2'
Conflicts: lib/brakeman/checks/check_cross_site_scripting.rb
上级
a2fdd0fc
b9bc807f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
7 addition
and
9 deletion
+7
-9
lib/brakeman/checks/check_cross_site_scripting.rb
lib/brakeman/checks/check_cross_site_scripting.rb
+1
-5
lib/brakeman/checks/check_select_vulnerability.rb
lib/brakeman/checks/check_select_vulnerability.rb
+3
-1
test/tests/test_rails2.rb
test/tests/test_rails2.rb
+3
-3
未找到文件。
lib/brakeman/checks/check_cross_site_scripting.rb
浏览文件 @
cc66c44c
...
...
@@ -38,7 +38,7 @@ class Brakeman::CheckCrossSiteScripting < Brakeman::BaseCheck
@ignore_methods
=
Set
[
:button_to
,
:check_box
,
:content_tag
,
:escapeHTML
,
:escape_once
,
:field_field
,
:fields_for
,
:h
,
:hidden_field
,
:hidden_field
,
:hidden_field_tag
,
:image_tag
,
:label
,
:link_to
,
:mail_to
,
:radio_button
,
:link_to
,
:mail_to
,
:radio_button
,
:select
,
:submit_tag
,
:text_area
,
:text_field
,
:text_field_tag
,
:url_encode
,
:url_for
,
:will_paginate
].
merge
tracker
.
options
[
:safe_methods
]
...
...
@@ -58,10 +58,6 @@ class Brakeman::CheckCrossSiteScripting < Brakeman::BaseCheck
@known_dangerous
<<
:strip_tags
end
if
tracker
.
options
[
:rails3
]
@ignore_methods
<<
:select
end
tracker
.
each_template
do
|
name
,
template
|
@current_template
=
template
template
[
:outputs
].
each
do
|
out
|
...
...
lib/brakeman/checks/check_select_vulnerability.rb
浏览文件 @
cc66c44c
...
...
@@ -5,7 +5,7 @@ require 'brakeman/checks/base_check'
class
Brakeman::CheckSelectVulnerability
<
Brakeman
::
BaseCheck
Brakeman
::
Checks
.
add
self
@description
=
"Looks for unsafe uses of select() helper
in some versions of Rails 3.x
"
@description
=
"Looks for unsafe uses of select() helper"
def
run_check
...
...
@@ -15,6 +15,8 @@ class Brakeman::CheckSelectVulnerability < Brakeman::BaseCheck
suggested_version
=
"3.1.4"
elsif
version_between?
"3.2.0"
,
"3.2.1"
suggested_version
=
"3.2.2"
elsif
version_between?
"2.0.0"
,
"3.0.0"
suggested_version
=
"3 or use options_for_select"
else
return
end
...
...
test/tests/test_rails2.rb
浏览文件 @
cc66c44c
...
...
@@ -582,9 +582,9 @@ class Rails2Tests < Test::Unit::TestCase
def
test_select_vulnerability
assert_warning
:type
=>
:template
,
:warning_type
=>
"Cross Site Scripting"
,
:line
=>
1
,
:message
=>
"Unescaped parameter value near line 1: params[:blah]"
,
:confidence
=>
0
,
:line
=>
3
,
:message
=>
/^Upgrade\ to\ Rails\ 3\ or\ use\ options_for_se/
,
:confidence
=>
1
,
:file
=>
/not_used\.html\.erb/
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录