title: Arbitrary file write in FileUtil#unpackEntries on Windows
description: 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
problem types: unpackEntries during TAR extraction follows symbolic links which allows writing outside expected base directory on Windows
affected:
{
platforms: Windows
product: Apache Hadoop
vendor: Apache Software Foundation
versions:
lessThan: 3.2.3, status: affected, version: unspecified, versionType: custom
status: affected, version: 3.3.1
status: affected, version: 3.3.2
lessThan: All*, status: unaffected, version: 3.4, versionType: custom
}
metrics:
other: [
content: {'other': 'high'}
type: unknown
]