GNOME Bugzilla – Bug 738805
Regression in 2.9.2: entity is not parsed if used in another one, which has been previously parsed
Last modified: 2016-01-09 16:28:49 UTC
Using the following testcase.xml: ---- <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE somedoc [ <!ENTITY a "something"> <!ENTITY b "&a;"> ]> <somedoc> <somebeacon someattribute="&b;"/> &a; should appear after colon: &a; &b; should appear after colon: &a; &a; should appear after colon: &b; &b; should appear after colon: &b; </somedoc> ---- the command "xmllint --noent testcase.xml" ouputs (libxml2-2.9.2): ---- <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE somedoc [ <!ENTITY a "something"> <!ENTITY b "&a;"> ]> <somedoc> <somebeacon someattribute="something"/> should appear after colon: should appear after colon: should appear after colon: should appear after colon: </somedoc> ---- while with libxml2-2.9.1; it gives: ----<?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE somedoc [ <!ENTITY a "something"> <!ENTITY b "&a;"> ]> <somedoc> <somebeacon someattribute="something"/> something should appear after colon: something something should appear after colon: something something should appear after colon: something something should appear after colon: something </somedoc> ---- Changing the line "<somebeacon someattribute="&b;"/>" to "<somebeacon someattribute="&a;"/> gives the normal 2nd output on all version, as well as moving that line after the "should appear" lines. Regards Pierre
git bisect says the offending commit is: commit be2a7edaf289c5da74a4f9ed3a0b6c733e775230 Author: Daniel Veillard <veillard@redhat.com> Date: Thu Oct 16 13:59:47 2014 +0800 Fix for CVE-2014-3660 Issues related to the billion laugh entity expansion which happened to escape the initial set of fixes
Okay found and fixed: https://git.gnome.org/browse/libxml2/commit/?id=72a46a519ce7326d9a00f0b6a7f2a8e958cd1675 patch is small but it's a rather convoluted test case and this escaped initial testing, sorry about it, thanks for the report, Daniel
Test case added in: https://git.gnome.org/browse/libxml2/commit/?id=df23f584fda15955a0811bd768a8925eb98741c9
(In reply to Daniel Veillard from comment #2) > Okay found and fixed: > > https://git.gnome.org/browse/libxml2/commit/ > ?id=72a46a519ce7326d9a00f0b6a7f2a8e958cd1675 > > patch is small but it's a rather convoluted test case and this escaped > initial > testing, sorry about it, > > thanks for the report, > > Daniel This fix caused the following regression in libxml2 v2.9.3: Bug 760367: REGRESSION (v2.9.3): Entity is expanded twice when custom xmlEntity is returned from xmlSAXHandler.getEntity <https://bugzilla.gnome.org/show_bug.cgi?id=760367>