Rails Rails 4.0.9 和 4.1.5 发布,请尽快升级

VincentJiang · 2014年08月19日 · 2759 次阅读

Rails 今天发布了两个小更新版本,分别是 4.0.9 和 4.1.5,这两个版本都修复了一个安全问题:CVE-2014-3514 建议尽快升级。

Ruby on Rails 是一个用于开发数据库驱动的网络应用程序的完整框架。Rails 基于 MVC(模型 - 视图 - 控制器)设计模式。从视图中的 Ajax 应用,到控制器中的访问请求和反馈,到封装数据库的模型,Rails 为你提供一个纯 Ruby 的开发环境。发布网站时,你只需要一个数据库和一个网络服务器即可。

Link: http://www.oschina.net/news/54550/rails_4_0_9_and_4_1_5_have_been_released

The create_with functionality in Active Record was implemented incorrectly and completely bypasses the strong parameters protection. Applications which pass user-controlled values to create_with could allow attackers to set arbitrary attributes on models. To avoid this vulnerability you will have to either remove all calls to create_with, or carefully audit your codebase to ensure it sanitizes the input first. For example you should replace code like this: user.blog_posts.create_with(params[:blog_post]).create with either: user.blog_posts.create(params[:blog_post]) or: user.blog_posts.create_with(params[:blog_post].permit(:title, :body, :etc)).create


只要在 controller 没用 create_with 的就没问题。

需要 登录 后方可回复, 如果你还没有账号请 注册新账号