Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
CoCo_Code_Op2
brakeman
提交
36e35cd9
B
brakeman
项目概览
CoCo_Code_Op2
/
brakeman
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
B
brakeman
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
36e35cd9
编写于
6月 25, 2013
作者:
J
Justin Collins
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add test for duplicate XSS reporting
上级
cbb5b06a
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
39 addition
and
4 deletion
+39
-4
test/apps/rails2/app/controllers/other_controller.rb
test/apps/rails2/app/controllers/other_controller.rb
+12
-0
test/apps/rails2/app/views/layouts/thing.html.erb
test/apps/rails2/app/views/layouts/thing.html.erb
+1
-0
test/apps/rails2/app/views/other/xss_dupes.html.erb
test/apps/rails2/app/views/other/xss_dupes.html.erb
+0
-0
test/tests/rails2.rb
test/tests/rails2.rb
+26
-4
未找到文件。
test/apps/rails2/app/controllers/other_controller.rb
浏览文件 @
36e35cd9
...
...
@@ -53,4 +53,16 @@ class OtherController < ApplicationController
x
.
cool_thing?
end
def
test_xss_duplicates1
@thing
=
params
[
:thing
]
render
:xss_dupes
,
:layout
=>
'thing'
end
def
test_xss_duplicates2
@thing
=
blah
(
params
[
:other_thing
])
render
:xss_dupes
,
:layout
=>
'thing'
end
end
test/apps/rails2/app/views/layouts/thing.html.erb
0 → 100644
浏览文件 @
36e35cd9
<%=
@thing
%>
test/apps/rails2/app/views/other/xss_dupes.html.erb
0 → 100644
浏览文件 @
36e35cd9
test/tests/rails2.rb
浏览文件 @
36e35cd9
...
...
@@ -11,13 +11,13 @@ class Rails2Tests < Test::Unit::TestCase
@expected
||=
{
:controller
=>
1
,
:model
=>
3
,
:template
=>
4
4
,
:template
=>
4
5
,
:warning
=>
46
}
else
@expected
||=
{
:controller
=>
1
,
:model
=>
3
,
:template
=>
4
4
,
:template
=>
4
5
,
:warning
=>
47
}
end
end
...
...
@@ -1039,6 +1039,28 @@ class Rails2Tests < Test::Unit::TestCase
:file
=>
/_models\.html\.erb/
end
def
test_cross_site_scripting_in_layout_for_dupe
assert_warning
:type
=>
:template
,
:warning_code
=>
2
,
:fingerprint
=>
"5d9a5790dbcd6ae68a11e8cdb791a8be9585bf0f75b18ef1f763c6965f55e431"
,
:warning_type
=>
"Cross Site Scripting"
,
:line
=>
1
,
:message
=>
/^Unescaped\ parameter\ value/
,
:confidence
=>
0
,
:relative_path
=>
"app/views/layouts/thing.html.erb"
end
def
test_cross_site_scripting_in_layout_weak_dupe
assert_no_warning
:type
=>
:template
,
:warning_code
=>
5
,
:fingerprint
=>
"56fa0dc161d310062ae4717dd70515269b776fe532352e59f72ed2cdc4932153"
,
:warning_type
=>
"Cross Site Scripting"
,
:line
=>
1
,
:message
=>
/^Unescaped\ parameter\ value/
,
:confidence
=>
2
,
:relative_path
=>
"app/views/layouts/thing.html.erb"
end
def
test_dangerous_send_try
assert_warning
:type
=>
:warning
,
:warning_type
=>
"Dangerous Send"
,
...
...
@@ -1186,13 +1208,13 @@ class Rails2WithOptionsTests < Test::Unit::TestCase
@expected
||=
{
:controller
=>
1
,
:model
=>
4
,
:template
=>
4
4
,
:template
=>
4
5
,
:warning
=>
46
}
else
@expected
||=
{
:controller
=>
1
,
:model
=>
4
,
:template
=>
4
4
,
:template
=>
4
5
,
:warning
=>
47
}
end
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录