Google Groups

XSS Vulnerability in strip_tags


Michael Koziarski Aug 9, 2012 2:31 PM
Posted in group: Ruby on Rails: Security
There is a vulnerability in the strip_tags helper of Ruby on Rails which
could allow an attacker to execute arbitrary javascript. This
vulnerability has been assigned the CVE identifier CVE-2012-3465.

Versions Affected:  All.
Not affected:       Applications not using strip_tags
Fixed Versions:     3.2.8, 3.1.8, 3.0.17

Impact
------
There is an XSS vulnerability in the strip_tags helper in Ruby on Rails,
the helper doesn't correctly handle malformed html.  As a result an
attacker can execute arbitrary javascript through the use of specially
crafted malformed html.  All users who rely on strip_tags for XSS
protection should upgrade or use the work around immediately.

Releases
--------
The 3.2.8, 3.0.17 and 3.1.8 releases are available at the normal locations.

Workarounds
-----------
For users running earlier releases we have provided a work around, place
the attached file into the config/initializers directory of your
application.

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-strip_tags.patch - Patch for 3.0 series
* 3-1-strip_tags.patch - Patch for 3.1 series
* 3-2-strip_tags.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.

Credits
-------

Thanks to Marek from Nethemba (www.nethemba.com) for reporting this issue!

--
Cheers,

Koz