Rails 3.0.6 has been released!
Posted by aaronp April 06, 2011 @ 12:30 AM
Hi everybody! Rails 3.0.6 has been released!
Let's get the serious business out of the way first:
Rails 3.0.6 contains an important security fix! Please upgrade!
Rails versions 3.0.x prior to 3.0.6 contain an XSS vulnerability. The
vulnerability manifests itself via the auto_link method. The auto_link
method will automatically mark input strings as "html safe" even if the input
is from an unknown origin.
For example:
<%= auto_link(params[:content]) %>
If the "content" parameter contains malicious javascript, that script will be rendered without being escaped.
How can I protect myself?
Upgrade to Rails 3.0.6, then content passed to
auto_linkwill be automatically escaped for you.If you cannot upgrade Rails, then apply the patch found here. Then
auto_linkcontent will be escaped for you.If you cannot upgrade Rails, or apply the patch, then change your calls to
auto_linkto call sanitize like so:<%= sanitize(auto_link(params[:content])) %>
If you trust the input, then change to this
<%= raw(auto_link(params[:content])) %>
Credits
Thanks go to Torben Schulz for reporting this issue!
SERIOUS BUSINESS COMPLETE
After two release candidates, we we we so excited to announce the release of Rails version 3.0.6! I want to thank everyone that tried out the release candidates and reported their feedback! I hope that we can continue soliciting feedback from the public before releasing final versions.
LOL CHANGES!!!!
For changes in a particular package, please view the CHANGELOG in each particular project on github. Even better, you can check the compare view.
Changes of note are:
The above security fix in ActionPack 61ee3449674c591747db95f9b3472c5c3bd9e84d
Un-deprecating the
reordermethod in ActiveRecord 235a4142aa3fee73faa0f01e267a2b4254cea8ceA backport of "cheaper attributes reads" in ActiveRecord 86acbf1cc050c8fa8c74a10c735e467fb6fd7df8
Correctling handling
before_type_caston timezone aware attributes 0823bbd757f3654a08d300e27873758da606f06aEscaping binary data in sqlite3 inserts 7222786c15eacbd432b2bce9798d3f3459f7e05f
Fixing schema support for the mysql adapter eb1eac93151c1d45c3ef292d99bfcf74799185ea
This change list IS NOT exhaustive. They are just some of my favorites! For the complete list please see the CHANGELOG files or view the diff on github.
GEM CHECKSUMS
If you totally want to make sure that you've got the right gems, here are my shasums before I pushed the gems!
shasum *
- fc7b0503bdf99d1ec08dc0dcee3677ca1dd29f0f actionmailer-3.0.6.gem
- e8fbefd5b0a46408dd557331700ea514a4c199ab actionpack-3.0.6.gem
- 8509520744ecd8e6712158311a16ba4782b454e2 activemodel-3.0.6.gem
- 3b392e811ba342a5bf430d89cf4f060d119aba64 activerecord-3.0.6.gem
- 9eea440bdf885e857ebfb5ff8e31119f76a18a4e activeresource-3.0.6.gem
- 175ba6286f7802edeeaab30f900d87a38f516728 activesupport-3.0.6.gem
- ebeea3c1f03db3309ea9a6640e1767ab144ff567 rails-3.0.6.gem
- 61e24f94ea87fc58175b2067f7f6a3a8c468bfe0 railties-3.0.6.gem
IN CLOSING
Thank you for waiting for me to finish vacation before I released this! I hope that everyone enjoys this bugfix release of Rails. Next time I'll try not to vacation so much! ;-)
<3 <3 <3 <3 <3

