Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 1562246 - (CVE-2018-1102) CVE-2018-1102 source-to-image: Improper path sanitization in ExtractTarStreamFromTarReader in tar/tar.go
CVE-2018-1102 source-to-image: Improper path sanitization in ExtractTarStream...
Status: CLOSED ERRATA
Product: Security Response
Classification: Other
Component: vulnerability (Show other bugs)
unspecified
All Linux
urgent Severity urgent
: ---
: ---
Assigned To: Red Hat Product Security
impact=critical,public=20180427,repor...
: Security
Depends On: 1563883 1563884 1563885 1563886 1563887 1563941 1564032 1564282 1568135 1568418 1568419
Blocks: 1562249
  Show dependency treegraph
 
Reported: 2018-03-29 17:19 EDT by Pedro Sampaio
Modified: 2018-10-09 12:26 EDT (History)
28 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
A flaw was found in source-to-image function as shipped with Openshift Enterprise 3.x. An improper path validation of tar files in ExtractTarStreamFromTarReader in tar/tar.go leads to privilege escalation.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2018-05-17 11:43:22 EDT
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-2018:1227 None None None 2018-04-27 23:36 EDT
Red Hat Product Errata RHSA-2018:1229 None None None 2018-04-28 07:56 EDT
Red Hat Product Errata RHSA-2018:1231 None None None 2018-04-29 10:36 EDT
Red Hat Product Errata RHSA-2018:1233 None None None 2018-04-30 00:00 EDT
Red Hat Product Errata RHSA-2018:1235 None None None 2018-04-30 01:01 EDT
Red Hat Product Errata RHSA-2018:1237 None None None 2018-04-30 01:26 EDT
Red Hat Product Errata RHSA-2018:1239 None None None 2018-04-29 15:39 EDT
Red Hat Product Errata RHSA-2018:1241 None None None 2018-04-29 15:45 EDT
Red Hat Product Errata RHSA-2018:1243 None None None 2018-04-29 15:48 EDT

  None (edit)
Description Pedro Sampaio 2018-03-29 17:19:33 EDT
A flaw was found in source-to-image as shipped with Openshift Enterprise 3.6. A improper path validation of tar files in ExtractTarStreamFromTarReader in tar/tar.go leads to privilege escalation.
Comment 6 Jason Shepherd 2018-04-04 21:18:29 EDT
The source-to-image (S2I/STI) builder in OpenShift 3.4-3.9 contains a vulnerability allowing an attacker to gain root access on
the host system. The underlying cause is comparable to an issue in Kubernetes' kubectl (and "oc") which was reported publicly on the 25th March 2018 [1]. 

[1] https://github.com/kubernetes/kubernetes/issues/61297

OpenShift contains similar code as part of its S2I module, specifically in "openshift/source-to-image/pkg/tar/tar.go:ExtractTarStreamFromTarReader". Paths
from a tar archive are used as input to "filepath.Join" without further sanitation. "ExtractTarStreamFromTarReader" is also used on the client side by "oc rsync". S2I uses the code to unpack artifacts in its main container.
Comment 11 Trevor Jay 2018-04-05 06:55:41 EDT
Some observations:

*Flaw is not in the GO tar implementation but is in the failure to restrict the execution context. The writing is done by a process with inflated privileges. S2I in general has too many privileges for a service that processes Turing complete user input.
* Major area of concern is within S2I, but other affected areas are known to exist.
Comment 13 Jason Shepherd 2018-04-05 20:00:11 EDT
Acknowledgments:

Name: Michael Hanselmann (hansmi.ch)
Comment 31 Kurt Seifried 2018-04-27 14:20:55 EDT
External References:

https://access.redhat.com/security/vulnerabilities/3422241
Comment 33 Kurt Seifried 2018-04-27 16:07:50 EDT
Mitigation:

Customers can turn off the source-to-image (S2I) build strategy to prevent access to the exploitable function.  Information about how to disable the source-to-image build strategy is in the product documentation.

