Intel

AIKIDO-2026-351598

unearth is vulnerable to Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

CVE-2026-73030Published Oct 30, 2026
October 30, 2026

75

CVE Score

High

Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

Are you affected? Scan for Free

TL;DR

unearth's _untar_archive function in src/unearth/preparer.py extracts tar archives downloaded by its package-link preparer, using is_within_directory to confirm that each extracted member stays within the target location. Before 0.18.3, this containment check compared raw, non-resolved paths and performed no explicit validation of symlink member targets before calling tar._extract_member, so a crafted archive member (via ../ path segments or a symlink entry) could resolve outside the extraction directory. The default configuration supplies the archive filename and destination location as determined by unearth's own download/preparer flow when processing a resolved package distribution. The fix in 0.18.3 resolves both the member path and the target directory with os.path.realpath() before the relative_to() check, computes and validates each symlink member's absolute/relative link target against the extraction location, skipping (with a warning) any symlink that would escape it, and replaces os.makedirs with safe_makedirs so created directories stay under the extraction location.

How do I fix this?

Upgrade the unearth package to version 0.18.3 or later.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and your tooling uses unearth to download and extract tar-format source distributions from untrusted or externally hosted package indexes.

Package

Versions

0.2.0 - 0.18.2

Fixed in 0.18.3

Background info

unearth is vulnerable to Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in versions 0.2.0 - 0.18.2.

Get secure today,
quickly and for free.

Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.

No credit card required | Scan results in 32 seconds.

Trusted by 150k+ orgs
  • Revolut
  • n8n
  • Lovable
  • Deel
  • Prove
  • Omnea