Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1362601 - (CVE-2016-5418) CVE-2016-5418 libarchive: Archive Entry with type 1 (hardlink), but has a non-zero data size file overwrite
CVE-2016-5418 libarchive: Archive Entry with type 1 (hardlink), but has a non...
Status: NEW
Product: Security Response
Classification: Other
Component: vulnerability (Show other bugs)
unspecified
All Linux
high Severity high
: ---
: ---
Assigned To: Red Hat Product Security
impact=important,public=20160912,repo...
: Security
Depends On: 1375280 1365774 1365775 1365777 1365778 1369565 1369566 1375281 1375282
Blocks: 1361631
  Show dependency treegraph
 
Reported: 2016-08-02 11:28 EDT by Kurt Seifried
Modified: 2018-06-29 18:13 EDT (History)
23 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
A flaw was found in the way libarchive handled hardlink archive entries of non-zero size. Combined with flaws in libarchive's file system sandboxing, this issue could cause an application using libarchive to overwrite arbitrary files with arbitrary data from the archive.
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:1844 normal SHIPPED_LIVE Important: libarchive security update 2016-09-12 20:11:35 EDT
Red Hat Product Errata RHSA-2016:1850 normal SHIPPED_LIVE Important: libarchive security update 2016-09-12 19:54:24 EDT
Red Hat Product Errata RHSA-2016:1852 normal SHIPPED_LIVE Important: Red Hat OpenShift Enterprise 3.1 security update 2016-09-12 17:34:31 EDT
Red Hat Product Errata RHSA-2016:1853 normal SHIPPED_LIVE Important: Red Hat OpenShift Enterprise 3.2 security update and bug fix update 2016-09-12 17:33:16 EDT

  None (edit)
Description Kurt Seifried 2016-08-02 11:28:20 EDT
Insomnia Security (as part of a pre-arranged commercial engagement) reports:

A vulnerability in libarchive exists that allows an archive Entry with type 1 (hardlink), but has a non-zero data size to cause a file overwrite. This vulnerability can be leveraged in a way that has a significant security impact (this was not clear at first during initial research by upstream).
Comment 3 Doran Moppert 2016-08-10 03:23 EDT
Created attachment 1189473 [details]
patch for all issues against libarchive 3.1.2
Comment 4 Doran Moppert 2016-08-10 03:27 EDT
Created attachment 1189474 [details]
patch for all issues against libarchive 2.8.3

Patches against libarchive 3.1.2 (rhel-7) and libarchive 2.8.3 (rhel-6) attached.

Upstream have no timeline for fixing at this point.  The attached patches mitigate the issues on rhel-7/6 but may not be acceptable to upstream in their current form.  We are in contact with the upstream developer and sharing these patches with him, and will attempt to seek a compatible solution which makes rebasing easy against the next upstream release which addresses these flaws.
Comment 7 Doran Moppert 2016-08-11 21:10:06 EDT
Hi Petr,

great to see the patch go into testing so fast.  Is it possible to get PIE enabled in this build?  Using the instructions referenced in comment 5, the following seems to work:

~~~~
--- a/libarchive.spec
+++ b/libarchive.spec
@@ -89,6 +89,7 @@ Requires:       %{name} = %{version}-%{release}
 The bsdcpio package contains standalone bsdcpio utility split off regular
 libarchive packages.
 
+%global _hardened_build 1
 
 %prep
 %setup -q -n %{name}-%{version}
~~~~

Checking with commands from sgrubb's rpm-chksec (https://github.com/stevegrubb/security-assessor/):

~~~~
$ readelf -h bsdtar | grep Type: 
  Type:                              DYN (Shared object file)
$ readelf -d bsdtar | grep '(DEBUG)'
 0x0000000000000015 (DEBUG)              0x0
~~~~
Comment 8 Doran Moppert 2016-08-12 00:48 EDT
Created attachment 1190259 [details]
patch for repro-5 (hardlink to ..) against libarchive 3.1.2
Comment 9 Doran Moppert 2016-08-12 00:51 EDT
Created attachment 1190260 [details]
patch for repro-5 (hardlink to ..) against libarchive 2.8.3

Further patches attached (*-patch2.patch).

These address a variation on repro-4 which the previous patch did not include.  They should be applied after the patches 1189473 and 1189474.
Comment 11 Petr Kubat 2016-08-12 03:07:52 EDT
Hi Doran,

Sorry I must have missed your previous comment regarding PIE.
I will enable it in the next build. The patch you have provided in comment 7 seems to do the trick, thanks.
Comment 14 Kurt Seifried 2016-08-24 22:21:20 EDT
Acknowledgments:

Name: Insomnia Security
Comment 17 Kurt Seifried 2016-09-12 11:22:36 EDT
Created libarchive tracking bugs for this issue:

Affects: epel-5 [bug 1375281]
Affects: fedora-all [bug 1375282]
Comment 18 Kurt Seifried 2016-09-12 11:22:48 EDT
Created libarchive3 tracking bugs for this issue:

Affects: epel-6 [bug 1375280]
Comment 19 errata-xmlrpc 2016-09-12 13:35:53 EDT
This issue has been addressed in the following products:

  Red Hat OpenShift Enterprise 3.2

Via RHSA-2016:1853 https://access.redhat.com/errata/RHSA-2016:1853
Comment 20 errata-xmlrpc 2016-09-12 13:36:52 EDT
This issue has been addressed in the following products:

  Red Hat OpenShift Enterprise 3.1

Via RHSA-2016:1852 https://access.redhat.com/errata/RHSA-2016:1852
Comment 21 errata-xmlrpc 2016-09-12 15:57:31 EDT
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 6

Via RHSA-2016:1850 https://rhn.redhat.com/errata/RHSA-2016-1850.html
Comment 22 errata-xmlrpc 2016-09-12 16:16:16 EDT
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2016:1844 https://rhn.redhat.com/errata/RHSA-2016-1844.html
Comment 23 Doran Moppert 2016-09-13 19:59:11 EDT
Lifted the private flag from patches since this is now fully public.

Upstream has already progressed with committing the forward-ported versions plus further hardening due to Pavel Raiskup to trunk.

https://github.com/libarchive/libarchive/commits/master

Big kudos to Tim Kientzle (upstream) and Pavel Raiskup (red hat) for being a pleasure to work with on these issues.

Note You need to log in before you can comment on or make changes to this bug.