CVE-2012-3463: XSS
Cross-site scripting (XSS) vulnerability in actionpack/lib/actionview/helpers/formtaghelper.rb in Ruby on Rails 3.x before 3.0.17, 3.1.x before 3.1.8, and 3.2.x before 3.2.8 allows remote attackers to inject arbitrary web script or HTML via the prompt field to the selecttag helper.
Other sources
Cross-site scripting (XSS) vulnerability in actionpack/lib/actionview/helpers/formtaghelper.rb in Ruby on Rails 3.x before 3.0.17, 3.1.x before 3.1.8, and 3.2.x before 3.2.8 allows remote attackers to inject arbitrary web script or HTML via the prompt field to the selecttag helper.
The ruby on Rails project reports:
There is a vulnerability in Ruby on Rails in the selecttag helper method when a "prompt" is supplied. This vulnerability has been assigned the CVE identifier CVE-2012-3463.
Versions Affected: 3.x. Not affected: 2.3.x Fixed Versions: 3.2.8, 3.1.8, 3.0.17
Impact - ------ When a "prompt" value is supplied to the selecttag helper, the "prompt" value is not escaped. If untrusted data is not escaped, and is supplied as the prompt value, there is a potential for XSS attacks.
Vulnerable code will look something like this:
selecttag("name", options, :prompt => UNTRUSTEDINPUT)
All users running an affected release should either upgrade or use one of the work arounds immediately.
Releases - -------- The 3.2.8, 3.1.8, and 3.0.17 releases are available at the normal locations.
Workarounds - -----------
A possible workaround for this vulnerability is to escape user input supplied to the prompt key:
selecttag("name", options, :prompt => h(UNTRUSTEDINPUT))
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-selecttagprompt.patch - Patch for 3.0 series 3-1-selecttagprompt.patch - Patch for 3.1 series 3-2-selecttagprompt.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
Remediation
Event History
Frequently Asked Questions
What is the severity of CVE-2012-3463?
CVE-2012-3463 has a medium severity rating due to its potential impact on user data through cross-site scripting attacks.
How do I fix CVE-2012-3463?
To fix CVE-2012-3463, upgrade your Ruby on Rails application to version 3.0.17, 3.1.8, or 3.2.8 or later.
Which versions of Ruby on Rails are affected by CVE-2012-3463?
CVE-2012-3463 affects Ruby on Rails versions prior to 3.0.17, 3.1.8, and 3.2.8.
What type of vulnerability is CVE-2012-3463?
CVE-2012-3463 is a cross-site scripting (XSS) vulnerability that allows attackers to inject arbitrary web scripts or HTML.
Can CVE-2012-3463 be exploited remotely?
Yes, CVE-2012-3463 can be exploited remotely by attackers who can manipulate the `prompt` field to inject malicious code.