CVE-2022-26612
Path traversal in Hadoop
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 2.10.2, 3.2.3, 3.3.3, and 3.4.0.
Affected Maven artifacts (1)
| Artifact | Affected versions | Fixed in |
|---|---|---|
| org.apache.hadoop » hadoop-common | < 2.10.2>= 3.2.0, < 3.2.3>= 3.3.0, < 3.3.3 | 2.10.2, 3.2.3, 3.3.3 |
Blast radius
65% of the dependent artifacts (5,562) still pull an affected version in their latest release.
| Depth | Dependent versions |
|---|---|
| Direct | 267,203 |
| 2 hops | 264,940 |
| 3 hops | 188,959 |
| 4 hops | 69,785 |
| 5 hops | 53,480 |
| 6 hops | 24,317 |
Most used dependents
- org.apache.spark » spark-sql3,174 usages
- org.apache.kafka » kafka-clients3,135 usages
- org.apache.spark » spark-core2,899 usages
- org.apache.hadoop » hadoop-client1,796 usages
- org.apache.kafka » kafka1,450 usages
- org.apache.hadoop » hadoop-hdfs1,377 usages
- org.apache.hadoop » hadoop-mapreduce-client-core1,366 usages
- org.apache.kafka » connect-api1,026 usages
- org.apache.flink » flink-streaming-java982 usages
- org.apache.hbase » hbase-client960 usages
- org.apache.hadoop » hadoop-core855 usages
- org.apache.spark » spark-mllib831 usages
- org.apache.solr » solr-solrj784 usages
- org.apache.hive » hive-exec699 usages
- org.apache.hbase » hbase-common674 usages
Computed from the dependency graph of build 20261124.0621 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.
References
- Advisoryhttps://nvd.nist.gov/vuln/detail/CVE-2022-26612
- Packagehttps://github.com/apache/hadoop
- Webhttps://github.com/apache/hadoop/commits/rel/release-2.10.2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileUtil.java
- Webhttps://github.com/apache/hadoop/commits/rel/release-3.2.3/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileUtil.java
- Webhttps://github.com/apache/hadoop/commits/rel/release-3.3.3/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileUtil.java
- Webhttps://github.com/apache/hadoop/commits/rel/release-3.4.0/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileUtil.java
- Webhttps://issues.apache.org/jira/browse/HADOOP-18317
- Webhttps://lists.apache.org/thread/hslo7wzw2449gv1jyjk8g6ttd7935fyz
- Webhttps://security.netapp.com/advisory/ntap-20220519-0004
