Bug 1008644 - (CVE-2016-9180) VUL-1: CVE-2016-9180: perl-XML-Twig: expand_external_ents option fails to work as documented
(CVE-2016-9180)
VUL-1: CVE-2016-9180: perl-XML-Twig: expand_external_ents option fails to wo...
Status: RESOLVED FIXED
Classification: Novell Products
Product: SUSE Security Incidents
Classification: Novell Products
Component: Incidents
unspecified
Other Other
: P3 - Medium : Normal
: ---
Assigned To: Security Team bot
Security Team bot
https://smash.suse.de/issue/174478/
CVSSv2:SUSE:CVE-2016-9180:5.8:(AV:N/...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-11-04 17:06 UTC by Alexander Bergmann
Modified: 2022-09-16 11:41 UTC (History)
10 users (show)

See Also:
Found By: Security Response Team
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
CVE-2016-9180.pl (133 bytes, application/x-perl)
2016-11-17 12:32 UTC, Marcus Meissner
Details
CVE-2016-9180.xml (98 bytes, text/plain)
2016-11-17 12:32 UTC, Marcus Meissner
Details
boom.txt (6 bytes, text/plain)
2016-11-17 12:35 UTC, Marcus Meissner
Details
Patch fix from Debian documenting the security issue (2.46 KB, patch)
2020-07-13 17:46 UTC, Pedro Monreal Gonzalez
Details | Diff
Downloads/CVE-2016-9180.pl (119 bytes, text/plain)
2020-08-06 07:42 UTC, Marcus Meissner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Bergmann 2016-11-04 17:06:10 UTC
rh#1379553

The option to `expand_external_ents`, documented as controlling external entity
expansion in XML::Twig does not work.  External entities are always expanded,
regardless of the option's setting.

Upstream bug:
https://rt.cpan.org/Public/Bug/Display.html?id=118097

References:
https://bugzilla.redhat.com/show_bug.cgi?id=1379553
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-9180
http://seclists.org/oss-sec/2016/q4/329
Comment 1 Swamp Workflow Management 2016-11-04 23:00:43 UTC
bugbot adjusting priority
Comment 2 Tomáš Chvátal 2016-11-16 14:58:40 UTC
VUL-0? There is no patch and I would rather wait for one or delete it from distro :)
Comment 3 Marcus Meissner 2016-11-17 12:32:09 UTC
Created attachment 702435 [details]
CVE-2016-9180.pl

QA REPRODUCER (part 1/3):

perl CVE-2016-9180.pl 1
should print <root>Boom!
 
perl CVE-2016-9180.pl 0

should not print <root>Boom!
Comment 4 Marcus Meissner 2016-11-17 12:32:56 UTC
Created attachment 702436 [details]
CVE-2016-9180.xml

QA REPRODUCER (part 2/3):

CVE-2016-9180.xml   for previous perl reproducer
Comment 5 Marcus Meissner 2016-11-17 12:35:32 UTC
Created attachment 702437 [details]
boom.txt

QA REPRODUCER (part 3/3)

boom.txt   for inclusion in testcase
Comment 6 Marcus Meissner 2016-11-17 12:54:53 UTC
currently cannot see a possible fix yet.

