Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
CoCo_Code_Op2
brakeman
提交
ca109fc7
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,发现更多精彩内容 >>
提交
ca109fc7
编写于
6月 18, 2013
作者:
J
Justin Collins
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Re-ignore HAML escape method
上级
77f12cf3
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
18 addition
and
0 deletion
+18
-0
lib/brakeman/checks/check_cross_site_scripting.rb
lib/brakeman/checks/check_cross_site_scripting.rb
+5
-0
test/apps/rails3.1/app/views/users/interpolated_value.html.haml
...pps/rails3.1/app/views/users/interpolated_value.html.haml
+2
-0
test/tests/rails31.rb
test/tests/rails31.rb
+11
-0
未找到文件。
lib/brakeman/checks/check_cross_site_scripting.rb
浏览文件 @
ca109fc7
...
...
@@ -290,6 +290,7 @@ class Brakeman::CheckCrossSiteScripting < Brakeman::BaseCheck
safe_input_attribute?
(
target
,
method
)
or
ignored_model_method?
(
method
)
or
form_builder_method?
(
target
,
method
)
or
haml_escaped?
(
target
,
method
)
or
boolean_method?
(
method
)
or
cgi_escaped?
(
target
,
method
)
or
xml_escaped?
(
target
,
method
)
...
...
@@ -311,6 +312,10 @@ class Brakeman::CheckCrossSiteScripting < Brakeman::BaseCheck
(
target
==
URI
or
target
==
CGI
)
end
def
haml_escaped?
target
,
method
method
==
:html_escape
and
target
==
HAML_HELPERS
end
def
xml_escaped?
target
,
method
method
==
:escape_xml
and
target
==
XML_HELPER
end
...
...
test/apps/rails3.1/app/views/users/interpolated_value.html.haml
0 → 100644
浏览文件 @
ca109fc7
.escaped_thing
Hi
#{
params
[
:awesomeness
]
}
test/tests/rails31.rb
浏览文件 @
ca109fc7
...
...
@@ -806,6 +806,17 @@ class Rails31Tests < Test::Unit::TestCase
:file
=>
/json_test\.html\.erb/
end
def
test_cross_site_scripting_in_haml_interp
assert_warning
:type
=>
:template
,
:warning_code
=>
5
,
:fingerprint
=>
"56acfae7db5bda36a971702c819899043e7f62c8623223f353a1ade876454712"
,
:warning_type
=>
"Cross Site Scripting"
,
:line
=>
2
,
:message
=>
/^Unescaped\ parameter\ value/
,
:confidence
=>
2
,
:relative_path
=>
"app/views/users/interpolated_value.html.haml"
end
def
test_arel_table_in_sql
assert_no_warning
:type
=>
:warning
,
:warning_type
=>
"SQL Injection"
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录