Rails 3.2.2 has been released!

Riding Rails: Rails 3.2.2 has been released!

セキュリティアップデートです。

XSS

SafeBuffer#[]
x = 'foo'.html_safe 
x.html_safe?                          # => true 
x.gsub!('f', 'user input').html_safe? # => false 
x[0..-1].html_safe?                   # => true 

html_safeにしたあと[]で抜き出した文字列がhtml_safeと判断されています。


修正後はnilになるようです。

x[0..-1].html_safe?                   # => nil 

[http://groups.google.com/group/rubyonrails-security/browse_thread/thread/edd28f1e3d04e913:title=Possible XSS Security Vulnerability in SafeBuffer#[] - Ruby on Rails: Security | Google Groups]

select helper

select helperの中でoptionタグに変数を繋げて埋め込んでいる場合問題となるようです。

・回避策
before

<%= select('post', 'author_id', "<option value='#{user.id}'>#{user.name}</option>") %> 

after

<%= select('post', 'author_id', content_tag(:option, user.name, :value => user.id) %> 

・Log files are always flushed
bugfix。productionログがflushされていなかったっぽい。


・Failing tests will exit with nonzero status code


・Elimination of calls to deprecated methods


・Query cache instrumentation includes bindings in the payload


・Hidden checkbox values are not set if the value is nil


・Various Ruby 2.0 compatibility fixes
more ruby 2.0 respond_to? changes · c73f883 · rails/rails
· sstephenson/sprockets

respond_to?の引数にfalseを設定しているようです。
どうやらruby2.0では、protectedの扱いが変わるようです。

おまけ

[["tenderlove", 20],
 ["Jos&#233; Valim", 15],
 ["spastorino", 14],
 ["jonleighton", 8],
 ["fxn", 5],
 ["josevalim", 5],
 ["marten", 4],
 ["kennyj", 4],
 ["vijaydev", 3],
 ["pixeltrix", 3],
 ["lest", 3],
 ["amatsuda", 3],
 ["sikachu", 2],
 ["rafaelfranca", 2],
 ["dhh", 2],
 ["arunagw", 2],
 ["rmm5t", 2],
 ["guilleiguaran", 2],
 ["jeremy", 1],
 ["dmathieu", 1],
 ["iblue", 1],
 ["paul", 1],
 ["skult", 1],
 ["carlosantoniodasilva", 1],
 ["asanghi", 1],
 ["Tadas Tamo&#353;a...", 1],
 ["avakhov", 1],
 ["oestrich", 1],
 ["ffmike", 1],
 ["funny-falcon", 1],
 ["ckdake", 1],
 ["bsodmike", 1]]