PyPI / distlib / 0.4.4

distlib 0.4.4

Source
https://github.com/pypa/distlib
Tag scanned
0.4.4
Compared with
0.4.3 (0 signals introduced since)
Files
87 scanned, 88 skipped (binary, oversized, or unrecognised)
Signals
0 critical · 0 warn · 16 info
Scan time
4.9 s
LLM review
Reviewed by claude-haiku-5-5 (Anthropic): 5 of 5 warn and critical signals; 5 demoted to info.
Disclude version
4.1.0
Scanned (UTC)
2026-10-22 03:01

Signals

Ordered by severity, then signals introduced in this release. Hidden characters are shown as ⟨U+…⟩.

  1. info warn → info by review decoder-decompress-payload distlib/locators.py:603:20

    file imports decoder module(s) gzip, zlib and calls `.decompress()` — embedded payload decompressed at runtime (ast pass, confidence 0.75)

            limit = self.decode_size_limit
            produced = decompressor.decompress(data, limit + 1)
            if len(produced) > limit or decompressor.unconsumed_tail:
                raise DistlibException('Decompressed index response exceeds '
    likely benign LLM, confidence 0.85 Bounded decompression of an index HTTP response in distlib's package locator.
    Reasoning

    The snippet shows decompress with a size limit (decode_size_limit) on an index response, a defensive bounded decompression pattern common in HTTP response handling. The decompressor usage is legitimate and the bomb-guard is visible.

  2. info critical → info by review dynamic-import distlib/resources.py:339:13

    `__import__` called on a non-literal expression (ast pass, confidence 0.70)

            if package not in sys.modules:
                __import__(package)
            module = sys.modules[package]
            path = getattr(module, '__path__', None)
    likely benign LLM, confidence 0.85 Importing a package by name to locate its resources via __path__.
    Reasoning

    Dynamic __import__ of a package name is the standard way distlib's resource finder loads a package by name before reading its __path__. Flagged as critical by the rule, but this is a known legitimate idiom in a packaging library; the package name is a caller-supplied module name, not attacker-controlled payload.

  3. info critical → info by review dynamic-import distlib/util.py:680:15

    `__import__` called on a non-literal expression (ast pass, confidence 0.70)

        else:
            mod = __import__(module_name)
        if dotted_path is None:
            result = mod
    likely benign LLM, confidence 0.85 Dynamic module import while resolving a dotted path to an object in distlib util.
    Reasoning

    Resolving a dotted path by importing module_name via __import__ is the usual resolver pattern for string-named callables in utility code. No encoding or hidden source is present; the module name is a configuration input.

  4. info warn → info by review whitespace-anomaly docs/tutorial.rst:1007:5

    invisible whitespace U+00A0 in indentation (raw pass, confidence 0.80)

       └── nested
        ⟨U+00A0⟩⟨U+00A0⟩ └── nested_resource.bin
    
    Access to resources in the file system
    dismissed LLM, confidence 0.90 A non-breaking space character in indentation of a documentation tree listing.
    Reasoning

    A non-breaking space in the indentation of an RST tree diagram is a common copy-paste artifact in documentation. It has no code effect and is not a hidden instruction or payload.

  5. info dynamic-execution tests/minimext/build_wheels.sh:59:5

    command name is a variable (`$dryrun`) that this file sets only to plain text (ast pass, confidence 0.40)

        set -x
        ${dryrun} sudo add-apt-repository ppa:deadsnakes/ppa
        set +x
      fi
  6. info dynamic-execution tests/minimext/build_wheels.sh:70:5

    command name is a variable (`$dryrun`) that this file sets only to plain text (ast pass, confidence 0.40)

        set -x
        ${dryrun} sudo apt install "${PYTHON_APT_PACKAGES[@]}"
        set +x
      fi
  7. info dynamic-execution tests/minimext/build_wheels.sh:85:10

    command name is a variable (`$dryrun`) that this file sets only to plain text (ast pass, confidence 0.40)

        # Try to bootstrap pip if it isn't found.
        if ! ${dryrun} "${versioned_python}" -c "import pip" 2> /dev/null; then
          # shellcheck disable=SC2155
          local temporary_directory="$(mktemp -d)"
  8. info dynamic-execution tests/minimext/build_wheels.sh:89:7

    command name is a variable (`$dryrun`) that this file sets only to plain text (ast pass, confidence 0.40)

          local get_pip="${temporary_directory}/get-pip-${version}.py"
          ${dryrun} curl --output "${get_pip}" \
               "https://bootstrap.pypa.io/pip/${version}/get-pip.py"
          ${dryrun} "${versioned_python}" "${get_pip}"
  9. info dynamic-execution tests/minimext/build_wheels.sh:91:7

    command name is a variable (`$dryrun`) that this file sets only to plain text (ast pass, confidence 0.40)

               "https://bootstrap.pypa.io/pip/${version}/get-pip.py"
          ${dryrun} "${versioned_python}" "${get_pip}"
          rm -rf "${temporary_directory}"
        fi
  10. info dynamic-execution tests/minimext/build_wheels.sh:96:5

    command name is a variable (`$dryrun`) that this file sets only to plain text (ast pass, confidence 0.40)

        # Install virtualenv as venv isn't available in all Python versions.
        ${dryrun} "${versioned_python}" -m pip install virtualenv
        ${dryrun} "${versioned_python}" -m virtualenv "${venv_directory}"
        (
  11. info dynamic-execution tests/minimext/build_wheels.sh:97:5

    command name is a variable (`$dryrun`) that this file sets only to plain text (ast pass, confidence 0.40)

        ${dryrun} "${versioned_python}" -m pip install virtualenv
        ${dryrun} "${versioned_python}" -m virtualenv "${venv_directory}"
        (
          cd "${THIS_DIRECTORY}"
  12. info dynamic-execution tests/minimext/build_wheels.sh:100:7

    command name is a variable (`$dryrun`) that this file sets only to plain text (ast pass, confidence 0.40)

          cd "${THIS_DIRECTORY}"
          ${dryrun} source "${venv_directory}/bin/activate"
          # Upgrade pip and setuptools.
          ${dryrun} pip install -U pip
  13. info dynamic-execution tests/minimext/build_wheels.sh:102:7

    command name is a variable (`$dryrun`) that this file sets only to plain text (ast pass, confidence 0.40)

          # Upgrade pip and setuptools.
          ${dryrun} pip install -U pip
          ${dryrun} pip install -U setuptools
          # Build wheels to the wheels subdirectory.
  14. info dynamic-execution tests/minimext/build_wheels.sh:103:7

    command name is a variable (`$dryrun`) that this file sets only to plain text (ast pass, confidence 0.40)

          ${dryrun} pip install -U pip
          ${dryrun} pip install -U setuptools
          # Build wheels to the wheels subdirectory.
          for embed_extension_metadata in 0 1; do
  15. info dynamic-execution tests/minimext/build_wheels.sh:107:9

    command name is a variable (`$dryrun`) that this file sets only to plain text (ast pass, confidence 0.40)

            set -x
            MINIMEXT_EMBED_EXTENSIONS_METADATA=${embed_extension_metadata} \
              ${dryrun} pip wheel . -w "${wheels_directory}"
            set +x
  16. info critical → info by review dynamic-execution tests/test_scripts.py:118:17

    `subprocess.Popen` with `shell=True` and a non-literal command — runtime-determined shell invocation (ast pass, confidence 0.85)

                filenames = maker.make('script8.py')
                p = subprocess.Popen(filenames[0], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
                stdout, stderr = p.communicate()
                self.assertEqual(p.returncode, 0)
    likely benign LLM, confidence 0.80 Test code running a generated script file through subprocess with shell=True.
    Reasoning

    This is a test exercising generated script execution via a shell; the command is a filename produced by the test's own maker fixture, not external input. Shell=True in a test harness is poor practice but not malicious here.

Reproduce This Scan

Run disclude locally to verify. Add --format sarif for SARIF output. Add --llm (with an API key in the environment) to include the LLM review.

cargo install disclude --version 4.1.0
git clone https://github.com/pypa/distlib distlib && cd distlib
git checkout 0.4.4
disclude scan --severity info --diff 0.4.3 .