coverage 7.17.0
- Source
- https://github.com/coveragepy/coveragepy
- Tag scanned
7.17.0- Compared with
7.16.2(2 signals introduced since)- Files
- 272 scanned, 34 skipped (binary, oversized, or unrecognised)
- Signals
- 0 critical · 1 warn · 70 info
- Scan time
- 38.5 s
- LLM review
- Reviewed by claude-haiku-5-5 (Anthropic): 43 of 43 warn and critical signals; 42 demoted to info.
- Disclude version
- 4.1.0
- Scanned (UTC)
- 2026-10-22 18:44
Signals
Ordered by severity, then signals introduced in this release. Hidden characters are shown as ⟨U+…⟩.
-
) = = =likely benign Decompresses a stored SQL script for a coverage database.Reasoning
zlib decompression of data with a leading flag byte and then decoding it as a script looks like a serialized SQL dump format. The snippet does not show where the bytes come from, but in coverage.py this pattern appears in its own data-file serialization. Some doubt remains because the decoded script is executed.
-
=likely benign Reads the caller's self attribute for debug logging.Reasoning
inspect.stack is used for debug output of the caller's self object in coverage's debug facility. This is ordinary introspection for diagnostics.
-
# don't know what's going on, and just leave it alone. = ... = =likely benign Uses the stack to find the top-level script path before running the user's program.Reasoning
The critical severity comes from the anti-analysis heuristic, since the file also calls sys.exit and exec. Here inspect.stack finds the top-level script file so coverage can run it with the correct sys.path. The exec and exit calls are how coverage runs user programs, so the combination is expected.
-
|likely benign CI step that downloads the pyenv installer from GitHub and runs it with bash.Reasoning
A CI workflow pipes the official pyenv-installer from GitHub into bash. Piping a remote script to a shell is risky in general, but this is a well-known, pinned-upstream bootstrap pattern in a nightly Python build workflow, not obfuscation.
-
assert is not None = =likely benign Compiles source text read from a file to build a code object for coverage analysis.Reasoning
Coverage.py compiles source text it has loaded, which is its core function for analysing code. The compile call is expected in this context.
-
# Remove ourselves as the trace function. # Install the real tracer. : | None =likely benign Clears and reinstalls the coverage trace function.Reasoning
Calling sys.settrace(None) to remove the coverage trace function before installing the real tracer is standard coverage.py behaviour.
-
: =likely benign Collects the call stack to print in debug output.Reasoning
inspect.stack is used to build a filtered call stack for debug output, which fits coverage's debug module.
-
# pylint: disable=try-except-raise # The user called sys.exit(). Just pass it along to the upperlikely benign Runs the target program's code in the main module namespace.Reasoning
Executing the user's program code in its own __main__ namespace is the purpose of coverage's run command. The import-of-marshal heuristic matches normal execfile behaviour.
-
# pylint: disable=try-except-raise # The user called sys.exit(). Just pass it along to the upperlikely benign Executes the program code being measured.Reasoning
This is the same exec of the user's program code as the previous finding, which is the expected function of a program runner.
-
= returnlikely benign Compiles source of the program being run.Reasoning
Compiling the source of the user's program with dont_inherit is standard for a runner like coverage.
-
# The rest of the file is the code object we want. = assertlikely benign Loads a code object from a local .pyc file for execution.Reasoning
marshal.load reads a code object from a local .pyc file the user asked to run, which is how coverage handles running compiled files. It is not a payload fetched from the network or hidden in an encoded blob, and the result is checked to be a CodeType.
-
return True, # pylint: disable=eval-used :dismissed Evaluates Python constant names during AST analysis.Reasoning
The eval only runs on the literal names True, False, None and __debug__ that were matched immediately before. It is a constant lookup, not an arbitrary evaluation.
-
= =likely benign Imports a configured coverage plugin module by name.Reasoning
Dynamic import of a plugin module named in coverage configuration is the designed plugin mechanism. The module name comes from the user's own config.
-
= , , , =likely benign Temporarily disables the Python trace function.Reasoning
Pausing the trace function with sys.settrace(None) while handling tracer state is normal for a Python tracer.
-
returnlikely benign Installs the coverage tracer function.Reasoning
Installing the cached bound trace method via sys.settrace is the core operation of coverage's Python tracer.
-
= = . # type: ignore[union-attr]likely benign Uses inspect.currentframe to locate the caller frame in the coverage tracer.Reasoning
Standard frame lookup in coverage.py's sys.monitoring tracer to find the calling frame. Routine for a coverage library.
-
= . # type: ignore[union-attr] # pragma: debugging # @panopticon adds a frame.likely benign Walks back one frame with currentframe().f_back for coverage bookkeeping.Reasoning
Same frame-walking logic in the coverage tracer, with a debugging comment. No sign of evasion or malicious use.
-
: = returnlikely benign Executes generated template source in a fresh namespace dict.Reasoning
Templite is a small template engine that compiles generated Python source into a namespace. Exec of generated template code is its intended design, not hidden payload execution.
-
likely benign Zero-width joiner inserted into '--debug' in the docs to avoid dash rendering.
Reasoning
The ZWJ sits inside a double hyphen in reST to stop smart-dash conversion in the rendered docs. It is a documentation typesetting choice, not hidden instructions, though it is an unusual character.
-
likely benign Zero-width joiner in '--debug' option reference within the config docs.
Reasoning
Same ZWJ-in-double-hyphen pattern in the rst docs. Benign typesetting.
-
likely benign Zero-width joiner in '--debug' reference in the remapping docs.
Reasoning
Same ZWJ-in-double-hyphen pattern as the other doc findings. No payload or steering text.
-
= = = returnlikely benign Runs a literal git rev-parse to get the branch name for build facts.Reasoning
Fixed git command with no external input, used to collect branch metadata for build facts. Ordinary build-script behavior.
-
= = returnlikely benign Runs a literal git rev-parse to get the commit SHA for build facts.Reasoning
Fixed git rev-parse with a literal argument, collecting the commit SHA. No untrusted input.
-
= =likely benign Dispatches CLI verbs to do_* handler functions via globals lookup.Reasoning
Command dispatcher in a dev script looks up do_<verb> handlers in globals. This is a normal CLI pattern with a fixed namespace.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
= =likely benign Loads a code object from a .pyc file with marshal for bytecode editing.Reasoning
Lab utility that reads and rewrites .pyc files. marshal.load on a local file is the standard way to manipulate bytecode, and the file is in a lab directory. Deserialization risk is inherent, but nothing here indicates an attack.
-
=likely benign Compiles source text to iterate over nested code objects.Reasoning
Compiles source text to walk code objects in a lab parser, likely for coverage analysis. Compiling source text is expected for this tool. No external attacker input is evident.
-
= =likely benign Compiles a user-specified program file to run under sys.monitoring.Reasoning
Lab runner that reads a program path from its arguments and compiles it under sys.monitoring. The module-scope placement is just the script's flow. This is a developer harness, not a dropper.
-
likely benign Executes the compiled target program in the sysmon lab runner.
Reasoning
Executes the code object compiled from the chosen program file in the same test harness. Expected for a runner script.
-
= =likely benign Compiles a user-chosen program file to execute under a trace function.Reasoning
Same runner pattern as run_sysmon: reads a program file path and compiles it for tracing. Developer test harness behavior.
-
=likely benign Installs a trace function before running the target program.Reasoning
sys.settrace in a lab runner to trace the target program. The anti-analysis flag is a heuristic false positive here, since tracing is the purpose of the script.
-
likely benign Executes the compiled target program under the installed tracer.
Reasoning
Executes the traced target program code object in the lab harness. Expected for this tool.
-
=likely benign Loads a code object from a .pyc file so a lab script can display its contents.Reasoning
marshal.load on a .pyc file is how a bytecode inspection tool reads the code object it then displays with show_code. The file is a lab viewer, not a dropper, and nothing in the snippet fetches or runs the payload.
-
=likely benign Compiles Python source text to a code object for display in a bytecode-viewer lab script.Reasoning
The decoder-import shape is a bytecode viewer compiling source text to a code object and passing it to show_code, which disassembles it. The compiled code is displayed, not executed, so the multi-stage payload shape does not hold up.
-
=likely benign Compiles a text argument into a code object for display rather than execution.Reasoning
compile is called on a text parameter inside show_py_text, a helper whose output goes to show_code. This is the same viewer logic as the sibling finding, and the code is never exec'd.
-
# Execute the code in version.py. returnlikely benign Executes the project's own version.py to read the package version during setup.Reasoning
This is the standard coverage.py idiom for loading the version string by executing version.py from the repository into a module-globals dict. The source is a fixed file shipped with the project.
-
# Execute the code in version.py. returnlikely benign Compiles the project's version.py source as part of reading the version during setup.Reasoning
The compile call is the inner half of the same version.py loading idiom, reading a fixed project file. No network input or obfuscated data is involved.
-
=likely benign Test helper that launches a shell command via subprocess.Popen with shell=True.Reasoning
This is a test helper that runs a command string through the shell, which is common for invoking tools inside test fixtures. The command comes from test code, not from untrusted input, though shell=True with a variable command is worth a note.
-
""") code_obj = compile(code, filename="hello.html", mode="exec") cov = coverage.Coverage(branch=True, debug=["trace"]) with cov.collect():likely benign Compiles a literal test program so coverage tracing can be checked against it.Reasoning
The code is a fixed test snippet compiled to test coverage tracing of exec'd code. This is expected in the coverage test suite.
-
likely benign Executes the compiled test program under coverage collection.
Reasoning
exec runs the test code object inside a coverage collection context, which is the purpose of this test. The code comes from the test file itself.
-
= = # pylint: disable=eval-usedlikely benign Compiles test source code for evaluation against mocked globals.Reasoning
Compiles a test script's source with a fixed filename and evaluates it against mock globals to test command-line behavior. This 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 in a command-line test.Reasoning
The eval is the execution step of the same test harness, with a pylint disable comment acknowledging the intent. The code is fixed test content.
-
= = -
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 in a test helper to detect recursive get_qualname calls.Reasoning
inspect.stack is used in a test helper to find whether get_qualname is already on the call stack for recursion checks. This is standard introspection for testing qualname logic.
-
= -
= = -
= = """.replace("@", surrogate), -
= = """.replace("@", surrogate), -
= -
# Run the code to see that we really got it encoded properly. = assert ==likely benign Imports a test module whose name is built from the encoding under test.Reasoning
__import__ loads a test module named with a fixed encoding prefix so the test can confirm that the source encoding declaration decodes correctly. The concatenated name comes from a parametrized test list, not from an external 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.
&&