require_relative '../spec_helper' ruby_version_is ''...'3.0' do require 'rexml/document' describe "REXML::Document.new" do it "resists CVE-2014-8080 by raising an exception when entity expansion has grown too large" do xml = < ]> %x9;%x9;%x9;%x9;%x9;%x9;%x9;%x9;%x9;%x9; XML -> { REXML::Document.new(xml).doctype.entities['x9'].value }.should raise_error(REXML::ParseException, /entity expansion has grown too large/) end end end