Thanks for all the hard work!
what delight =)
That post was action-packed!
I’m glad to help!!
@Brett lulz!
Good job!!
RAILS: SERIOUS BUSINESS
Great! Thanks for the hard work! :)
we we we….is that on purpose?
so fast! good job!
Thanks for the info. You should really provide a quick mention of just how exactly rails is upgraded for those who have never done it before though.
Maybe an obvious question – but if you aren’t using auto_link is there an immediate need to upgrade?
Is that function used internally by any other functions (excluding plugins/gems)?
Any chance of Decent Exposure making it for Rails 3.1? As presented by Ryan Bates (Railscast 259), it would make Rails more decoupled, drier, more beautiful, and I would bet also skinner and faster in the guts. Thumbs up for Decent Exposure!
Thanks for the hard work, Do came to Malaysia on your future vacations!! We have great ppl, food and fun!
Rails rocks!
Thanks for hard work!
That’s a lot of hearts at the end of that post…pink warrior must have been here.
Tripping balls.
Cảm ơn rất nhiều, chúc holiday vui vẻ
Thanks Torben!
The patch can be directly downloaded in .patch format here:
https://github.com/rails/rails/commit/61ee3449674c591747db95f9b3472c5c3bd9e84d.patch
before_type_cast on a datetime with 3.0.6 returns a datetime. Shouldn’t it return the string that the user entered?
Fuck yeah!
To aaronp: how about we keep the official rails announcements free of lolspeak and the excessive use of emoticons?
Who the hell gave this guy access to post on this blog? Poor show.
Alex, Adam, please go back to Java ;)
Can you please add “r0flc0pt3r” somewhere?
Agree with Adam. Announcements of releases (especially with security fixes) should be to the point and serious.
Thanks! Wee wee wee wee wee…
It is escaping a little bit too much here, or I didn’t really understand how it works. In my User page: <%= auto_link(@user.email) %>
What gets printed: user@email.com
That’s not a link, it actually is printed on the page.
If I use raw it works, though…
Well, this blog’s comment editor messed it up, what I meant is that I actually see ‘a href…/a’ on my page.
Aaron rocks, he’s been a major contributor to Rails.
I reckon he can express himself any respectful way he likes after all he’s given to the community.
Thanks, Rails team!
Good Job!!
Great!
upgraded 4 rails apps – perfect guys!! thanks a lot, Aaron & team!
@Alex, @Adam, @Thijs: please grow sense of humor. Spunkiness and fun does not detract from substance.
haha, I am number 36. congrats guys.
Great!
You guys are great, thanks for all the continued hard work.
Great job, thanks for contributing!
i first time know auto_link method , it’s so cool ~!
miguelsan, I’m personally not that big a fan of the decent exposure style. Great to see the experimentation, but I don’t foresee this going into core.
After upgrading, I’m getting “Could not load SystemTimer >= v1.2.0” on Ubuntu Ubuntu 10.04.2 LTS and OS X 10.6.7.
I had to add SystemTimer to my Gemfile, but it wasn’t necessary pre-3.0.6.
gem ‘SystemTimer’, ‘1.2.3’
I too would like to see Decent Exposure, or something similar, incorporated into rails core..
Just upgraded from 3.0.5 to 3.0.6 across our four app servers and promptly had them start thrashing into swap memory. After a bit of investigation, it seems that 3.0.6 is using about 20%-40% more memory per Passenger process than 3.0.5 did. Anyone else have this occur?
Anyone else notice a performance hit in view rendering? After upgrading, a view that used to take about 500ms to render jumped to 2200ms.
I’ve noticed my rspec suite takes about 4 times longer to run with rails 3.0.6. Anyone else notice this?
Yeah, view rendering seems a whole lot slower. Any ideas what is causing this?
@Alex omg 5 hearts and a smiley face. how ever shall we go on.
View rendering is dismally slow. Revert to 3.0.5 until it’s fixed.
@scott: My hunch with your view slowness would be that your app is now garbage collecting many times more than it had been, as this release seems to gobble up the memory at a much faster rate than 3.0.5. I’d reckon the powers that be will take a look for 3.0.7, in the meantime I’d consider 3.0.6 a mulligan.
Slowness issue (with confirmation of what causes it): https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/6695-dramatic-rendering-slowdown-from-303-to-306
Can’t successfully install rails 3.0.6. Getting a message: “File not found:lib”
Had this problem awhile back during the 3.0 beta era. Please advise. Help?
lawhacker:rails-3.0.6 werdna$ gem install rails Successfully installed rails-3.0.6 1 gem installed Installing ri documentation for rails-3.0.6… File not found: lib ERROR: While generating documentation for rails-3.0.6 ... MESSAGE: exit ... RDOC args:—ri—op /Users/werdna/.rvm/gems/ree-1.8.7-2011.03/doc/rails-3.0.6/ri lib—title rails-3.0.6 Documentation—quiet l
(Hey @wizardwerdna! I played Wizardry all the time in college, and ran into you on a poker site awhile ago.)
I had the same problem trying to install rails on Snow Leopard using the built-in version of Ruby (1.8.something). I built the latest stable version (1.9.2-p180) and did a re-install of rails, and it seemed to work.
Hey NJ!
I’m using rvm, and running on REE 1.8.7. Flipping to the 1.9.2 head, rails installs fine. Thanks for that.
I was under the impression, however, that rails was intended to support 1.8.7. Am I missing something?
The RoR home page still lists 3.0.5 as the latest version btw.
just like before, i know, i will gain more knowledge when i entry into you website.