CVE-2012-3464: XSS
Cross-site scripting (XSS) vulnerability in activesupport/lib/activesupport/coreext/string/outputsafety.rb in Ruby on Rails before 2.3.16, 3.0.x before , 3.1.x before 3.1.8, and 3.2.x before 3.2.8 might allow remote attackers to inject arbitrary web script or HTML via vectors involving a ' (quote) character.
Other sources
Cross-site scripting (XSS) vulnerability in activesupport/lib/activesupport/coreext/string/outputsafety.rb in Ruby on Rails before 3.0.17, 3.1.x before 3.1.8, and 3.2.x before 3.2.8 might allow remote attackers to inject arbitrary web script or HTML via vectors involving a ' (quote) character.
— NVD
The Ruby on Rails project reports:
There is a vulnerability in the HTML escaping code in Ruby on Rails. This vulnerability has been assigned the CVE identifier CVE-2012-3464.
Versions Affected: All. Not affected: None Fixed Versions: 3.2.8, 3.1.8, 3.0.17
Impact - ------ The HTML escaping code in Ruby on Rails does not escape all potentially dangerous characters. In particular the code does not escape the single quote character. The helpers used in Rails itself never use single quotes, so most applications are unlikely to be vulnerable, however all users running an affected release should still upgrade.
Releases - -------- The 3.2.8 and 3.1.8 releases are available at the normal locations.
Workarounds - -----------
For users on earlier releases or who are unable to upgrade, you can install the attached file into config/initializers. This will upgrade the rails helper to use the Rack::Utils.escapehtml helper which does escape the single quote character. However the Rack helper also escapes the '/' character, this is likely to cause test failures if your application is expecting the values of URLs to be unencoded. These tests however browsers will correctly decode the values and function as expected.
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-0-escapehtml.patch - Patch for 3.0 series 3-1-escapehtml.patch - Patch for 3.1 series 3-2-escapehtml.patch - Patch for 3.2 series
Please note that only the 3.1.x and 3.2.x series are supported at present. Users of earlier unsupported releases are advised to upgrade as soon as possible as we cannot guarantee the continued availability of security fixes for unsupported releases.
References: http://weblog.rubyonrails.org/2012/8/9/ann-rails-3-2-8-has-been-released/
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2012-3464?
CVE-2012-3464 has been rated as a medium severity vulnerability due to its potential to allow cross-site scripting attacks.
How do I fix CVE-2012-3464?
To fix CVE-2012-3464, upgrade to Ruby on Rails versions 2.3.16, 3.0.17, 3.1.8, or 3.2.8 or later.
What vulnerability type is associated with CVE-2012-3464?
CVE-2012-3464 is associated with cross-site scripting (XSS) vulnerabilities.
Which Ruby on Rails versions are affected by CVE-2012-3464?
CVE-2012-3464 affects Ruby on Rails versions before 2.3.16, 3.0.x before 3.0.17, 3.1.x before 3.1.8, and 3.2.x before 3.2.8.
Can CVE-2012-3464 be exploited remotely?
Yes, CVE-2012-3464 can be exploited by remote attackers to inject arbitrary web scripts or HTML.