* Disabling S2I in OpenShift Enterprise 3.0 - https://docs.openshift.com/enterprise/3.0/admin_guide/securing_builds.html#disabling-a-build-strategy-globally
* Disabling S2I in OpenShift Enterprise 3.1 - https://docs.openshift.com/enterprise/3.1/admin_guide/securing_builds.html#disabling-a-build-strategy-globally
* Disabling S2I in OpenShift Enterprise 3.2 - https://docs.openshift.com/enterprise/3.2/admin_guide/securing_builds.html#disabling-a-build-strategy-globally
* Disabling S2I in OpenShift Enterprise 3.3 - https://access.redhat.com/documentation/en-us/openshift_container_platform/3.3/html/cluster_administration/admin-guide-securing-builds
* Disabling S2I in OpenShift Enterprise 3.4 - https://access.redhat.com/documentation/en-us/openshift_container_platform/3.4/html/cluster_administration/admin-guide-securing-builds
* Disabling S2I in OpenShift Enterprise 3.5 - https://access.redhat.com/documentation/en-us/openshift_container_platform/3.5/html/cluster_administration/admin-guide-securing-builds
* Disabling S2I in OpenShift Enterprise 3.6 - https://access.redhat.com/documentation/en-us/openshift_container_platform/3.6/html/cluster_administration/admin-guide-securing-builds
* Disabling S2I in OpenShift Enterprise 3.7 - https://access.redhat.com/documentation/en-us/openshift_container_platform/3.7/html/cluster_administration/admin-guide-securing-builds
* OpenShift Enterprise 3.8 is not a production version (only for upgrades).
* Disabling S2I in OpenShift Enterprise 3.9 - https://access.redhat.com/documentation/en-us/openshift_container_platform/3.9/html/cluster_administration/admin-guide-securing-builds
Comment 34 errata-xmlrpc 2018-04-27 23:36:32 EDT
This issue has been addressed in the following products:

  Red Hat OpenShift Container Platform 3.9

Via RHSA-2018:1227 https://access.redhat.com/errata/RHSA-2018:1227
Comment 35 errata-xmlrpc 2018-04-28 07:56:26 EDT
This issue has been addressed in the following products:

  Red Hat OpenShift Container Platform 3.8

Via RHSA-2018:1229 https://access.redhat.com/errata/RHSA-2018:1229
Comment 36 errata-xmlrpc 2018-04-29 10:36:35 EDT
This issue has been addressed in the following products:

  Red Hat OpenShift Container Platform 3.7

Via RHSA-2018:1231 https://access.redhat.com/errata/RHSA-2018:1231
Comment 37 errata-xmlrpc 2018-04-29 15:39:00 EDT
This issue has been addressed in the following products:

  Red Hat OpenShift Container Platform 3.3

Via RHSA-2018:1239 https://access.redhat.com/errata/RHSA-2018:1239
Comment 38 errata-xmlrpc 2018-04-29 15:44:50 EDT
This issue has been addressed in the following products:

  Red Hat OpenShift Container Platform 3.2

Via RHSA-2018:1241 https://access.redhat.com/errata/RHSA-2018:1241
Comment 39 errata-xmlrpc 2018-04-29 15:48:41 EDT
This issue has been addressed in the following products:

  Red Hat OpenShift Enterprise 3.1

Via RHSA-2018:1243 https://access.redhat.com/errata/RHSA-2018:1243
Comment 40 errata-xmlrpc 2018-04-30 00:00:15 EDT
This issue has been addressed in the following products:

  Red Hat OpenShift Container Platform 3.6

Via RHSA-2018:1233 https://access.redhat.com/errata/RHSA-2018:1233
Comment 41 errata-xmlrpc 2018-04-30 01:00:57 EDT
This issue has been addressed in the following products:

  Red Hat OpenShift Container Platform 3.5

Via RHSA-2018:1235 https://access.redhat.com/errata/RHSA-2018:1235
Comment 42 errata-xmlrpc 2018-04-30 01:26:47 EDT
This issue has been addressed in the following products:

  Red Hat OpenShift Container Platform 3.4

Via RHSA-2018:1237 https://access.redhat.com/errata/RHSA-2018:1237
Comment 44 Jason Shepherd 2018-09-10 01:44:58 EDT
OpenShift Origin commit:

https://github.com/openshift/origin/commit/feca06be8b5a70d10d62a81938808e9afcaed372

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