CVE-2014-8090: Another Denial Of Service XML Expansion

69 views
Skip to first unread message

André Arko

unread,
Nov 14, 2014, 3:34:41 PM11/14/14
to ruby-sec...@googlegroups.com

Unrestricted entity expansion can lead to a DoS vulnerability in REXML, like “Entity expansion DoS vulnerability in REXML (XML bomb, CVE-2013-1821)” and “CVE-2014-8080: Parameter Entity expansion DoS vulnerability in REXML”. This vulnerability has been assigned the CVE identifier CVE-2014-8090. We strongly recommend to upgrade ruby.

Details

This is an additional fix for CVE-2013-1821 and CVE-2014-8080. The previous patches fixed recursive expansions in a number of places and total size created Strings. However, they did not take into account the former limit used for entity expansion. 100% CPU utilization can occur as a result of recursive expansion with an empty String. When reading text nodes from an XML document, the REXML parser can be coerced in to allocating extremely large string objects which can consume all of the memory on a machine, causing a denial of service.

Impacted code will look something like this:

require 'rexml/document'

xml = <<XML

  # ENTITY expansion vector
]>

XML

p REXML::Document.new(xml)

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

Affected versions

  • All ruby 1.9 versions prior to ruby 1.9.3 patchlevel 551
  • All ruby 2.0 versions prior to ruby 2.0.0 patchlevel 598
  • All ruby 2.1 versions prior to ruby 2.1.5
  • prior to trunk revision 48402

Work arounds

If you cannot upgrade Ruby, use this monkey patch as a workaround:

class REXML::Document
  def document
    self
  end
end

Credits

Thanks to Tomas Hoger for reporting this issue.

History

  • Originally published at 2014-11-13 12:00:00 (UTC)

Posted by usa on 13 Nov 2014

Reply all
Reply to author
Forward
0 new messages