PyPI / coverage / 7.17.0

coverage 7.17.0

Source
https://github.com/coveragepy/coveragepy
Artifact scanned
coverage-7.17.0-py3-none-any.whl (wheel · 212.3 KB · SHA-256 bac487dce0d2…)
Compared with
coverage-7.16.2-py3-none-any.whl (2 signals introduced since)
Files
53 scanned, 8 skipped (binary, oversized, or unrecognised)
Signals
0 critical · 0 warn · 18 info
Scan time
18.3 s
LLM review
Reviewed by claude-haiku-5-5 (Anthropic): 18 of 18 warn and critical signals; 18 demoted to info.
Disclude version
4.3.0
Scanned (UTC)
2026-10-23 04:30

Signals

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

  1. info warn → info by review frame-introspection coverage/debug.py:101:27 new in this release

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

            if self.should("self"):
                caller_self = inspect.stack()[1].frame.f_locals.get("self")
                if caller_self is not None:
                    self.output.write(f"self: {caller_self!r}\n")
    likely benign LLM, confidence 0.92 Reads the calling frame's self attribute for coverage's debug output.
    Reasoning

    Coverage's debug facility reads the caller's self object for diagnostic output. This is developer-facing debugging, not malicious.

  2. info critical → info by review frame-introspection coverage/execfile.py:111:24 new in this release

    `inspect.stack` — call-stack frame introspection — file also calls `sys.exit`/`exec`/`eval` (anti-analysis shape) (ast pass, confidence 0.85)

                # don't know what's going on, and just leave it alone.
                top_file = inspect.stack()[-1].frame.f_code.co_filename
                sys_path_0_abs = os.path.abspath(sys.path[0])
                top_file_dir_abs = os.path.abspath(os.path.dirname(top_file))
    dismissed LLM, confidence 0.90 Looks up the top-level script file so coverage run can set up sys.path.
    Reasoning

    This reads the top-level script path so coverage run can resolve sys.path correctly. The critical rating comes from the file also calling exec and sys.exit, which here is the normal shape of a script runner that executes the user's program. No payload or concealment is present.

  3. info warn → info by review pth-executable-line a1_coverage.pth:1:1

    `.pth` line that Python's `site` executes at every interpreter start (ast pass, confidence 0.70)

    import sys; exec('import os\n\nif os.getenv("COVERAGE_PROCESS_START") or os.getenv("COVERAGE_PROCESS_CONFIG"):\n try:\n  import coverage\n except:\n  pass\n else:\n  coverage.process_startup(slug="pth")')
    likely benign LLM, confidence 0.80 A .pth startup line from the coverage.py package that conditionally starts coverage measurement based on environment variables.
    Reasoning

    This matches coverage.py's standard startup hook. It runs only when COVERAGE_PROCESS_START or COVERAGE_PROCESS_CONFIG is set, imports coverage inside a try/except, and calls process_startup. The exec-of-a-string wrapper is unusual, but the behaviour is the documented coverage subprocess-measurement mechanism. The system prompt treats coverage as legitimate, so this is most likely benign, with some doubt because the .pth executes code at every interpreter start.

  4. info warn → info by review dynamic-execution coverage/bytecode.py:27:20

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

                assert text is not None
                code = compile(text, filename or "<string>", "exec", dont_inherit=True)
            self.code = code
    likely benign LLM, confidence 0.90 Compiles source text into a code object inside coverage.py's bytecode utilities.
    Reasoning

    This is coverage.py's bytecode helper compiling source text it has been given, with dont_inherit=True. Compiling a non-literal is the normal job of a code-analysis library, and nothing here hides or fetches code.

  5. info warn → info by review frame-introspection coverage/collector.py:289:9

    `sys.settrace` — call-stack frame introspection (ast pass, confidence 0.70)

            # Remove ourselves as the trace function.
            sys.settrace(None)
            # Install the real tracer.
            fn: TTraceFn | None = self._start_tracer()
    likely benign LLM, confidence 0.92 Clears and reinstalls the Python trace function inside coverage's collector.
    Reasoning

    sys.settrace(None) removes coverage's own trace function before installing the real tracer. This is routine coverage collector control flow, not stack introspection for evasion.

  6. info warn → info by review frame-introspection coverage/debug.py:276:42

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

    
        stack: Iterable[inspect.FrameInfo] = inspect.stack()[:skip:-1]
        if not full:
            for pat in BORING_PRELUDE:
    likely benign LLM, confidence 0.92 Collects a call-stack listing for coverage's debug output.
    Reasoning

    Coverage's debug code collects a trimmed call stack for diagnostics. Walking the stack for debug output is ordinary behaviour.

  7. info warn → info by review decoder-import-with-exec coverage/execfile.py:218:13

    file imports decoder module(s) marshal and calls `exec`/`eval`/`compile` — multi-stage payload shape (ast pass, confidence 0.80)

            try:
                exec(code, main_mod.__dict__)
            except SystemExit:  # pylint: disable=try-except-raise
                # The user called sys.exit().  Just pass it along to the upper
    likely benign LLM, confidence 0.88 Runs the user's target program in a fresh module namespace inside coverage's execfile helper.
    Reasoning

    This is coverage run executing the user's target program in a module namespace and passing SystemExit through. The marshal import is for running .pyc files. The shape is expected for a program runner.

  8. info warn → info by review dynamic-execution coverage/execfile.py:218:13

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

            try:
                exec(code, main_mod.__dict__)
            except SystemExit:  # pylint: disable=try-except-raise
                # The user called sys.exit().  Just pass it along to the upper
    likely benign LLM, confidence 0.88 Executes the user's program code within coverage's execfile helper.
    Reasoning

    The same exec call, flagged a second time as a non-literal exec. Executing the user's code is the purpose of coverage run, so this is a legitimate runner pattern.

  9. info warn → info by review dynamic-execution coverage/execfile.py:303:12

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

    
        code = compile(source, filename, mode="exec", dont_inherit=True)
        return code
    likely benign LLM, confidence 0.88 Compiles the target program's source text in coverage's execfile helper.
    Reasoning

    Compiles the source of the user's program for coverage run. This is expected for a script runner and carries no concealment.

  10. info warn → info by review dynamic-execution coverage/execfile.py:331:16

    `marshal.load` deserializes Python bytecode from bytes — code-object sink (ast pass, confidence 0.75)

            # The rest of the file is the code object we want.
            code = marshal.load(fpyc)
            assert isinstance(code, CodeType)
    likely benign LLM, confidence 0.85 Loads a compiled .pyc file's code object so coverage can run it.
    Reasoning

    marshal.load reads a .pyc file that the user asked coverage to run, and the code is checked as a CodeType. This is the standard way to run compiled modules. It loads a local file the user named, not a remote or hidden payload.

  11. info warn → info by review dynamic-execution coverage/parser.py:673:30

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

                if node.id in ["True", "False", "None", "__debug__"]:
                    return True, eval(node.id)  # pylint: disable=eval-used
            case ast.UnaryOp():
                if isinstance(node.op, ast.Not):
    likely benign LLM, confidence 0.93 Evaluates the constant names True, False, None or __debug__ while parsing code.
    Reasoning

    eval is applied only to the names True, False, None or __debug__, which are constants. This is a safe constant-folding step for the AST parser, not arbitrary evaluation.

  12. info critical → info by review dynamic-import coverage/plugin_support.py:45:13

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

                self.current_module = module
                __import__(module)
                mod = sys.modules[module]
    likely benign LLM, confidence 0.85 Imports a configured coverage plugin module by name.
    Reasoning

    This imports a plugin module whose name comes from the coverage configuration file, which is the designed plugin-loading mechanism. The critical rating reflects the non-literal import, not any sign of a payload. The user has to configure the plugin explicitly.

  13. info warn → info by review frame-introspection coverage/pytracer.py:171:13

    `sys.settrace` — call-stack frame introspection (ast pass, confidence 0.70)

                        f = f.f_back
                sys.settrace(None)
                try:
                    self.cur_file_data, self.cur_file_name, self.last_line, self.started_context = (
    likely benign LLM, confidence 0.92 Briefly disables the trace function during coverage's tracer bookkeeping.
    Reasoning

    This temporarily disables the trace function while coverage's tracer does its bookkeeping, then re-enables it. It is routine tracer control flow.

  14. info warn → info by review frame-introspection coverage/pytracer.py:337:9

    `sys.settrace` — call-stack frame introspection (ast pass, confidence 0.70)

    
            sys.settrace(self._cached_bound_method_trace)
            return self._cached_bound_method_trace
    likely benign LLM, confidence 0.93 Installs the cached bound-method trace function for coverage's Python tracer.
    Reasoning

    This installs coverage's cached bound-method trace function, which is the core of how the Python tracer works. It is legitimate.

  15. info warn → info by review decoder-decompress-payload coverage/sqldata.py:465:18

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

                )
            script = zlib.decompress(data[1:]).decode("utf-8")
            self._dbs[threading.get_ident()] = db = SqliteDb(self._filename, self._debug, self._no_disk)
            with db:
    likely benign LLM, confidence 0.80 Decompresses a bundled zlib blob into an SQL script that initializes coverage's SQLite database.
    Reasoning

    The snippet decompresses a zlib blob whose first byte is skipped, then decodes it as UTF-8 text and hands it to a per-thread SqliteDb. This matches coverage.py's in-memory SQLite handling, where a compressed SQL script is loaded into a database. The payload is bundled source data, not a remote or hidden dropper, and nothing in the snippet executes it as code or reaches the network. The residual doubt is that the decompressed script's use is not visible in the snippet.

  16. info warn → info by review frame-introspection coverage/sysmon.py:339:25

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

                if disp is None:
                    frame = inspect.currentframe()
                    if frame is not None:
                        frame = inspect.currentframe().f_back  # type: ignore[union-attr]
    likely benign LLM, confidence 0.93 Calls inspect.currentframe() to get the caller frame for coverage's sys.monitoring tracing.
    Reasoning

    inspect.currentframe() is used to find the caller's frame for coverage's sys.monitoring tracer, where frame introspection is required to attribute execution to source lines. The pattern is routine in profilers and coverage tools and has no hidden behavior.

  17. info warn → info by review frame-introspection coverage/sysmon.py:341:29

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

                    if frame is not None:
                        frame = inspect.currentframe().f_back  # type: ignore[union-attr]
                        if LOG:  # pragma: debugging
                            # @panopticon adds a frame.
    likely benign LLM, confidence 0.93 Reads the back frame via inspect.currentframe().f_back to attribute coverage data correctly.
    Reasoning

    This is a second currentframe() call that walks back one frame, with a comment referencing a debugging helper and a debug-only log branch. It is ordinary tracer frame attribution in a coverage library, not evasion or exfiltration.

  18. info warn → info by review dynamic-execution coverage/templite.py:72:9

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

            global_namespace: dict[str, Any] = {}
            exec(python_source, global_namespace)
            return global_namespace
    likely benign LLM, confidence 0.80 Executes Python source generated from a template to render coverage report output.
    Reasoning

    Templite is a small template engine that compiles template text into Python source and execs it to render output. The exec runs on code generated from the template by the library itself, and the template is developer-supplied content for report rendering. This is a known design pattern, not an attack, though exec on generated code is worth noting.

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 coverage-7.17.0-py3-none-any.whl https://files.pythonhosted.org/packages/c9/17/48032919343afa2906112d458aceda2043afdb24a2ee8eb4c60904d8ddf1/coverage-7.17.0-py3-none-any.whl
printf '%s  %s\n' bac487dce0d2aff28ddf1a533a916f771416eee0e493960f611e49037b878e9d coverage-7.17.0-py3-none-any.whl | shasum -a 256 -c -
unzip -q coverage-7.17.0-py3-none-any.whl -d pkg
disclude scan --untrusted --severity info pkg