coverage 7.16.2
- Source
- https://github.com/coveragepy/coveragepy
- Tag scanned
7.16.2- Compared with
7.16.1(0 signals introduced since)- Files
- 264 scanned, 32 skipped (binary, oversized, or unrecognised)
- Signals
- 0 critical · 0 warn · 71 info
- Scan time
- 34.6 s
- LLM review
- Reviewed by claude-haiku-5-5 (Anthropic): 43 of 43 warn and critical signals; 43 demoted to info.
- Disclude version
- 4.1.0
- Scanned (UTC)
- 2026-10-22 01:29
Signals
Ordered by severity, then signals introduced in this release. Hidden characters are shown as ⟨U+…⟩.
-
|likely benign CI step that downloads the pyenv installer from GitHub and pipes it to bash.Reasoning
A curl-to-bash pipe is a supply-chain risk in general, but this is a nightly CI workflow fetching the official pyenv-installer from the project's GitHub repo, which is a common and legitimate setup step for testing Python versions.
-
assert is not None = =likely benign Compiles source text into a code object for coverage analysis.Reasoning
Compiling source text loaded from a file is how coverage.py builds code objects for analysis. The filename and mode are ordinary and the call is not obfuscated.
-
# Remove ourselves as the trace function. # Install the real tracer. : | None =likely benign Clears and reinstalls the Python trace function during coverage collection.Reasoning
sys.settrace(None) removes the tracer before reinstalling the real one. This is the core mechanism of a coverage tool, not evasion.
-
=likely benign Inspects the caller's stack frame to log its self object in debug output.Reasoning
Reading the caller's frame locals for debug output is a normal feature of coverage's debug tooling.
-
: =likely benign Captures a filtered call stack for debug output.Reasoning
Walking the stack to produce a trimmed debug trace is an ordinary debugging utility in coverage.py.
-
# don't know what's going on, and just leave it alone. = .. = =likely benign Looks up the top-level script's filename to fix up sys.path for the run command.Reasoning
The stack lookup finds the top-level script file so coverage can set sys.path[0] for the run command. The critical rating comes from a heuristic that co-occurs with exec, but the surrounding code is ordinary path handling for running user programs.
-
# pylint: disable=try-except-raise # The user called sys.exit(). Just pass it along to the upperlikely benign Executes the user's target program inside its main module namespace.Reasoning
The exec runs the user's own program in its own namespace, which is the intended behavior of coverage's run command. The marshal import is for reading .pyc files and does not indicate a hidden payload.
-
# pylint: disable=try-except-raise # The user called sys.exit(). Just pass it along to the upperlikely benign Executes the user's target program code object.Reasoning
This is the same exec of the user's target program as the previous finding, which is the expected behavior of a run command.
-
= returnlikely benign Compiles the target program's source before execution.Reasoning
Compiling the source of the user's target file before running it is the normal way coverage's run command loads a program.
-
# The rest of the file is the code object we want. = assertlikely benign Loads a code object from a .pyc file for execution.Reasoning
marshal.load reads a .pyc file's code object and asserts its type, which is the standard way to run cached bytecode. Nothing in the snippet suggests a hidden or fabricated payload.
-
return True, # pylint: disable=eval-used :dismissed Evaluates a constant name from an AST node restricted to True, False, None or __debug__.Reasoning
eval is applied only to the names True, False, None and __debug__, all of which are safe literal constants, and the call is annotated as a deliberate pylint exception.
-
= =likely benign Dynamically imports a coverage plugin module named in configuration.Reasoning
Importing a module named in the user's coverage configuration is how plugins are loaded. The module name comes from configuration, not from obfuscated data.
-
= , , , =likely benign Temporarily clears the trace function while recording coverage data.Reasoning
Temporarily disabling the trace function while the tracer updates its own state is standard coverage tracer code.
-
returnlikely benign Installs the tracer's cached trace function via sys.settrace.Reasoning
Installing the cached bound-method trace function is the core of the Python tracer and is expected behavior.
-
) = = =likely benign Decompresses an embedded SQL script and runs it to set up the coverage database.Reasoning
The compressed blob is decompressed and then executed as a SQL script, which resembles a payload shape. In coverage.py it most likely holds a bundled schema or setup script for the SQLite database. The blob itself is not shown, so some doubt remains.
-
= = . # type: ignore[union-attr]likely benign Coverage tool fetches the current stack frame via inspect.currentframe.Reasoning
inspect.currentframe() is used to find the caller's frame for coverage tracing. This is standard for a coverage tool and has no sign of hiding behavior.
-
= . # type: ignore[union-attr] # pragma: debugging # @panopticon adds a frame.likely benign Coverage tool walks back one frame via currentframe().f_back.Reasoning
Same legitimate frame lookup in coverage's sys.monitoring integration, with a debugging comment about frame adjustment.
-
: = returnlikely benign Template engine executes its generated Python source in a fresh namespace.Reasoning
Templite is a small template engine that compiles generated Python source for rendering. exec on generated code is its intended mechanism, not an attack pattern.
-
likely benign Docs text contains a ZWJ splitting the '--debug' option name.
Reasoning
A zero-width joiner inside the literal '--debug' in reST docs is most likely a typographic workaround to stop Sphinx from turning '--' into an en dash. It is not used to hide content from readers or tools.
-
likely benign Docs text contains a ZWJ splitting the '--debug' option name.
Reasoning
Same ZWJ inside the '--debug' option reference, consistent with a dash-rendering workaround in documentation prose.
-
likely benign Docs cross-reference contains a ZWJ splitting '--debug'.
Reasoning
Same ZWJ within a documentation cross-reference to the --debug option, consistent with a dash-rendering workaround.
-
= = = returnlikely benign Developer script collects the git branch name via a literal git command.Reasoning
Build helper runs fixed git commands to read branch metadata. The command is a literal with no untrusted input.
-
= = returnlikely benign Developer script collects the git SHA via a literal git command.Reasoning
Fixed literal git rev-parse call to record the commit SHA, with no external input.
-
= =likely benign Command-line dispatcher resolves do_<verb> handler by name.Reasoning
Dispatches a CLI subcommand to a do_<verb> function by name. The lookup is a local command table, not a remote or hidden payload.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
= =likely benign Lab script loads bytecode objects from a .pyc file with marshal.Reasoning
A lab utility for reading and writing .pyc files, where marshal.load is the expected way to parse bytecode. The file is a local developer tool, not a payload loader, but marshal on untrusted bytes is a known risk.
-
=likely benign Lab parser compiles source text to walk its code objects.Reasoning
Lab parser compiles source text to inspect code objects, which fits a coverage-analysis experiment. The input is local source, not a hidden dropper.
-
= =likely benign Lab runner compiles a user-specified program file for sys.monitoring.Reasoning
A lab runner that compiles a program file named on the command line so it can run it under sys.monitoring. Executing the target is the tool's purpose, not hidden behavior.
-
likely benign Lab runner execs the compiled target program.
Reasoning
The module-level exec runs the program compiled from the user-specified file, which is the runner's design. It is not an obfuscated or hidden payload.
-
= =likely benign Lab runner compiles the target program file for tracing.Reasoning
A lab runner compiles a user-named program file to run under a tracer, matching its evident purpose.
-
=likely benign Lab runner installs a trace function before running the target.Reasoning
sys.settrace installs a tracer for the lab runner's target program. The anti-analysis flag is a heuristic false positive here, since tracing is the tool's purpose.
-
likely benign Lab runner execs the traced target program.
Reasoning
Module-level exec of the compiled target program is the runner's core function, with no sign of concealment.
-
=likely benign Reads a compiled Python bytecode file with marshal to display its code object.Reasoning
marshal.load on a .pyc file handle is the standard way to read compiled code objects. The file is in a lab directory and the surrounding code only prints sizes and shows the code object, so this looks like a bytecode inspection utility rather than a dropper.
-
=likely benign Helper that compiles Python source text and passes the code object to a display function.Reasoning
The file combines marshal and binascii with compile(), but the snippet is a helper that compiles source text and passes the code object to show_code, which displays it. The pattern matches a disassembler and does not execute the result.
-
=likely benign compile() applied to a function argument in a bytecode display helper.Reasoning
compile() on a caller-supplied text argument is expected in a bytecode viewer. The code object is only shown, not run, so the non-literal input is not by itself evidence of malice.
-
# Execute the code in version.py. returnlikely benign Executes the contents of the project's version.py to obtain version metadata at build time.Reasoning
This is the common coverage.py idiom for reading version.py into a module globals dict during setup. The source is a fixed local file, not network or encoded data.
-
# Execute the code in version.py. returnlikely benign Compiles the project's version.py source before exec-ing it for version metadata.Reasoning
The compile call is the compile half of the same exec(compile(...)) version-loading idiom. It reads a fixed project file with a fixed filename.
-
=likely benign Test helper that runs a caller-supplied command string through a shell.Reasoning
Test helpers commonly run shell command strings passed in by test code, so shell=True with a variable command is expected here. The critical severity reflects the pattern alone. Nothing in the snippet shows a hidden or remote command source, but the command's origin is not visible.
-
""") code_obj = compile(code, filename="hello.html", mode="exec") cov = coverage.Coverage(branch=True, debug=["trace"]) with cov.collect():likely benign Compiles an inline test code string to run under coverage.Reasoning
This is a test that compiles a hard-coded source snippet with a fixed filename to exercise coverage tracing. It is ordinary test setup.
-
likely benign Executes the test's compiled code object under coverage collection.
Reasoning
exec of the compiled test code object inside a coverage collection block is the intended behavior of this test. The code comes from the test file itself.
-
= = # pylint: disable=eval-usedlikely benign Compiles a test code string with a fixed filename for command-line testing.Reasoning
The test compiles a fixed code string taken from the test's own data to check command-line behavior. It is ordinary test scaffolding.
-
= # pylint: disable=eval-used # Many of our functions take a lot of arguments, and cmdline.pylikely benign Evaluates the compiled test code with mock globals.Reasoning
eval of the compiled code object with a test-controlled globals dict is a deliberate test technique, marked with a pylint disable. The source is not external.
-
= = -
assert == 3 assert == assert == 90.5 assert == -
= & «» # numbers """, ) -
assert == assert == -
"""Helper to return qualname_from_frame for the caller.""" = # We're calling ourselves recursively, maybe because we're testinglikely benign Reads the call stack to detect recursive get_qualname calls in a test helper.Reasoning
inspect.stack is used to find recursive calls when computing a qualified name in a test helper. This is standard introspection with no concealment.
-
= -
= = -
= = """.replace("@", surrogate), -
= = """.replace("@", surrogate), -
= -
# Run the code to see that we really got it encoded properly. = assert ==likely benign Dynamically imports a test module named by source encoding to verify it decodes correctly.Reasoning
The test imports a module named encoded_ plus an encoding name, which matches the test's purpose of checking source-encoding handling. The module name comes from a test-defined list, not from an outside source.
-
-
, , , ) -
, , ) -
, , )
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.
&&