Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Possible XSS Security Vulnerability in SafeBuffer#[]
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Aaron Patterson  
View profile  
 More options Mar 1 2012, 1:01 pm
From: Aaron Patterson <tenderl...@ruby-lang.org>
Date: Thu, 1 Mar 2012 10:01:56 -0800
Local: Thurs, Mar 1 2012 1:01 pm
Subject: Possible XSS Security Vulnerability in SafeBuffer#[]

There is a vulnerability in the SafeBuffer#[] in Ruby On Rails where unescaped safe buffers can be marked as safe.

Versions Affected:  All.
Fixed Versions:     3.2.2, 3.1.4, 3.0.12

Impact
------
Due side effects of some optimizations in the String class, users that directly manipulate SafeBuffer objects via `[]` and other methods that return new instances of SafeBuffer may be inadvertently marked as HTML safe.  All users running an affected release should either upgrade or use one of the work arounds immediately.

This problem manifests itself in forms like this:

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

Or in a shorter form:

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

The fix will make the call to `html_safe?` return a falsey value.  After the patch:

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

Or in a shorter form:

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

Releases
--------
The 3.2.2, 3.1.4, and 3.0.12 releases are available at the normal locations.

Workarounds
-----------

There are no feasible workarounds for this issue.

Patches
-------
To aid users who aren't able to upgrade immediately we have provided patches for the two supported release series.  They are in git-am format and consist of a single changeset.

* 3-2-safe-buffer-slice.patch - Patch for 3.2 series
* 3-1-safe-buffer-slice.patch - Patch for 3.1 series
* 3-0-safe-buffer-slice.patch - Patch for 3.0 series

Please note that only the  3.2.x, 3.1.x, and 3.0.x series are supported at present.  Users of earlier unsupported releases are advised to upgrade as soon as possible.

Credits
-------

Credit goes to Akira Matsuda for this fix.  Thank you!

--
Aaron Patterson
http://tenderlovemaking.com/

  3-0-safe-buffer-slice.patch
6K Download

  3-1-safe-buffer-slice.patch
6K Download

  3-2-safe-buffer-slice.patch
6K Download

  application_pgp-signature_part
< 1K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »