dill 0.4.1
- Source
- https://github.com/uqfoundation/dill
- Artifact scanned
dill-0.4.1-py3-none-any.whl- Compared with
dill-0.4.0-py3-none-any.whl(0 signals introduced since)- Files
- 50 scanned, 4 skipped (binary, oversized, or unrecognised)
- Signals
- 2 critical · 17 warn · 30 info
- Scan time
- 29.7 s
- LLM review
- Reviewed by claude-haiku-5-5 (Anthropic): 33 of 49 warn and critical signals; 30 demoted to info.
- Disclude version
- 4.3.0
- Scanned (UTC)
- 2026-10-23 08:45
Signals
Ordered by severity, then signals introduced in this release. Hidden characters are shown as ⟨U+…⟩.
-
try: res = os.system(msg) except Exception: print ("Please verify install of 'gprof2dot' to view profile graphs")inconclusive A dill script that runs a runtime-built shell command to invoke gprof2dot for profile graphs.Reasoning
The file is a profiling-graph helper that calls os.system on msg, and its except branch tells the user to verify a gprof2dot install, which fits its purpose of invoking an external visualization tool. The severity is critical, but the snippet does not show how msg is built, so whether it carries untrusted input cannot be judged from here. This is a shell invocation with unknown inputs, and the verdict is a guess.
-
= pass -
for line in obj[:-1]: exec(line) # one-line generation of an instance try:likely benign A dill utility script that execs reconstruction lines for a profiled object instance.Reasoning
This is a helper script shipped with dill that rebuilds a profiled object by executing lines it generated itself, in a one-line instance-generation routine. The exec target comes from the profile data the tool processes, not from network or encoded input. The pattern is a crude serialization shortcut rather than a clear dropper, but the source of obj is not shown, so some doubt remains.
-
try: obj = eval(obj[-1]) except Exception: print ("Error processing object instance")likely benign A dill helper script that evals the final element of reconstruction data inside a try/except.Reasoning
The eval is applied to the last element of the same object-reconstruction data used by the exec above, inside a try block that prints an error on failure. It is consistent with a developer utility parsing its own output. Eval of data is still risky, and the origin of obj is not visible in the snippet, so the verdict is not fully certain.
-
# this function # find_chain/find_backref_chain, likely -
# this function # find_chain/find_backref_chain, likely -
# the defaults are None and False = -
): del -
#FIXME: unsafe = = # get code objects, for comparison -
#FIXME: unsafe = = # get code objects, for comparison -
, = , 0 = , = -
# _ = eval(getsource(f, force=True)) #XXX: safer but less robust -
#print(_str) #XXX: check if == obj? (name collision) #XXX: better top-down or bottom-up recursion? = #(or get all, then compare == obj?) -
= = return -
= = return -
= return -
= = return -
= return -
= assert == #assert baditems(globals()) == [f] #XXX -
= = =likely benign A pass-through __import__ wrapper that records newly imported modules.Reasoning
The wrapper forwards arbitrary args to __import__ inside a helper that records module imports for dill's diff utility. The arguments come from the caller's own import statements, not from untrusted input, so this is a legitimate import-tracking hook.
-
= dellikely benign Temporarily replaces builtins.__import__ with a tracking hook in the diff utility.Reasoning
The hook replaces builtins.__import__ temporarily to track imports, then removes the leftover '_' name. It is a deliberate, scoped monkeypatch typical of a diagnostic tool, though it is worth noting that it is global while active.
-
# Use the calling frame's module = .. = # pragma: no coverdismissed Reads the calling frame's module name to set __module__ on an object.Reasoning
Reading the caller's frame globals to obtain __name__ is a standard way to set a default module name. The sys.exit/exec/eval co-occurrence is generic in a large library and is not an anti-analysis shape here.
-
returnlikely benign Unmarshals code-object bytes as part of dill's serialization format.Reasoning
dill is a serializer whose purpose is to save and restore code objects, so marshal.loads on bytes it produced is expected. Loading untrusted pickles is a known risk of the library's design rather than hidden malicious behavior.
-
returnlikely benign Evaluates a stored repr string to reconstruct an object when loading.Reasoning
eval of a repr string is used to rebuild numpy-style objects during deserialization. It is a known design choice in dill and carries the usual risk of deserializing untrusted data, with no sign of a staged payload.
-
returnlikely benign Same repr-string eval used to reconstruct objects during loading.Reasoning
This is the same eval of a repr string as the sibling finding. It serves dill's reconstruction path and is not an attacker-controlled dropper.
-
= passlikely benign Dynamically imports a module by name while resolving a pickled reference.Reasoning
The import resolves a module name recorded in the serialized data, guarded by try/except ImportError. This is ordinary dynamic module lookup for pickled references.
-
= returnlikely benign Evaluates a constructed attribute-access expression to locate a named object.Reasoning
The eval builds an attribute path from names taken from the serialized reference and is wrapped in an exception handler. This is a lookup mechanism, though eval on data-derived strings is risky when the input is untrusted.
-
= = returnlikely benign Imports a module and retrieves an attribute to resolve a referenced object.Reasoning
The code imports a module and then fetches an attribute from it to locate a referenced object, with a type check on the result. This is standard name resolution in dill.
-
return return returnlikely benign Fallback __import__ used to resolve a dotted object reference.Reasoning
This is the fallback import of a module path during object lookup, inside dill's resolution logic. It shows no payload behavior.
-
returnlikely benign Final import attempt in the name-resolution fallback chain.Reasoning
This is the final import in the lookup chain, with ImportError and AttributeError handled explicitly. It is normal module resolution.
-
# types module (part of CH 8) = = =dismissed Compiles an empty string to obtain the CodeType type for a table of built-in types.Reasoning
compile('','','exec') produces an empty code object only to obtain its CodeType, and the surrounding code builds a table of built-in type samples. No payload is decoded or run.
-
= = # file formats (CH 13) =dismissed Instantiates zlib decompressor objects solely to record their types.Reasoning
zlib.decompressobj() is instantiated only to capture the type of a compression object for a registry of built-in types. It decompresses nothing.
-
""" func = globals().get(name) if func is not None: _dill.__dict__[name] = funclikely benign Looks up a module-level function by name to copy it into dill's namespace.Reasoning
globals().get(name) looks up a function by name within the module's own namespace in order to re-export it. The name is internal, so this is a benign reflection pattern.
-
dellikely benign Generates module-level type-name aliases from a fixed internal dictionary.Reasoning
The exec builds type-name assignments from the keys of a fixed internal objects dict at import time. The inputs are static library data rather than external input, so this is a legitimate code-generation idiom.
-
return =likely benign Test helper that evals a lambda source string to verify dill round-tripping.Reasoning
eval of a string built from a lambda expression inside dill's own test helper; the input is a test literal, not attacker-controlled. Legitimate test of serialization of lambdas.
-
assert .__name__ in assert in and inlikely benign Test checks module presence by name lookup in globals.Reasoning
Reaching module names through globals() in a session-restore test checks that modules were restored; no malicious effect.
-
assert is .__dict__ assert ==likely benign Test verifies restored names via globals() lookup.Reasoning
Same pattern as the other session test: globals lookup of known names to verify session state after load.
-
assert .__name__ == .__name__likely benign Test compares restored globals with a copy using fixed names.Reasoning
Compares globals against a copy for fixed test names; standard test assertion with no obfuscation purpose.
-
= assert ==likely benign Test execs dumped source of local functions to verify dill's source extraction.Reasoning
exec of source generated by dill's own dumpsource from local test functions to check source round-tripping; not external input.
-
assert ==likely benign Test execs generated source for a known function and asserts equivalence.Reasoning
Same as adjacent exec: dumpsource output of known test functions, used for equality assertions.
-
assert == assert ==likely benign Test execs generated source for squared function to compare results.Reasoning
Round-trip source check on test functions; exec of self-generated code in a test.
-
assert == assert ==likely benign Test execs generated source for squared function and asserts equality.Reasoning
Round-trip source check on test functions; exec of self-generated code in a test.
-
= assert ==likely benign Test execs generated import statements to check dill's getimport.Reasoning
exec of getimport output for local test functions, verifying import reconstruction; benign test code.
-
assert ==likely benign Test execs getimport output for add and squared.Reasoning
Same getimport round-trip test pattern with known local functions.
-
assert == assert ==likely benign Test execs getimport output for squared.Reasoning
Same getimport round-trip test pattern; benign.
-
assert ==likely benign Test execs getimport output for Bar class.Reasoning
Same getimport round-trip test pattern; benign.
-
assert == assert ==likely benign Test execs getimport output for Bar and compares names.Reasoning
Same getimport round-trip test pattern; benign.
-
assert ==likely benign Test execs getimport output for tm.quad in dill's test suite.Reasoning
Same getimport round-trip test pattern, here for tm.quad; benign.
-
assert == assert == #FIXME: wrong results for nested functions (e.g. tm.double_add, tm.quadratic)likely benign Test code that execs an import statement generated by dill's getimport helper to check source extraction.Reasoning
This is a test in dill's source-extraction suite. The exec call runs source text produced by ds.getimport for a known test function, using an empty globals dict and a local namespace that the test itself checks. The code is a test harness exercising dill's own round-trip, with no sign of hidden payloads or external input.
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.
|