CVE-2022-25168

Command injection in org.apache.hadoop.fs.FileUtil.unTarUsingTar

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).

Remediation

Workaround:

  • Users should upgrade to Apache Hadoop 2.10.2, 3.2.4, 3.3.3 or upper (including HADOOP-18136).

Category

9.8
CVSS
Severity: Critical
CVSS 3.1 •
EPSS 2.73% Top 15%
Vendor Advisory apache.org
Affected: Apache Software Foundation Apache Hadoop
Published at:
Updated at:

References

Frequently Asked Questions

What is the severity of CVE-2022-25168?
CVE-2022-25168 has been scored as a critical severity vulnerability.
How to fix CVE-2022-25168?
As a workaround for remediating CVE-2022-25168: Users should upgrade to Apache Hadoop 2.10.2, 3.2.4, 3.3.3 or upper (including HADOOP-18136).
Is CVE-2022-25168 being actively exploited in the wild?
It is possible that CVE-2022-25168 is being exploited or will be exploited in a near future based on public information. According to its EPSS score, there is a ~3% probability that this vulnerability will be exploited by malicious actors in the next 30 days.
What software or system is affected by CVE-2022-25168?
CVE-2022-25168 affects Apache Software Foundation Apache Hadoop.
This platform uses data from the NIST NVD, MITRE CVE, MITRE CWE, First.org and CISA KEV but is not endorsed or certified by these entities. CVE is a registred trademark of the MITRE Corporation and the authoritative source of CVE content is MITRE's CVE web site. CWE is a registred trademark of the MITRE Corporation and the authoritative source of CWE content is MITRE's CWE web site.
© 2025 Under My Watch. All Rights Reserved.