Bug 2073923 (CVE-2022-26612)

Summary: CVE-2022-26612 hadoop: Arbitrary file write in FileUtil#unpackEntries on Windows
Product: [Other] Security Response Reporter: Avinash Hanwate <ahanwate>
Component: vulnerabilityAssignee: Nobody <nobody>
Status: NEW --- QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: unspecifiedCC: aileenc, aos-bugs, asoldano, ataylor, bbaranow, bmaxwell, bmontgom, brian.stansberry, cdewolf, chazlett, ctubbsii, darran.lofthouse, denis.arnaud_fedora, dkreling, dosoudil, eglynn, eparis, ewolinet, extras-orphan, fjuma, gmalinko, gparvin, iweiss, janstey, jburrell, jcantril, jjoyce, jnethert, jochrist, jokerman, jolee, jross, jschatte, jwon, lgao, lhh, loleary, mburns, milleruntime, mosmerov, msochure, msvehla, njean, nstielau, nwallace, pahickey, pantinor, pdelbell, pjindal, pmackay, rareddy, rstancel, rsvoboda, smaestri, spinder, sponnaga, spower, stcannon, swoodman, theute, tom.jenkinson, vkumar
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Apache Hadoop 3.2.3 Doc Type: If docs needed, set a value
Doc Text:
A flaw was found in Apache Hadoop, where an unTar function bypasses a check. This flaw allows an attacker to write outside of the expected base directory on Windows.
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: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2076231, 2076232, 2076233, 2076234, 2076235, 2076236    
Bug Blocks: 2073924    

Description Avinash Hanwate 2022-04-11 06:53:10 UTC
In Apache Hadoop, The unTar function uses unTarUsingJava function on Windows and the built-in tar utility on Unix and other OSes. As a result, a TAR entry may create a symlink under the expected extraction directory which points to an external directory. A subsequent TAR entry may extract an arbitrary file into the external directory using the symlink name. This however would be caught by the same targetDirPath check on Unix because of the getCanonicalPath call. However on Windows, getCanonicalPath doesn't resolve symbolic links, which bypasses the check. unpackEntries during TAR extraction follows symbolic links which allows writing outside expected base directory on Windows. This was addressed in Apache Hadoop 3.2.3

https://lists.apache.org/thread/hslo7wzw2449gv1jyjk8g6ttd7935fyz

Comment 1 Avinash Hanwate 2022-04-18 12:39:15 UTC
Created hadoop tracking bugs for this issue:

Affects: epel-all [bug 2076231]
Affects: fedora-all [bug 2076232]


Created openstack-sahara-tests tracking bugs for this issue:

Affects: openstack-rdo [bug 2076233]


Created python-sahara-plugin-mapr tracking bugs for this issue:

Affects: openstack-rdo [bug 2076234]