9.8critical
Arbitrary file write in FileUtil#unpackEntries on Windows
- Severity
- 9.8critical CVSS:3.1 by NVD
- Exploit likelihood
- 4.24% (higher than 91% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- apache
- Also known as
- GHSA-gx2c-fvhc-ph4j
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
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Apache Software Foundation Apache Hadoop | from unspecified before 3.2.3, 3.3.1, 3.3.2 Not affected: from 3.4 before All* | CVE List |
| org.apache.hadoop:hadoop-common (Maven) | from 3.2.0 before 3.2.3, before 2.10.2, from 3.3.0 before 3.3.3 | GitHub Advisory Database |
| apache hadoop | before 3.2.3, 3.3.1, 3.3.2 | NVD |
All scores
| GitHub | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 7.5high CVSS:2.0 | AV:N/AC:L/Au:N/C:P/I:P/A:P |
Classification
What each source says
CVE List
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
GitHub Advisory Database
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 2.10.2, 3.2.3, 3.3.3, and 3.4.0.
NVD (es)
En Apache Hadoop, la función unTar usa la función unTarUsingJava en Windows y la utilidad tar incorporada en Unix y otros sistemas operativos. Como resultado, una entrada TAR puede crear un enlace simbólico bajo el directorio de extracción esperado que apunta a un directorio externo. Una entrada TAR posterior puede extraer un archivo arbitrario en el directorio externo usando el nombre del enlace simbólico. Sin embargo, esto sería detectado por la misma comprobación targetDirPath en Unix debido a la llamada getCanonicalPath. Sin embargo, en Windows, getCanonicalPath no resuelve los enlaces simbólicos, lo que evita la comprobación. unpackEntries durante la extracción del TAR sigue los enlaces simbólicos, lo que permite escribir fuera del directorio base esperado en Windows. Esto ha sido abordado en Apache Hadoop versión 3.2.3
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2022-26612 changed 2024-08-03 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-gx2c-fvhc-ph4j changed 2025-10-01 | CC-BY-4.0 |
| NVD | CVE-2022-26612 changed 2026-06-17 | Public domain |