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
- 261 scanned, 35 skipped (binary, oversized, or unrecognised)
- Signals
- 0 critical · 0 warn · 71 info
- Scan time
- 31.0 s
- LLM review
- Reviewed by claude-haiku-5-5 (Anthropic): 43 of 43 warn and critical signals; 43 demoted to info.
- Disclude version
- 4.0.0
- Scanned (UTC)
- 2026-10-14 18:27
Signals
Ordered by severity, then signals introduced in this release. Hidden characters are shown as ⟨U+…⟩.
-
|likely benign CI step that curls the pyenv installer script and pipes it into bash.Reasoning
A CI workflow step downloads the pyenv installer from its official GitHub repo and pipes it to bash. This is a common, if risky, bootstrap pattern, and the snippet shows no obfuscation or hidden payload. Pinning or checksum verification would be better practice.
-
assert is not None = =likely benign compile() of source text inside coverage's bytecode helper.Reasoning
compile() here turns source text read by coverage's own bytecode tooling into a code object. That is the expected behaviour of a coverage/analysis library, not a hidden payload.
-
# Remove ourselves as the trace function. # Install the real tracer. : | None =likely benign Coverage collector resetting the Python trace function.Reasoning
sys.settrace(None) removes coverage's own trace function before installing the real tracer. This is standard tracer management for a coverage tool.
-
=likely benign Debug-trace helper reading the caller's frame to log 'self'.Reasoning
inspect.stack() is used to report the caller's self object in coverage's debug output. This is diagnostic logging, not malicious introspection.
-
: =likely benign Debug helper capturing the call stack for logging.Reasoning
inspect.stack() is used to build a filtered stack for coverage's debug output, with boring prelude frames skipped. This is diagnostic code.
-
# don't know what's going on, and just leave it alone. = .. = =likely benign execfile logic that finds the top-level script file via stack inspection.Reasoning
The critical severity comes from co-occurrence with exec/sys.exit, but the code is coverage's logic for resolving the top-level script path so it can run user code like `python -m`. The anti-analysis shape is a false positive from a legitimate runner.
-
# pylint: disable=try-except-raise # The user called sys.exit(). Just pass it along to the upperlikely benign Runs the user's target script via exec within a module namespace.Reasoning
exec of the user's program code in its own __dict__ is the core purpose of coverage's run command. The surrounding code handles SystemExit, which is normal.
-
# pylint: disable=try-except-raise # The user called sys.exit(). Just pass it along to the upperlikely benign Same exec of the user's program code, flagged a second time.Reasoning
This is the same exec call as the previous finding, flagged by the dynamic-execution signal. It runs the user's program, which is expected for coverage's execfile module.
-
= returnlikely benign compile() of the user's script source before execution.Reasoning
compile() of the source of a user-run file with dont_inherit is how coverage prepares a script for execution. This matches the expected runner design.
-
# The rest of the file is the code object we want. = assertlikely benign Loads a cached .pyc code object for the script being run.Reasoning
marshal.load reads the code object from a .pyc file for the script being run, followed by an isinstance(CodeType) check. This is the standard way to execute a cached bytecode file, and it is only a risk for untrusted .pyc inputs.
-
return True, # pylint: disable=eval-used :likely benign eval restricted to constant names during AST constant evaluation.Reasoning
eval is applied only to the literal names True, False, None, and __debug__, so it cannot execute arbitrary input. This is a constant-folding helper with a pylint suppression.
-
= =likely benign Dynamic import of a configured coverage plugin module by name.Reasoning
__import__ loads a plugin module whose name comes from coverage's configuration, which is the documented plugin mechanism. The severity is critical only because of the dynamic import shape. Users control what gets loaded.
-
= , , , =likely benign Coverage tracer temporarily disabling sys.settrace while walking frames.Reasoning
sys.settrace(None) is used by coverage.py's tracer to disable tracing while it does internal bookkeeping; frame walking via f_back is standard for coverage tools. Legitimate.
-
returnlikely benign Coverage tracer installs its cached trace method via sys.settrace.Reasoning
Installing a cached bound method as the trace function is the normal mechanism of a Python coverage tracer.
-
) = = =likely benign Decompresses an internal SQL script via zlib to initialize the coverage SQLite database.Reasoning
coverage.py stores SQL scripts zlib-compressed in the package and decompresses them to run schema setup for its SQLite data file. This is a known, documented-in-code design choice for a legitimate project; the payload is an SQL script for local coverage data, not a dropper. Still a compressed-payload pattern worth noting.
-
= = . # type: ignore[union-attr]likely benign Uses currentframe to locate the caller frame for coverage bookkeeping.Reasoning
Frame inspection via inspect.currentframe().f_back is a routine debugging/introspection step in coverage's sys.monitoring backend.
-
= . # type: ignore[union-attr] # pragma: debugging # @panopticon adds a frame.likely benign Retrieves the parent frame in coverage's sys.monitoring code for logging.Reasoning
Same benign frame lookup, guarded by debugging logic; no malicious use.
-
: = returnlikely benign Template engine executes generated Python source via exec.Reasoning
Templite is a template engine that compiles generated Python code with exec; the source is produced from templates within the library, so the non-literal exec is by design rather than hidden payload execution.
-
likely benign Invisible ZWJ character inside a documentation option name.
Reasoning
A zero-width joiner inside '--debug' in RST documentation is a stray invisible character that could affect rendering or search, but it is not a malicious payload. Likely accidental copy-paste from a formatted source.
-
likely benign Invisible ZWJ character in a doc cross-reference to the run debug option.
Reasoning
Same stray ZWJ in a documentation cross-reference; benign in context, a formatting artifact.
-
likely benign Invisible ZWJ character in documentation prose.
Reasoning
Same stray ZWJ within '--debug' documentation text; low risk, though it is worth cleaning up.
-
= = = returnlikely benign Runs fixed git commands to record branch name in a dev helper script.Reasoning
Fixed literal git commands used to gather build facts in a developer script; no external input is involved.
-
= = returnlikely benign Runs a fixed git command to record the commit SHA.Reasoning
Fixed literal git rev-parse command in a developer helper; benign.
-
= =likely benign Looks up a do_ handler function by command-line verb name.Reasoning
Dispatches a developer CLI subcommand by looking up do_<verb> in globals; the verb comes from the local command line, so this is ordinary command dispatch.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
= =likely benign Loads Python bytecode from a pyc file in a lab utility.Reasoning
marshal.load on a .pyc file is the expected way to read bytecode in a lab tool for editing pyc files. It is a known deserialization risk on untrusted input, but this is a local developer lab script rather than a supply-chain payload.
-
=likely benign compile() of a source text inside a lab parser helper that walks code objects.Reasoning
The compile call on a variable string is a plain parser utility in a lab directory of a coverage tool. Nothing in the snippet suggests hidden or hostile execution.
-
= =likely benign Developer harness compiles a program file named on the command line for sys.monitoring tracing.Reasoning
Module-level compile of a program file named by a variable is a developer harness that runs a target script for sys.monitoring experiments. The file is a local lab script, not a dropper, though running on import is untidy.
-
likely benign Module-level exec running the compiled target program in the sysmon lab harness.
Reasoning
exec of code compiled from a local program file is the tail of the same lab harness. The source is user-chosen and local, so no remote payload path appears.
-
= =likely benign Trace harness reads and compiles a target program file at module scope.Reasoning
Reads a program file, compiles it and runs it under a trace function. This is a tracing harness for experiments; the input is a local file path.
-
=likely benign sys.settrace installs a trace function before running the compiled target.Reasoning
sys.settrace is the standard mechanism for coverage-style tracing. Co-occurrence with exec is expected in a harness that runs a target under tracing, so the anti-analysis label is a false match here.
-
likely benign exec of the compiled target program under the trace harness.
Reasoning
exec runs code compiled from a local file path, as part of the same tracing harness. No network source or decoding is involved.
-
=likely benign Bytecode viewer deserializes a .pyc file to display its code object.Reasoning
marshal.load on a .pyc file being disassembled is the normal way a bytecode-inspection tool reads its input. The data comes from a user-supplied file, which is what the tool is for.
-
=likely benign Bytecode display tool that imports decoders and compiles source text to show its code.Reasoning
The module imports binascii and marshal because it parses .pyc headers, and compile is used to show source text. The multi-stage label matches a legitimate disassembly tool.
-
=likely benign compile() of user-supplied source text inside the pyc display tool.Reasoning
compile of source text with a filename so it can be shown as a code object is a routine operation in a disassembly tool. The input is supplied by the user, not fetched from anywhere hidden.
-
# Execute the code in version.py. returnlikely benign setup.py execs the compiled contents of version.py to read the package version.Reasoning
This is the standard coverage.py pattern for executing version.py to read __version__ into module globals. It is local, known, and expected in setup.py.
-
# Execute the code in version.py. returnlikely benign compile() of the local version.py source in setup.py.Reasoning
The compile call is the inner half of the same version-reading idiom, applied to a file in the repository. This is normal packaging code.
-
=likely benign Test helper runs a runtime-built command through a shell via subprocess.Popen.Reasoning
A test helper runs a command string through the shell, which is a common test-utility pattern. The command is supplied by test code, not from untrusted input, but shell=True with a variable command deserves a look to confirm no external input reaches it.
-
""") code_obj = compile(code, filename="hello.html", mode="exec") cov = coverage.Coverage(branch=True, debug=["trace"]) with cov.collect():likely benign Test compiles a small snippet so coverage can be measured on it.Reasoning
Compiling an HTML-template snippet inside a branch-coverage test is ordinary test setup. It is part of the code under test, not a hidden payload.
-
likely benign Test executes its compiled snippet under coverage collection.
Reasoning
The exec runs the compiled test snippet inside cov.collect(), which is how coverage tests drive code. The code is fixed in the test file.
-
= = # pylint: disable=eval-usedlikely benign Test helper compiles a code string to execute it with mocked globals.Reasoning
compile of a test-supplied code string with pylint disable comment, in a test harness for command-line execution; the code is test fixture content, not obfuscated payload.
-
= # pylint: disable=eval-used # Many of our functions take a lot of arguments, and cmdline.pylikely benign Test helper evals compiled code under mocked globals.Reasoning
eval of the compiled test code object in a controlled namespace within a test file, explicitly annotated with pylint disable; a standard pattern for testing a command-line runner.
-
= = -
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 Test helper inspects the call stack to detect recursion when computing qualnames.Reasoning
inspect.stack used to detect recursive calls in a test helper for qualname resolution; frame introspection is legitimate for this purpose and the snippet shows no malicious use.
-
= -
= = -
= = """.replace("@", surrogate), -
= = """.replace("@", surrogate), -
= -
# Run the code to see that we really got it encoded properly. = assert ==likely benign Test imports an encoded test module by constructed name to verify encoding handling.Reasoning
Dynamic import of a module named by a fixed prefix plus encoding name, used to verify encoded source files in a test. Critical severity is overstated; the import target is a test-controlled name in a test suite.
-
-
, , , ) -
, , ) -
, , )
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.
&&