Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [day] [month] [year] [list]
Date: Mon, 25 Jan 2016 11:38:45 -0800
From: Aaron Patterson <>
Subject: [CVE-2015-7580] Possible XSS vulnerability in rails-html-sanitizer

Possible XSS vulnerability in rails-html-sanitizer

There is a possible XSS vulnerability in the white list sanitizer in the
rails-html-sanitizer gem. This vulnerability has been assigned the CVE
identifier CVE-2015-7580.

Versions Affected:  All.
Not affected:       None.
Fixed Versions:     v1.0.3

Carefully crafted strings can cause user input to bypass the sanitization in
the white list sanitizer which will can lead to an XSS attack.

Vulnerable code will look something like this:

  <%= sanitize user_input, tags: %w(em) %>

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

The FIXED releases are available at the normal locations.

Putting the following monkey patch in an initializer can help to mitigate the

class Rails::Html::PermitScrubber
  alias :old_scrub :scrub
  alias :old_skip_node? :skip_node?

  def scrub(node)
    if node.cdata?
      text = node.document.create_text_node node.text
      node.replace text
      return CONTINUE
    old_scrub node

  def skip_node?(node); node.text?; end

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.

* 1-0-whitelist_sanitizer_xss.patch - Patch for 1.0 series

Thanks to Arnaud Germis, Nate Clark, and John Colvin for reporting this issue.

Aaron Patterson

View attachment "1-0-whitelist_sanitizer_xss.patch" of type "text/plain" (2140 bytes)

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Please check out the Open Source Software Security Wiki, which is counterpart to this mailing list.

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.