CVE-2022-25168
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 · uneditedApache 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 confidenceApache 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.
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>= 2.0.0, <= 2.10.1>= 3.0.0, <= 3.2.3>= 3.3.0, <= 3.3.2CVSS 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 checksWork through these to decide whether this CVE applies to you.
-
Identify installed Hadoop versionRun '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
-
Determine if YARN NodeManager is runningCheck 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.
-
Check YARN local directory configurationInspect 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.
-
Check for Spark ADD ARCHIVE usageReview 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.
-
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.
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 · scopedUpgrade 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.
Apache Hadoop 2.10.2 (for 2.x), 3.2.4 (for 3.2.x), or 3.3.3+ (for 3.3.x)
- 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. For Hadoop 2.x users (versions <= 2.10.1): Upgrade to Hadoop 2.10.2 or later
- 3. For Hadoop 3.2.x users (versions <= 3.2.3): Upgrade to Hadoop 3.2.4 or later
- 4. For Hadoop 3.3.x users (versions <= 3.3.2): Upgrade to Hadoop 3.3.3 or later
- 5. After upgrading, verify that the FileUtil.unTar API properly validates file existence before processing to prevent command injection
- 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
Generated from the published advisory — verify against the referenced sources before acting.
- Consultation4.0 h
- Implementation8.0 h
- Testing4.0 h
- Review / QA2.0 h
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 locallyCheck 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 sourcesPractitioner notes
ContributedPeer-ranked notes from engineers who’ve handled CVE-2022-25168 in production — separate from our analysis above.
The advisory tells you what broke. It rarely tells you what actually worked. If you’ve dealt with this one, that detail is what the next engineer is searching for.
- The version that genuinely resolved it — not the one the vendor claimed
- A config change or rule that shut the vector down
- A gotcha in the upgrade path that cost you an afternoon
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.
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.
- 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