Bugzilla – Bug 853625
VUL-0: CVE-2013-4491: rubygem-actionpack: i18n missing translation XSS
Last modified: 2014-05-21 08:14:19 UTC
CVE-2013-4491 is public via oss-security: Reflective XSS Vulnerability in Ruby on Rails There is a vulnerability in the internationalization component of Ruby on Rails. Under certain common configurations an attacker can provide specially crafted input which will execute a reflective XSS attack. This vulnerability has been assigned the CVE identifier CVE-2013-4491. Versions Affected: 3.0.6 and all later versions. Not affected: 3.0.5 and earlier 3.0.x versions. Fixed Versions: 4.0.2, 3.2.16. The root cause of this issue is a vulnerability in the i18n gem which has been assigned the identifier CVE-2013-4492. For this reason applications are also not affected if they have upgraded to the following i18n versions: * i18n-0.6.6 for Rails 4.0.x and 3.2.x applications * i18n-0.5.1 for Rails 3.1.x and 3.0.x applications Impact ------ When the i18n gem is unable to provide a translation for a given string, it creates a fallback HTML string. Under certain common configurations this string can contain user input which would allow an attacker to execute a reflective XSS attack. All users running an affected release should either upgrade or use one of the workarounds immediately. Releases -------- The 4.0.2 and 3.2.16 releases are available at the normal locations. Workarounds ----------- To work around this issue you must replace the standard i18n exception handler with a fixed one. Place the following code into a file in the config/initializers directory of your project and restart the server. require 'i18n' # Override exception handler to more carefully html-escape missing-key results. class HtmlSafeI18nExceptionHandler Missing = I18n.const_defined?(:MissingTranslation) ? I18n::MissingTranslation : I18n::MissingTranslationData def initialize(original_exception_handler) <at> original_exception_handler = original_exception_handler end def call(exception, locale, key, options) if exception.is_a?(Missing) && options[:rescue_format] == :html keys = exception.keys.map { |k| Rack::Utils.escape_html k } key = keys.last.to_s.gsub('_', ' ').gsub(/\b('?[a-z])/) { $1.capitalize } %(<span class="translation_missing" title="translation missing: #{keys.join('.')}">#{key}</span>) else <at> original_exception_handler.call(exception, locale, key, options) end end end I18n.exception_handler = HtmlSafeI18nExceptionHandler.new(I18n.exception_handler) This initializer has also been attached to this message as html_safe_i18n_exception_handler.rb 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. * 4-0-i18n_xss.patch - Patch for 4.0 series * 3-2-i18n_xss.patch - Patch for 3.2 series Please note that only the 4.0.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. Credits ------- Thanks to Peter McLarnan of Matasano Security for reporting the issue to us, and to Sven Fuchs and Christopher Dell for working with us on the fix. References: http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2013-4491 http://permalink.gmane.org/gmane.comp.security.oss.general/11600 https://bugzilla.redhat.com/show_bug.cgi?id=1036922
Created attachment 570187 [details] patch for 3.2.x
Created attachment 570188 [details] patch for 4.0.x
I am assigning the bug for packaging.
bugbot adjusting priority
The SWAMPID for this issue is 55366. This issue was rated as moderate. Please submit fixed packages until 2013-12-20. When done, please reassign the bug to security-team@suse.de. Patchinfo will be handled by security team.
This is an autogenerated message for OBS integration: This bug (853625) was mentioned in https://build.opensuse.org/request/show/210399 12.2 / rubygem-actionpack-3_2 https://build.opensuse.org/request/show/210404 12.3 / rubygem-actionpack-3_2 https://build.opensuse.org/request/show/210405 13.1 / rubygem-actionpack-3_2
This is an autogenerated message for OBS integration: This bug (853625) was mentioned in https://build.opensuse.org/request/show/210711 12.2 / rubygem-actionpack-3_2 https://build.opensuse.org/request/show/210713 12.3 / rubygem-actionpack-3_2 https://build.opensuse.org/request/show/210714 13.1 / rubygem-actionpack-3_2
openSUSE-SU-2013:1904-1: An update that fixes 5 vulnerabilities is now available. Category: security (moderate) Bug References: 853625,853627,853632,853633 CVE References: CVE-2013-0155,CVE-2013-4491,CVE-2013-6414,CVE-2013-6415,CVE-2013-6417 Sources used: openSUSE 12.3 (src): rubygem-actionpack-3_2-3.2.12-1.8.1
openSUSE-SU-2013:1906-1: An update that fixes 5 vulnerabilities is now available. Category: security (moderate) Bug References: 853625,853627,853632,853633 CVE References: CVE-2013-0155,CVE-2013-4491,CVE-2013-6414,CVE-2013-6415,CVE-2013-6417 Sources used: openSUSE 13.1 (src): rubygem-actionpack-3_2-3.2.13-2.4.1
openSUSE-SU-2013:1907-1: An update that fixes 5 vulnerabilities is now available. Category: security (moderate) Bug References: 853625,853627,853632,853633 CVE References: CVE-2013-0155,CVE-2013-4491,CVE-2013-6414,CVE-2013-6415,CVE-2013-6417 Sources used: openSUSE 12.2 (src): rubygem-actionpack-3_2-3.2.12-3.21.1
openSUSE-SU-2014:0009-1: An update that fixes 5 vulnerabilities is now available. Category: security (moderate) Bug References: 846239,853625,853627,853632,853633 CVE References: CVE-2013-4389,CVE-2013-4491,CVE-2013-6414,CVE-2013-6415,CVE-2013-6417 Sources used: openSUSE 13.1 (src): rubygem-actionpack-3_2-3.2.13-2.9.1 openSUSE 12.3 (src): rubygem-actionpack-3_2-3.2.12-1.13.1 openSUSE 12.2 (src): rubygem-actionpack-3_2-3.2.12-3.26.2
released
Update released for: rubygem-actionpack-3_2, rubygem-actionpack-3_2-doc Products: SLE-SLMS 1.3 (x86_64) SLE-STUDIOONSITE 1.3 (x86_64) SLE-WEBYAST 1.3 (i386, ia64, ppc64, s390x, x86_64)
SUSE-SU-2014:0152-1: An update that solves four vulnerabilities and has one errata is now available. Category: security (moderate) Bug References: 846239,853625,853627,853632,853633 CVE References: CVE-2013-4491,CVE-2013-6414,CVE-2013-6415,CVE-2013-6417 Sources used: WebYaST 1.3 (src): rubygem-actionpack-3_2-3.2.12-0.11.1 SUSE Studio Onsite 1.3 (src): rubygem-actionpack-3_2-3.2.12-0.11.1 SUSE Lifecycle Management Server 1.3 (src): rubygem-actionpack-3_2-3.2.12-0.11.1
The SWAMPID for this issue is 56198. This issue was rated as moderate. Please submit fixed packages until 2014-02-25. When done, please reassign the bug to security-team@suse.de. Patchinfo will be handled by security team.
This is an autogenerated message for OBS integration: This bug (853625) was mentioned in https://build.opensuse.org/request/show/230058 Factory / rubygem-actionpack-3_2
Update released for: hawk, hawk-debuginfo, hawk-debugsource, hawk-templates Products: SLE-DEBUGINFO 11-SP3 (i386, ia64, ppc64, s390x, x86_64) SLE-HAE 11-SP3 (i386, ia64, ppc64, s390x, x86_64)
SUSE-SU-2014:0686-1: An update that solves 5 vulnerabilities and has one errata is now available. Category: security (moderate) Bug References: 846239,853625,853627,853632,853633,854060 CVE References: CVE-2013-4389,CVE-2013-4491,CVE-2013-6414,CVE-2013-6415,CVE-2013-6417 Sources used: SUSE Linux Enterprise High Availability Extension 11 SP3 (src): hawk-0.6.1-0.17.1