HadoopApplication · Apache

CVE-2022-25168

CRITICAL · 9.8 CVSS v3.1 Published 2022-08-04
Fix available
A fix is available. Upgrade to after 3.3.2 or later.
See remediation →
100/100
Remediation priority · Urgent
Remotely reachable No privileges Zero-click

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
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).

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · high confidence

Apache Hadoop's FileUtil.unTar(File, File) API fails to sanitize input file names before passing them to shell execution, allowing command injection via crafted filenames. While Hadoop 3.3 only exposes this through local-user accessible code (InMemoryAliasMap), Hadoop 2.x uses this in yarn localization enabling remote code execution. Apache Spark's ADD ARCHIVE command also uses this vulnerable code path.

MitigationUpgrade Apache Hadoop to version 2.10.2, 3.2.4, 3.3.3 or higher to obtain the patch (HADOOP-18136) that checks file existence before untarring/zipping, preventing shell command execution.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.

NVD · CPE data
HadoopApplication
Affected:>= 2.0.0, <= 2.10.1>= 3.0.0, <= 3.2.3>= 3.3.0, <= 3.3.2

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Network
Complexity
Low
Privileges
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Identify installed Hadoop version
    Run 'hadoop version' or check the hadoop-common JAR manifest in /usr/lib/hadoop/lib/ or your Hadoop installation path. Also check if 'yarn version' is available.
    Affected if Version is 2.0.0-2.10.1, 3.0.0-3.2.3, or 3.3.0-3.3.2
  2. Determine if YARN NodeManager is running
    Check if the YARN NodeManager process is active: run 'ps aux | grep nodemanager' or check for yarn-site.xml with yarn.nodemanager.hostname configured. Also verify yarn.resourcemanager.hostname is set.
    Affected if YARN NodeManager is running and Hadoop version is 2.x in the affected range, enabling yarn localization code path that uses FileUtil.unTar.
  3. Check YARN local directory configuration
    Inspect yarn-site.xml for 'yarn.nodemanager.local-dirs' property. This defaults to /tmp/hadoop-yarn/ or /var/tmp/hadoop-yarn/. Verify this directory allows user-write access.
    Affected if YARN local directories are configured and writable by users, allowing untrusted archive files to be processed through the vulnerable untar code path.
  4. Check for Spark ADD ARCHIVE usage
    Review Spark application code or configurations for 'ADD ARCHIVE' commands in spark-submit or Spark SQL. Check spark logs for archive extraction operations.
    Affected if Spark is used with ADD ARCHIVE commands to extract archives, as Spark's implementation calls the vulnerable FileUtil.unTar API.
  5. Check InMemoryAliasMap configuration (Hadoop 3.3.x only)
    For Hadoop 3.3.x versions, check yarn-site.xml for 'yarn.nodemanager.alias-map' configuration or look for InMemoryAliasMap initialization in nodemanager logs.
    Affected if InMemoryAliasMap is enabled in Hadoop 3.3.0-3.3.2, providing a local code path to the vulnerable FileUtil.unTar method.

You are affected if you run any Hadoop version in the ranges 2.0.0-2.10.1, 3.0.0-3.2.3, or 3.3.0-3.3.2 AND use YARN localization with untrusted archives or use Spark ADD ARCHIVE commands, or (for Hadoop 3.3.x only) have InMemoryAliasMap enabled.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Upgrade available Upgrade to a release after 3.3.2
Interim mitigation

Upgrade Apache Hadoop to version 2.10.2, 3.2.4, 3.3.3 or higher to obtain the patch (HADOOP-18136) that checks file existence before untarring/zipping, preventing shell command execution.

Recommended fix High confidence

Apache Hadoop 2.10.2 (for 2.x), 3.2.4 (for 3.2.x), or 3.3.3+ (for 3.3.x)

  1. 1. Identify the current Apache Hadoop version in use by checking the hadoop-common or hadoop-client dependency version in your project/build configuration
  2. 2. For Hadoop 2.x users (versions <= 2.10.1): Upgrade to Hadoop 2.10.2 or later
  3. 3. For Hadoop 3.2.x users (versions <= 3.2.3): Upgrade to Hadoop 3.2.4 or later
  4. 4. For Hadoop 3.3.x users (versions <= 3.3.2): Upgrade to Hadoop 3.3.3 or later
  5. 5. After upgrading, verify that the FileUtil.unTar API properly validates file existence before processing to prevent command injection
  6. 6. If immediate upgrade is not possible, ensure that untrusted files are not passed to the FileUtil.unTar or FileUtil.unZip methods and that file paths are validated to exist before being processed
Caveat Standard upgrade considerations apply - review release notes for any API or configuration changes between your current version and the target upgrade version. Minor version upgrades within the same major.minor branch typically have minimal breaking changes.

Generated from the published advisory — verify against the referenced sources before acting.

Fix this in Hadoop Scoped from the published advisory
  • Consultation4.0 h
  • Implementation8.0 h
  • Testing4.0 h
  • Review / QA2.0 h
18.0 hours of engineering $3,200
Get the upgrade done

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $5,120.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2022-25168 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2022-25168 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data