the package is everywhere, you will find it hard to remove :/
Comment 7 Vítězslav Čížek 2016-11-18 10:45:42 UTC
A WONTFIX by RH: https://bugzilla.redhat.com/show_bug.cgi?id=1379553#c2
Comment 8 Sebastian Krahmer 2016-11-21 13:11:02 UTC
Setting to VUL-1 (dont need immediate update)
Comment 10 Petr Gajdos 2017-04-05 14:13:46 UTC
(In reply to Alexander Bergmann from comment #0)
> https://rt.cpan.org/Public/Bug/Display.html?id=118097

Reading the description of the bug, do I understand correctly that this is just about a missing option do disable 'expand external entities'?

Upstream resolved it by adding no_xxe option between 2.48 and 2.49 and then documented between 2.49 and 2.50.

When the CVE-2016-9180.pl from comment 3 is changed to:

use XML::Twig; my $twig = XML::Twig->new( no_xxe => $ARGV[0] ); $twig->parsefile( "CVE-2016-9180.xml"); $twig->print;

then 

$ perl CVE-2016-9180.pl 1
cannot expand &xxe; - cannot load 'boom.txt' at /usr/lib/perl5/vendor_perl/5.24.0/x86_64-linux-thread-multi/XML/Parser/Expat.pm line 474.
$ perl CVE-2016-9180.pl 0
<?xml version="1.0"?>
<!DOCTYPE foo [
<!ENTITY xxe PUBLIC "bar" "boom.txt">
]>
<root>Boom!
$

This would be acceptable?
Comment 11 Alexander Bergmann 2018-02-19 14:59:05 UTC
Yes, an extra option would be acceptable.
Comment 12 Pedro Monreal Gonzalez 2020-07-13 17:46:20 UTC
Created attachment 839642 [details]
Patch fix from Debian documenting the security issue

https://salsa.debian.org/perl-team/modules/packages/libxml-twig-perl/-/blob/master/debian/patches/CVE-2016-9180.patch
Comment 13 Pedro Monreal Gonzalez 2020-07-15 16:05:12 UTC
Extra option and a warning is now documented. Also, a new test for both expand_external_ents and no_xxe has been added. Patch from Debian in comment#12.

Factory submission:
   https://build.opensuse.org/request/show/821138
Comment 18 Liu Shukui 2020-08-05 08:30:18 UTC
(In reply to Marcus Meissner from comment #3)
> Created attachment 702435 [details]
> CVE-2016-9180.pl
> 
> QA REPRODUCER (part 1/3):
> 
> perl CVE-2016-9180.pl 1
> should print <root>Boom!
>  
> perl CVE-2016-9180.pl 0
> 
> should not print <root>Boom!

Hi, the bug reproducer has the same result on both sles12sp5  and sles15sp2, is the bug fixed?

s15sp2:~/Documents # perl CVE-2016-9180.pl 1
<?xml version="1.0"?>
<!DOCTYPE foo [
<!ENTITY xxe PUBLIC "bar" "boom.txt">
]>
<root>Boom!
</root>s15sp2:~/Documents # perl CVE-2016-9180.pl 0
<?xml version="1.0"?>
<!DOCTYPE foo [
<!ENTITY xxe PUBLIC "bar" "boom.txt">
]>
<root>Boom!
</root>
Comment 19 Liu Shukui 2020-08-05 08:31:51 UTC
> Hi, the bug reproducer has the same result on both sles12sp5  and sles15sp2,
> is the bug fixed?
> 
> s15sp2:~/Documents # perl CVE-2016-9180.pl 1
> <?xml version="1.0"?>
> <!DOCTYPE foo [
> <!ENTITY xxe PUBLIC "bar" "boom.txt">
> ]>
> <root>Boom!
> </root>s15sp2:~/Documents # perl CVE-2016-9180.pl 0
> <?xml version="1.0"?>
> <!DOCTYPE foo [
> <!ENTITY xxe PUBLIC "bar" "boom.txt">
> ]>
> <root>Boom!
> </root>

i.e. there is no difference between "before" and "after" updating.
Comment 20 Marcus Meissner 2020-08-06 07:42:26 UTC
Created attachment 840385 [details]
Downloads/CVE-2016-9180.pl

QA REPRODUCER:

- download also xml

echo BOOM > boom.txt

perl CVE-2016-9180.pl 0

 should show BOOM

perl CVE-2016-9180.pl 1

 should show:  cannot expand &xxe; - cannot load 'boom.txt' at /usr/lib/perl5/vendor_perl/5.30.1/x86_64-linux-thread-multi/XML/Parser/Expat.pm line 480.
Comment 21 Liu Shukui 2020-08-06 08:41:06 UTC
(In reply to Marcus Meissner from comment #20)
> Created attachment 840385 [details]
> Downloads/CVE-2016-9180.pl
> 
> QA REPRODUCER:
> 
> - download also xml
> 
> echo BOOM > boom.txt
> 
> perl CVE-2016-9180.pl 0
> 
>  should show BOOM
> 
> perl CVE-2016-9180.pl 1
> 
>  should show:  cannot expand &xxe; - cannot load 'boom.txt' at
> /usr/lib/perl5/vendor_perl/5.30.1/x86_64-linux-thread-multi/XML/Parser/Expat.
> pm line 480.

same result whether updating or not.

s15sp2:~/Documents # cat CVE-2016-9180.pl 
use XML::Twig; my $twig = XML::Twig->new( no_xxe => $ARGV[0] ); $twig->parsefile( "CVE-2016-9180.xml"); $twig->print;

s15sp2:~/Documents # perl CVE-2016-9180.pl 0
<?xml version="1.0"?>
<!DOCTYPE foo [
<!ENTITY xxe PUBLIC "bar" "boom.txt">
]>
<root>BOOM
</root>s15sp2:~/Documents # perl CVE-2016-9180.pl 1
cannot expand &xxe; - cannot load 'boom.txt' at /usr/lib/perl5/vendor_perl/5.26.1/x86_64-linux-thread-multi/XML/Parser/Expat.pm line 474.
 at CVE-2016-9180.pl line 1.
 at CVE-2016-9180.pl line 1.
Comment 22 Marcus Meissner 2020-08-07 08:12:07 UTC
this output means it was fixed befiore... in changes it shows perl-XML-Twig 3.50 has the fix already.

Our SLE15 update has as diff only testsuite changes and no functional changes.
Comment 23 Swamp Workflow Management 2020-08-07 19:14:18 UTC
SUSE-SU-2020:2173-1: An update that fixes one vulnerability is now available.

Category: security (moderate)
Bug References: 1008644
CVE References: CVE-2016-9180
JIRA References: 
Sources used:
SUSE Linux Enterprise Server 12-SP5 (src):    perl-XML-Twig-3.44-5.3.1

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
Comment 24 Swamp Workflow Management 2020-08-07 19:15:07 UTC
SUSE-SU-2020:2172-1: An update that fixes one vulnerability is now available.

Category: security (moderate)
Bug References: 1008644
CVE References: CVE-2016-9180
JIRA References: 
Sources used:
SUSE Linux Enterprise Module for Basesystem 15-SP2 (src):    perl-XML-Twig-3.52-3.3.1
SUSE Linux Enterprise Module for Basesystem 15-SP1 (src):    perl-XML-Twig-3.52-3.3.1

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
Comment 25 Swamp Workflow Management 2020-08-10 22:12:48 UTC
openSUSE-SU-2020:1177-1: An update that fixes one vulnerability is now available.

Category: security (moderate)
Bug References: 1008644
CVE References: CVE-2016-9180
JIRA References: 
Sources used:
openSUSE Leap 15.1 (src):    perl-XML-Twig-3.52-lp151.3.3.1
Comment 26 Swamp Workflow Management 2020-08-14 19:14:56 UTC
openSUSE-SU-2020:1204-1: An update that fixes one vulnerability is now available.

Category: security (moderate)
Bug References: 1008644
CVE References: CVE-2016-9180
JIRA References: 
Sources used:
openSUSE Leap 15.2 (src):    perl-XML-Twig-3.52-lp152.4.3.1
Comment 27 Swamp Workflow Management 2021-03-01 20:26:49 UTC
SUSE-SU-2020:2173-2: An update that fixes one vulnerability is now available.

Category: security (moderate)
Bug References: 1008644
CVE References: CVE-2016-9180
JIRA References: 
Sources used:
SUSE OpenStack Cloud Crowbar 9 (src):    perl-XML-Twig-3.44-5.3.1
SUSE OpenStack Cloud Crowbar 8 (src):    perl-XML-Twig-3.44-5.3.1
SUSE OpenStack Cloud 9 (src):    perl-XML-Twig-3.44-5.3.1
SUSE OpenStack Cloud 8 (src):    perl-XML-Twig-3.44-5.3.1
SUSE OpenStack Cloud 7 (src):    perl-XML-Twig-3.44-5.3.1
SUSE Linux Enterprise Server for SAP 12-SP4 (src):    perl-XML-Twig-3.44-5.3.1
SUSE Linux Enterprise Server for SAP 12-SP3 (src):    perl-XML-Twig-3.44-5.3.1
SUSE Linux Enterprise Server for SAP 12-SP2 (src):    perl-XML-Twig-3.44-5.3.1
SUSE Linux Enterprise Server 12-SP4-LTSS (src):    perl-XML-Twig-3.44-5.3.1
SUSE Linux Enterprise Server 12-SP3-LTSS (src):    perl-XML-Twig-3.44-5.3.1
SUSE Linux Enterprise Server 12-SP3-BCL (src):    perl-XML-Twig-3.44-5.3.1
SUSE Linux Enterprise Server 12-SP2-LTSS (src):    perl-XML-Twig-3.44-5.3.1
SUSE Linux Enterprise Server 12-SP2-BCL (src):    perl-XML-Twig-3.44-5.3.1
HPE Helion Openstack 8 (src):    perl-XML-Twig-3.44-5.3.1

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
Comment 28 Carlos López 2022-09-16 11:41:49 UTC
Released, closing.