CWE
79
Advisory Published
CVE Published
Advisory Published
Updated

CVE-2012-1098: XSS

First published: Fri Mar 02 2012(Updated: )

A cross-site scripting (XSS) flaw was found in the way the String class, used in Ruby on Rails, performed HTML escaping of SafeBuffer objects, when such objects were manipulated directly via '[]' method or other methods, also returning new instances of SafeBuffer object. By using these methods, such newly returned SafeBuffer instances would be inadvertently marked as HTML safe. If a Ruby on Rails application used SafeBuffer objects this way, a remote attacker could provide a specially-crafted input, which once processed by such SafeBuffer instance would pass the HTML escaping test without further filtering, possibly leading to arbitrary HTML or webscript execution. References: [1] <a href="http://weblog.rubyonrails.org/2012/3/1/ann-rails-3-0-12-has-been-released">http://weblog.rubyonrails.org/2012/3/1/ann-rails-3-0-12-has-been-released</a> [2] <a href="http://groups.google.com/group/rubyonrails-security/browse_thread/thread/edd28f1e3d04e913">http://groups.google.com/group/rubyonrails-security/browse_thread/thread/edd28f1e3d04e913</a> [3] <a href="https://bugs.gentoo.org/show_bug.cgi?id=406547">https://bugs.gentoo.org/show_bug.cgi?id=406547</a> Proposed upstream patches: [4] <a href="http://groups.google.com/group/rubyonrails-security/attach/1c2e01a5e42722c9/3-0-safe-buffer-slice.patch?part=3">http://groups.google.com/group/rubyonrails-security/attach/1c2e01a5e42722c9/3-0-safe-buffer-slice.patch?part=3</a> (against v3.0 branch) [5] <a href="http://groups.google.com/group/rubyonrails-security/attach/1c2e01a5e42722c9/3-1-safe-buffer-slice.patch?part=4">http://groups.google.com/group/rubyonrails-security/attach/1c2e01a5e42722c9/3-1-safe-buffer-slice.patch?part=4</a> (against v3.1 branch) [6] <a href="http://groups.google.com/group/rubyonrails-security/attach/1c2e01a5e42722c9/3-2-safe-buffer-slice.patch?part=5">http://groups.google.com/group/rubyonrails-security/attach/1c2e01a5e42722c9/3-2-safe-buffer-slice.patch?part=5</a> (against v3.2 branch)

Credit: secalert@redhat.com

Affected SoftwareAffected VersionHow to fix
redhat/rubygem-activesupport<3.0.12
3.0.12
redhat/rubygem-activesupport<3.1.4
3.1.4
redhat/rubygem-activesupport<3.2.2
3.2.2
rubygems/activesupport>=3.2.0<3.2.2
3.2.2
rubygems/activesupport>=3.1.0<3.1.4
3.1.4
rubygems/activesupport>=3.0.0<3.0.12
3.0.12
Ruby on Rails=3.0.0
Ruby on Rails=3.0.0-beta
Ruby on Rails=3.0.0-beta2
Ruby on Rails=3.0.0-beta3
Ruby on Rails=3.0.0-beta4
Ruby on Rails=3.0.0-rc
Ruby on Rails=3.0.0-rc2
Ruby on Rails=3.0.1
Ruby on Rails=3.0.1-pre
Ruby on Rails=3.0.2
Ruby on Rails=3.0.2-pre
Ruby on Rails=3.0.3
Ruby on Rails=3.0.4-rc1
Ruby on Rails=3.0.5
Ruby on Rails=3.0.5-rc1
Ruby on Rails=3.0.6
Ruby on Rails=3.0.6-rc1
Ruby on Rails=3.0.6-rc2
Ruby on Rails=3.0.7
Ruby on Rails=3.0.7-rc1
Ruby on Rails=3.0.7-rc2
Ruby on Rails=3.0.8
Ruby on Rails=3.0.8-rc1
Ruby on Rails=3.0.8-rc2
Ruby on Rails=3.0.8-rc3
Ruby on Rails=3.0.8-rc4
Ruby on Rails=3.0.9
Ruby on Rails=3.0.9-rc1
Ruby on Rails=3.0.9-rc2
Ruby on Rails=3.0.9-rc3
Ruby on Rails=3.0.9-rc4
Ruby on Rails=3.0.9-rc5
Ruby on Rails=3.0.10
Ruby on Rails=3.0.10-rc1
Ruby on Rails=3.0.11
Ruby on Rails=3.0.12-rc1
Ruby on Rails=3.0.4
Ruby on Rails=3.1.0
Ruby on Rails=3.1.0-beta1
Ruby on Rails=3.1.0-rc1
Ruby on Rails=3.1.0-rc2
Ruby on Rails=3.1.0-rc3
Ruby on Rails=3.1.0-rc4
Ruby on Rails=3.1.0-rc5
Ruby on Rails=3.1.0-rc6
Ruby on Rails=3.1.0-rc7
Ruby on Rails=3.1.0-rc8
Ruby on Rails=3.1.1
Ruby on Rails=3.1.1-rc1
Ruby on Rails=3.1.1-rc2
Ruby on Rails=3.1.1-rc3
Ruby on Rails=3.1.2
Ruby on Rails=3.1.2-rc1
Ruby on Rails=3.1.2-rc2
Ruby on Rails=3.1.3
Ruby on Rails=3.1.4-rc1
Ruby on Rails=3.2.0
Ruby on Rails=3.2.0-rc1
Ruby on Rails=3.2.0-rc2
Ruby on Rails=3.2.1
Ruby on Rails=3.2.2-rc1

Never miss a vulnerability like this again

Sign up to SecAlerts for real-time vulnerability data matched to your software, aggregated from hundreds of sources.

Frequently Asked Questions

  • What is the severity of CVE-2012-1098?

    CVE-2012-1098 has been classified as a medium severity vulnerability.

  • How do I fix CVE-2012-1098?

    To fix CVE-2012-1098, update to the fixed versions of the affected package, specifically activesupport 3.0.12, 3.1.4, or 3.2.2.

  • What versions of Ruby on Rails are affected by CVE-2012-1098?

    CVE-2012-1098 affects Ruby on Rails versions 3.0.0 to 3.0.11, 3.1.0 to 3.1.4, and 3.2.0 to 3.2.2.

  • What is the nature of the vulnerability CVE-2012-1098?

    CVE-2012-1098 is a cross-site scripting (XSS) vulnerability due to improper HTML escaping of SafeBuffer objects in Ruby on Rails.

  • Can CVE-2012-1098 be exploited remotely?

    Yes, CVE-2012-1098 can be exploited remotely through crafted input that triggers the XSS flaw.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2025 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203