This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 921335 - (CVE-2013-1857) CVE-2013-1857 rubygem-actionpack: sanitize_protocol: XSS Vulnerability in the helper of Ruby on Rails
CVE-2013-1857 rubygem-actionpack: sanitize_protocol: XSS Vulnerability in the...
Status: CLOSED ERRATA
Product: Security Response
Classification: Other
Component: vulnerability (Show other bugs)
unspecified
All Linux
medium Severity medium
: ---
: ---
Assigned To: Red Hat Product Security
impact=moderate,public=20130318,repor...
: Security
Depends On: 921352 921355 921358 921361 924297 924298 995658 1030779 1165372 1165373
Blocks: 921344 921347 921348 925747 1000138 1028279
  Show dependency treegraph
 
Reported: 2013-03-13 23:02 EDT by Kurt Seifried
Modified: 2015-08-21 17:18 EDT (History)
22 users (show)

See Also:
Fixed In Version: rubygem-actionpack 3.1.12, rubygem-actionpack 3.2.13
Doc Type: Bug Fix
Doc Text:
A cross-site scripting (XSS) flaw was found in Action Pack. A remote attacker could use this flaw to conduct XSS attacks against users of an application using Action Pack.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-01-17 00:34:02 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
2-3-sanitize_protocol.patch (2.29 KB, patch)
2013-03-14 16:33 EDT, Kurt Seifried
no flags Details | Diff
3-0-sanitize_protocol.patch (2.14 KB, patch)
2013-03-14 16:33 EDT, Kurt Seifried
no flags Details | Diff
3-1-sanitize_protocol.patch (2.07 KB, patch)
2013-03-14 16:33 EDT, Kurt Seifried
no flags Details | Diff
3-2-sanitize_protocol.patch (2.07 KB, patch)
2013-03-14 16:34 EDT, Kurt Seifried
no flags Details | Diff
2-3-sanitize_protocol.patch (3.47 KB, patch)
2013-03-18 01:31 EDT, Kurt Seifried
no flags Details | Diff
3-0-sanitize_protocol.patch (3.19 KB, patch)
2013-03-18 01:32 EDT, Kurt Seifried
no flags Details | Diff
3-1-sanitize_protocol.patch (3.20 KB, patch)
2013-03-18 01:33 EDT, Kurt Seifried
no flags Details | Diff
3-2-sanitize_protocol.patch (3.20 KB, patch)
2013-03-18 01:33 EDT, Kurt Seifried
no flags Details | Diff

  None (edit)
Description Kurt Seifried 2013-03-13 23:02:16 EDT
XSS Vulnerability in the `sanitize` helper of Ruby on Rails

There is an XSS vulnerability in the sanitize helper in Ruby on Rails. This vulnerability has been assigned the CVE identifier CVE-2013-1857.

Versions Affected:  All.
Not affected:       None.
Fixed Versions:     3.2.13, 3.1.12

Impact
------
The sanitize helper in Ruby on Rails is designed to filter HTML and remove all tags and attributes which could be malicious.  The code which ensured that URLs only contain supported protocols contained several bugs which could allow an attacker to embed a tag containing a URL which executes arbitrary javascript code.

All users running an affected release should either upgrade or use one of the work arounds immediately.

Releases
--------
The 3.2.13 and 3.1.12 releases are available at the normal locations.

Workarounds
-----------
If you are unable to upgrade, you can place the following code into a file in config/initializers and it will replace the method with the correct implementation.

  module HTML
    class WhiteListSanitizer
      def contains_bad_protocols?(attr_name, value)
        uri_attributes.include?(attr_name) &&
        (value =~ /(^[^\/:]*):|(&#0*58)|(&#x3a)|(&#x70)|(%|%)3A/i && !allowed_protocols.include?(value.split(protocol_separator).first.downcase.strip))
      end
    end
  end



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-2-sanitize_protocol.patch - Patch for 3.2 series
* 3-1-sanitize_protocol.patch - Patch for 3.1 series
* 3-0-sanitize_protocol.patch - Patch for 3.0 series
* 2-3-sanitize_protocol.patch - Patch for 2.3 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 Alan Jenkins for reporting the vulnerability to us.
Comment 3 Kurt Seifried 2013-03-14 16:33:08 EDT
Created attachment 710233 [details]
2-3-sanitize_protocol.patch
Comment 4 Kurt Seifried 2013-03-14 16:33:25 EDT
Created attachment 710234 [details]
3-0-sanitize_protocol.patch
Comment 5 Kurt Seifried 2013-03-14 16:33:46 EDT
Created attachment 710235 [details]
3-1-sanitize_protocol.patch
Comment 6 Kurt Seifried 2013-03-14 16:34:05 EDT
Created attachment 710236 [details]
3-2-sanitize_protocol.patch
Comment 8 Kurt Seifried 2013-03-16 01:27:33 EDT
Please note that upstream reports that the patches have an issue and will be reissued this weekend most likely so we might need to respin this fix.
Comment 9 Kurt Seifried 2013-03-18 01:31:59 EDT
Created attachment 711753 [details]
2-3-sanitize_protocol.patch
Comment 10 Kurt Seifried 2013-03-18 01:32:28 EDT
Created attachment 711754 [details]
3-0-sanitize_protocol.patch
Comment 11 Kurt Seifried 2013-03-18 01:33:07 EDT
Created attachment 711755 [details]
3-1-sanitize_protocol.patch
Comment 12 Kurt Seifried 2013-03-18 01:33:53 EDT
Created attachment 711756 [details]
3-2-sanitize_protocol.patch
Comment 14 Vít Ondruch 2013-03-21 10:00:02 EDT
Can I get tracking bug for F1{7,8}? Thank you.
Comment 15 Jan Lieskovsky 2013-03-21 10:14:56 EDT
Created rubygem-actionpack tracking bugs for this issue

Affects: epel-5 [bug 924297]
Affects: fedora-all [bug 924298]
Comment 16 Murray McAllister 2013-03-27 07:28:55 EDT
Acknowledgements:

Red Hat would like to thank Ruby on Rails upstream for reporting this issue. Upstream acknowledges Alan Jenkins as the original reporter.
Comment 17 errata-xmlrpc 2013-04-02 15:47:28 EDT
This issue has been addressed in following products:

  RHEL 6 Version of OpenShift Enterprise

Via RHSA-2013:0698 https://rhn.redhat.com/errata/RHSA-2013-0698.html
Comment 18 Kurt Seifried 2013-07-26 02:16:49 EDT
The Red Hat Security Response Team has rated this issue as having moderate security impact in CloudForms 1.1. This issue is not currently planned to be addressed in future updates.
Comment 22 Martin Prpič 2014-11-14 11:20:25 EST
IssueDescription:

A cross-site scripting (XSS) flaw was found in Action Pack. A remote attacker could use this flaw to conduct XSS attacks against users of an application using Action Pack.
Comment 23 errata-xmlrpc 2014-11-17 12:08:51 EST
This issue has been addressed in the following products:

  Red Hat Subscription Asset Manager 1.4

Via RHSA-2014:1863 https://rhn.redhat.com/errata/RHSA-2014-1863.html

Note You need to log in before you can comment on or make changes to this bug.