9.8critical
Command injection in org.apache.hadoop.fs.FileUtil.unTarUsingTar
- Severity
- 9.8critical CVSS:3.1 by NVD
- Exploit likelihood
- 4.71% (higher than 92% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- apache
- Also known as
- GHSA-8wm5-8h9c-47pc
Description
Apache Hadoop's FileUtil.unTar(File, File) API does not escape the input file name before being passed to the shell. An attacker can inject arbitrary commands. This is only used in Hadoop 3.3 InMemoryAliasMap.completeBootstrapTransfer, which is only ever run by a local user. It has been used in Hadoop 2.x for yarn localization, which does enable remote code execution. It is used in Apache Spark, from the SQL command ADD ARCHIVE. As the ADD ARCHIVE command adds new binaries to the classpath, being able to execute shell scripts does not confer new permissions to the caller. SPARK-38305. "Check existence of file before untarring/zipping", which is included in 3.3.0, 3.1.4, 3.2.2, prevents shell commands being executed, regardless of which version of the hadoop libraries are in use. Users should upgrade to Apache Hadoop 2.10.2, 3.2.4, 3.3.3 or upper (including HADOOP-18136).
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Apache Software Foundation Apache Hadoop | 2.0.0 to 2.10.1, 3.0.0-alpha to 3.2.3, 3.3.0 to 3.3.2 | CVE List |
| org.apache.hadoop:hadoop-common (Maven) | from 2.0.0 before 2.10.2, from 3.0.0-alpha before 3.2.4, from 3.3.0 before 3.3.3 | GitHub Advisory Database |
| apache hadoop | from 2.0.0 up to 2.10.1, from 3.0.0 up to 3.2.3, from 3.3.0 up to 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 |
Classification
What each source says
CVE List
Apache Hadoop's FileUtil.unTar(File, File) API does not escape the input file name before being passed to the shell. An attacker can inject arbitrary commands. This is only used in Hadoop 3.3 InMemoryAliasMap.completeBootstrapTransfer, which is only ever run by a local user. It has been used in Hadoop 2.x for yarn localization, which does enable remote code execution. It is used in Apache Spark, from the SQL command ADD ARCHIVE. As the ADD ARCHIVE command adds new binaries to the classpath, being able to execute shell scripts does not confer new permissions to the caller. SPARK-38305. "Check existence of file before untarring/zipping", which is included in 3.3.0, 3.1.4, 3.2.2, prevents shell commands being executed, regardless of which version of the hadoop libraries are in use. Users should upgrade to Apache Hadoop 2.10.2, 3.2.4, 3.3.3 or upper (including HADOOP-18136).
GitHub Advisory Database
Apache Hadoop's FileUtil.unTar(File, File) API does not escape the input file name before being passed to the shell. An attacker can inject arbitrary commands. This is only used in Hadoop 3.3 InMemoryAliasMap.completeBootstrapTransfer, which is only ever run by a local user. It has been used in Hadoop 2.x for yarn localization, which does enable remote code execution. It is used in Apache Spark, from the SQL command ADD ARCHIVE. As the ADD ARCHIVE command adds new binaries to the classpath, being able to execute shell scripts does not confer new permissions to the caller. SPARK-38305. "Check existence of file before untarring/zipping", which is included in 3.3.0, 3.1.4, 3.2.2, prevents shell commands being executed, regardless of which version of the hadoop libraries are in use. Users should upgrade to Apache Hadoop 2.10.2, 3.2.4, 3.3.3 or upper (including HADOOP-18136).
NVD (es)
La API FileUtil.unTar(File, File) de Apache Hadoop no escapa el nombre del archivo de entrada antes de pasarlo al shell. Un atacante puede inyectar comandos arbitrarios. Esto sólo es usado en Hadoop versión 3.3 InMemoryAliasMap.completeBootstrapTransfer, que sólo es ejecutado un usuario local. Se ha usado en Hadoop versión 2.x para la localización de hilos, que sí permite una ejecución de código remota . Es usado en Apache Spark, desde el comando SQL ADD ARCHIVE. Como el comando ADD ARCHIVE añade nuevos binarios al classpath, el hecho de poder ejecutar scripts de shell no confiere nuevos permisos a quien lo llama. SPARK-38305. "Comprobar la existencia de un archivo antes de desarchivar/comprimir", que es incluida en versiones 3.3.0, 3.1.4 y 3.2.2, impide la ejecución de comandos de shell, independientemente de la versión de las bibliotecas de Hadoop que se esté usando. Los usuarios deben actualizar a Apache Hadoop versiones 2.10.2, 3.2.4, 3.3.3 o superior (incluyendo HADOOP-18136)
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2022-25168 changed 2024-08-03 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-8wm5-8h9c-47pc changed 2024-02-21 | CC-BY-4.0 |
| NVD | CVE-2022-25168 changed 2026-06-17 | Public domain |