PyPI / psutil / 7.2.2

psutil 7.2.2

Source
https://github.com/giampaolo/psutil
Artifact scanned
psutil-7.2.2.tar.gz (sdist · 482.2 KB · SHA-256 0746f5f8d406…)
Compared with
psutil-7.2.1.tar.gz (1 signals introduced since)
Files
192 scanned, 17 skipped (binary, oversized, or unrecognised)
Signals
0 critical · 0 warn · 25 info
Scan time
8.6 s
LLM review
Reviewed by claude-haiku-5-5 (Anthropic): 10 of 10 warn and critical signals; 10 demoted to info.
Disclude version
4.3.0
Scanned (UTC)
2026-10-23 04:24

Signals

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

  1. info dynamic-execution scripts/internal/install-sysdeps.sh:50:9 new in this release

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

            $SUDO yum install -y python3-devel gcc
            $SUDO yum install -y net-tools coreutils-single util-linux sudo procps-ng  # for tests
        elif [ $HAS_PACMAN ]; then
            $SUDO pacman -S --noconfirm python gcc
  2. info warn → info by review long-line docs/index.rst:1227:1

    line length 2954 characters (raw pass, confidence 0.65)

        {'LC_NUMERIC': 'it_IT.UTF-8', 'QT_QPA_PLATFORMTHEME': 'appmenu-qt5', 'IM_CONFIG_PHASE': '1', 'XDG_GREETER_DATA_DIR': '/var/lib/lightdm-data/giampaolo', 'XDG_CURRENT_DESKTOP': 'Unity', 'UPSTART_EVENTS': 'started starting', 'GNOME_KEYRING_PID': '', 'XDG_VTNR': '7', 'QT_IM_MODULE': 'ibus', 'LOGNAME': 'giampaolo', 'USE
    likely benign LLM, confidence 0.95 Very long line in psutil documentation containing an example environment dictionary.
    Reasoning

    A long line in RST documentation containing a captured environment dump (locale, desktop vars) is a formatting issue with no execution or obfuscation risk.

  3. info long-line docs/index.rst:1260:1

    line length 513 characters (raw pass, confidence 0.50)

        ``'cmdline'``, ``'net_connections'``, ``'cpu_affinity'``, ``'cpu_num'``, ``'cpu_percent'``, ``'cpu_times'``, ``'create_time'``, ``'cwd'``, ``'environ'``, ``'exe'``, ``'gids'``, ``'io_counters'``, ``'ionice'``, ``'memory_full_info'``, ``'memory_info'``, ``'memory_maps'``, ``'memory_percent'``, ``'name'``, ``'nice'``
  4. info warn → info by review frame-introspection psutil/_common.py:851:13

    `inspect.currentframe` — call-stack frame introspection (ast pass, confidence 0.70)

            fname, lineno, _, _lines, _index = inspect.getframeinfo(
                inspect.currentframe().f_back
            )
            if isinstance(msg, Exception):
    likely benign LLM, confidence 0.93 Uses stack frame introspection to find the caller location for an error message.
    Reasoning

    inspect.currentframe().f_back is used to report the caller's file and line for error messages, a common legitimate logging/diagnostic idiom in a monitoring library.

  5. info warn → info by review dynamic-execution scripts/cpu_distribution.py:55:9

    `os.system` called with a literal shell command (ast pass, confidence 0.70)

        if psutil.POSIX:
            os.system('clear')
        else:
            os.system('cls')
    likely benign LLM, confidence 0.95 Clears the terminal via a fixed os.system command on POSIX systems.
    Reasoning

    os.system('clear') with a fixed literal string in a demo script, selected by platform, is ordinary terminal handling with no external input.

  6. info warn → info by review dynamic-execution scripts/cpu_distribution.py:57:9

    `os.system` called with a literal shell command (ast pass, confidence 0.70)

        else:
            os.system('cls')
    likely benign LLM, confidence 0.95 Clears the Windows console via a fixed os.system('cls') call.
    Reasoning

    os.system('cls') is a fixed literal Windows clear-screen command in a platform branch; no untrusted input is involved.

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

        if [ $HAS_APT ]; then
            $SUDO apt-get install -y python3-dev gcc
            $SUDO apt-get install -y net-tools coreutils util-linux sudo  # for tests
        elif [ $HAS_YUM ]; then
  8. command name is a variable (`$SUDO`) that this file sets only to plain text (ast pass, confidence 0.40)

            $SUDO apt-get install -y python3-dev gcc
            $SUDO apt-get install -y net-tools coreutils util-linux sudo  # for tests
        elif [ $HAS_YUM ]; then
            $SUDO yum install -y python3-devel gcc
  9. command name is a variable (`$SUDO`) that this file sets only to plain text (ast pass, confidence 0.40)

        elif [ $HAS_YUM ]; then
            $SUDO yum install -y python3-devel gcc
            $SUDO yum install -y net-tools coreutils-single util-linux sudo procps-ng  # for tests
        elif [ $HAS_PACMAN ]; then
  10. command name is a variable (`$SUDO`) that this file sets only to plain text (ast pass, confidence 0.40)

        elif [ $HAS_PACMAN ]; then
            $SUDO pacman -S --noconfirm python gcc
            $SUDO pacman -S --noconfirm net-tools coreutils util-linux sudo  # for tests
        elif [ $HAS_APK ]; then
  11. command name is a variable (`$SUDO`) that this file sets only to plain text (ast pass, confidence 0.40)

            $SUDO pacman -S --noconfirm python gcc
            $SUDO pacman -S --noconfirm net-tools coreutils util-linux sudo  # for tests
        elif [ $HAS_APK ]; then
            $SUDO apk add --no-interactive python3-dev gcc musl-dev linux-headers
  12. command name is a variable (`$SUDO`) that this file sets only to plain text (ast pass, confidence 0.40)

        elif [ $HAS_APK ]; then
            $SUDO apk add --no-interactive python3-dev gcc musl-dev linux-headers
            $SUDO apk add --no-interactive coreutils util-linux procps  # for tests
        elif [ $FREEBSD ]; then
  13. command name is a variable (`$SUDO`) that this file sets only to plain text (ast pass, confidence 0.40)

            $SUDO apk add --no-interactive python3-dev gcc musl-dev linux-headers
            $SUDO apk add --no-interactive coreutils util-linux procps  # for tests
        elif [ $FREEBSD ]; then
            $SUDO pkg install -y python3 gcc
  14. command name is a variable (`$SUDO`) that this file sets only to plain text (ast pass, confidence 0.40)

        elif [ $FREEBSD ]; then
            $SUDO pkg install -y python3 gcc
        elif [ $NETBSD ]; then
            $SUDO /usr/sbin/pkg_add -v pkgin
  15. command name is a variable (`$SUDO`) that this file sets only to plain text (ast pass, confidence 0.40)

        elif [ $NETBSD ]; then
            $SUDO /usr/sbin/pkg_add -v pkgin
            $SUDO pkgin update
            $SUDO pkgin -y install python311-* gcc12-*
  16. command name is a variable (`$SUDO`) that this file sets only to plain text (ast pass, confidence 0.40)

            $SUDO /usr/sbin/pkg_add -v pkgin
            $SUDO pkgin update
            $SUDO pkgin -y install python311-* gcc12-*
        elif [ $OPENBSD ]; then
  17. command name is a variable (`$SUDO`) that this file sets only to plain text (ast pass, confidence 0.40)

            $SUDO pkgin update
            $SUDO pkgin -y install python311-* gcc12-*
        elif [ $OPENBSD ]; then
            $SUDO pkg_add gcc python3
  18. command name is a variable (`$SUDO`) that this file sets only to plain text (ast pass, confidence 0.40)

        elif [ $OPENBSD ]; then
            $SUDO pkg_add gcc python3
        elif [ $SUNOS ]; then
            $SUDO pkg install developer/gcc
  19. command name is a variable (`$SUDO`) that this file sets only to plain text (ast pass, confidence 0.40)

        elif [ $SUNOS ]; then
            $SUDO pkg install developer/gcc
        else
            echo "Unsupported platform '$UNAME_S'. Ignoring."
  20. info warn → info by review dynamic-execution scripts/internal/install_pip.py:42:16

    `os.system` called with a literal shell command (ast pass, confidence 0.70)

    
            code = os.system(
                f"{sys.executable} {f.name} --user --upgrade"
                " --break-system-packages"
    likely benign LLM, confidence 0.85 Bootstraps pip by running a downloaded installer via os.system with the current interpreter.
    Reasoning

    Runs get-pip.py-style installer using sys.executable and a temp file name with fixed flags; this is a developer bootstrap script. The interpolated values are local, not attacker-controlled, though shell use via os.system is a minor weakness.

  21. info warn → info by review dynamic-execution tests/test_connections.py:363:21

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

            tcp4_proc = self.pyrun(tcp4_template)
            tcp4_addr = eval(wait_for_file(testfile, delete=True))
            udp4_proc = self.pyrun(udp4_template)
            udp4_addr = eval(wait_for_file(testfile, delete=True))
    likely benign LLM, confidence 0.90 Test evals the address tuple written by a helper subprocess to a temp file.
    Reasoning

    eval is applied to the content of a test-generated address file written by a subprocess the test itself launched; it is test scaffolding parsing a tuple, not malicious.

  22. info warn → info by review dynamic-execution tests/test_connections.py:365:21

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

            udp4_proc = self.pyrun(udp4_template)
            udp4_addr = eval(wait_for_file(testfile, delete=True))
            if supports_ipv6():
                tcp6_proc = self.pyrun(tcp6_template)
    likely benign LLM, confidence 0.90 Test evals the UDP IPv4 address tuple from a helper's temp file.
    Reasoning

    Same test pattern: eval of a tuple read from a self-spawned helper's temp file for the UDP address.

  23. info warn → info by review dynamic-execution tests/test_connections.py:368:25

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

                tcp6_proc = self.pyrun(tcp6_template)
                tcp6_addr = eval(wait_for_file(testfile, delete=True))
                udp6_proc = self.pyrun(udp6_template)
                udp6_addr = eval(wait_for_file(testfile, delete=True))
    likely benign LLM, confidence 0.90 Test evals the TCP IPv6 address tuple from a helper's temp file.
    Reasoning

    Same test-harness eval of the IPv6 TCP address written by a child process the test controls.

  24. info warn → info by review dynamic-execution tests/test_connections.py:370:25

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

                udp6_proc = self.pyrun(udp6_template)
                udp6_addr = eval(wait_for_file(testfile, delete=True))
            else:
                tcp6_proc = None
    likely benign LLM, confidence 0.90 Test evals the UDP IPv6 address tuple from a helper's temp file.
    Reasoning

    Same test-harness eval of the IPv6 UDP address written by a child process the test controls.

  25. info critical → info by review dynamic-import tests/test_misc.py:210:21

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

                    try:
                        __import__(name)
                    except ImportError:
                        if name not in psutil.__all__:
    likely benign LLM, confidence 0.85 Test probes whether optional modules can be imported, catching ImportError.
    Reasoning

    Dynamic __import__ inside try/except ImportError to probe optional module availability is a standard test idiom; the name comes from the test's own iteration, though the critical severity is high for this context.

Reproduce This Scan

Run disclude locally to verify. These commands scan the published file; the "new in this release" marks come from comparing it with the previous release's file, which they don't repeat. 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.3.0
curl -fsSL -o psutil-7.2.2.tar.gz https://files.pythonhosted.org/packages/aa/c6/d1ddf4abb55e93cebc4f2ed8b5d6dbad109ecb8d63748dd2b20ab5e57ebe/psutil-7.2.2.tar.gz
printf '%s  %s\n' 0746f5f8d406af344fd547f1c8daa5f5c33dbc293bb8d6a16d80b4bb88f59372 psutil-7.2.2.tar.gz | shasum -a 256 -c -
mkdir pkg && tar -xzf psutil-7.2.2.tar.gz -C pkg --strip-components 1
disclude scan --untrusted --severity info pkg