CWE
400 20 611
Advisory Published
CVE Published
Advisory Published
Updated

CVE-2013-1821: Input Validation

First published: Fri Feb 22 2013(Updated: )

An unrestricted entity expansion flaw was reported in Ruby that can lead to a denial of service in REXML. When reading text nodes from an XML document, the REXML parser could be coerced into allocating extremely large string objects which could consume all available memory on the system. Impacted code would look similar to the following: document = REXML::Document.new some_xml_doc document.root.text In this case, when the 'text' method is called, entities will be expanded. An attacker could send a relatively small XML document that, when the entities were resolved, would consume extremely large amounts of memory on the target system. It is noted that this vulnerability is similar to the 'Billion Laughs' attack, and is also related to <a href="https://access.redhat.com/security/cve/CVE-2013-1664">CVE-2013-1664</a> (Python). The upstream advisory has a work-around patch that limits the size of entity substitutions. External References: <a href="http://www.ruby-lang.org/en/news/2013/02/22/rexml-dos-2013-02-22/">http://www.ruby-lang.org/en/news/2013/02/22/rexml-dos-2013-02-22/</a>

Credit: secalert@redhat.com secalert@redhat.com

Affected SoftwareAffected VersionHow to fix
maven/org.jruby:jruby<1.7.3
1.7.3
redhat/ruby<1.9.3
1.9.3
redhat/ruby<2.0.0
2.0.0
Ruby<=1.9.3
Ruby=1.9
Ruby=1.9.1
Ruby=1.9.2
Ruby=1.9.3
Ruby=1.9.3-p0
Ruby=1.9.3-p125
Ruby=1.9.3-p194
Ruby=1.9.3-p286
Ruby=1.9.3-p383
Ruby=2.0
Ruby=2.0.0
Ruby=2.0.0-rc1
Ruby=2.0.0-rc2

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.

Reference Links

Frequently Asked Questions

  • What is the severity of CVE-2013-1821?

    CVE-2013-1821 is classified as a medium-severity vulnerability due to its potential to cause denial of service.

  • How do I fix CVE-2013-1821?

    To fix CVE-2013-1821, upgrade Ruby to version 1.9.3 or later, or JRuby to 1.7.3 or later.

  • What are the impacts of CVE-2013-1821?

    The impacts of CVE-2013-1821 include the possibility of exhausting system memory due to unrestricted entity expansion in XML parsing.

  • Which Ruby versions are affected by CVE-2013-1821?

    Ruby versions prior to 1.9.3, including all 1.9.x versions, are affected by CVE-2013-1821.

  • Is JRuby affected by CVE-2013-1821?

    Yes, JRuby versions prior to 1.7.3 are affected by CVE-2013-1821.

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