手机版
你好,游客 登录 注册
背景:
阅读新闻

Rails 3.2.18, 4.0.5 和 4.1.1 发布,请尽快升级

[日期:2014-05-07] 来源:oschina.net   作者:Linux [字体:大 中 小]

Rails 今天发布了紧急安全更新版本,分别是 3.2.18、4.0.5 和 4.1.1,这三个版本修复了同一个安全问题:CVE-2014-0130

请 Rails 用户尽快升级!

相关阅读:

Ubuntu下Apache服务器安装以及使用Passenger插件部署Rails应用 http://www.linuxidc.com/Linux/2012-12/75230.htm

Ubuntu下搭建Ruby On Rails http://www.linuxidc.com/Linux/2012-06/61981.htm

Ruby on rails初体验系列文章:

http://www.linuxidc.com/Linux/2014-04/100245.htm
http://www.linuxidc.com/Linux/2014-04/100246.htm
http://www.linuxidc.com/Linux/2014-04/100247.htm

该漏洞详细说明:

The implicit render functionality allows controllers to render a template, even if there is no explicit action with the corresponding name. This module does not perform adequate input sanitization which could allow an attacker to use a specially crafted request to retrieve arbitrary files from the rails application server.

In order to be vulnerable an application must specifically use globbing routes[1] in combination with the :action parameter. The purpose of the route globbing feature is to allow parameters to contain characters which would otherwise be regarded as separators, for example '/' and '.'. As these characters have semantic meaning within template filenames, it is highly unlikely that applications are deliberately combining these functions.

To determine if you are vulnerable, search your application's routes files for '*action' and if you find any, use one of the work arounds below.

最简单的解决方法是不对 :action 参数使用 globbing 匹配,action 方法不能包含 / 字符,这样处理就已足够,所以请替换:

get 'my_url/*action', controller: 'asdf'

为

get 'my_url/:action', controller: 'asdf'

如果你的应用依赖于这个方法,你需要重命名 route 参数,并添加一个显式的 action:

get 'my_url/*template_path', controller: 'asdf', action: 'display'

然后显式添加带渲染器的 action

def display
if !params[:template_path].index('.')
render file: params[:template_path]
end
end

Rails 的详细介绍:请点这里
Rails 的下载地址:请点这里

本文永久更新链接地址:http://www.linuxidc.com/Linux/2014-05/101350.htm

linux
相关资讯       Rails 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款