pyspark 4.0.5
- Source
- https://github.com/apache/spark
- Tag scanned
v4.0.5- Directory
python- Compared with
v4.0.4(0 signals introduced since)- Files
- 1221 scanned, 41 skipped (binary, oversized, or unrecognised)
- Signals
- 0 critical · 0 warn · 30 info
- Scan time
- 21.7 s
- LLM review
- Reviewed by claude-haiku-5-5 (Anthropic): 26 of 26 warn and critical signals; 26 demoted to info.
- Disclude version
- 4.3.0
- Scanned (UTC)
- 2026-10-28 14:28
Signals
Ordered by severity, then signals introduced in this release. Hidden characters are shown as ⟨U+…⟩.
-
; IFS=:;likely benign Docs snippet using IFS=: to join zip paths into PYTHONPATH.Reasoning
Documentation example in an rst file setting PYTHONPATH with a bash IFS join of zip globs. Standard shell idiom for building a classpath; not obfuscation.
-
likely benign Setup script execs the package's local version.py to read the version.
Reasoning
Standard PySpark setup.py idiom exec-ing pyspark/version.py to get __version__ at build time. Legitimate, though exec on a local file is a code smell; the file is part of the source tree.
-
likely benign Client setup script execs local version.py for the version string.
Reasoning
Same version-file exec pattern as the classic packaging setup; reads a local source file with no network or encoded payload.
-
likely benign Connect setup script execs local version.py for the version string.
Reasoning
Same benign version.py exec pattern in the connect packaging script.
-
# module. returnlikely benign cloudpickle dynamic import of a module by name during unpickling of subimports.Reasoning
cloudpickle's subimport helper imports a module by name, a documented and necessary dynamic import in a serialization library.
-
= yieldlikely benign Frame walking helper used to capture call-site info for PySpark errors.Reasoning
Walks the call stack to build error context for PySpark error messages; ordinary diagnostic introspection.
-
= = returnlikely benign Imports a class by dotted path when loading ML model metadata.Reasoning
Resolves a dotted class path from saved metadata to load ML stages; standard plugin-style import in PySpark ML persistence.
-
= = returnlikely benign Dotted-path class import for ML model loading in connect readwrite.Reasoning
Same class-path resolution for ML read/write of Spark Connect models; expected behavior.
-
= = returnlikely benign Dotted-path class import for ML persistence in util.py.Reasoning
Standard dotted-path import used to reconstruct ML pipeline stages from metadata; legitimate.
-
= = returnlikely benign Dotted-path class import when loading ML Java/Python wrapper stages.Reasoning
Same ML persistence class-path import pattern in wrapper.py; legitimate framework code.
-
return . returnlikely benign Uses inspect.stack to fetch caller locals for SQL variable substitution.Reasoning
Reads caller's local variables via inspect.stack to resolve variable references in pandas-on-Spark SQL. The sys.exit/exec/eval co-occurrence is a weak anti-analysis signal that does not fit this function's purpose.
-
returnlikely benign Marshal serializer loads for function transport between Spark processes.Reasoning
marshal-based serializer is a deliberate PySpark feature for shipping functions between driver and workers; only sends code between trusted cluster components.
-
return == b: returnlikely benign Type-tagged deserialization dispatch including marshal and pickle.Reasoning
Dispatch on a type byte choosing marshal or pickle for internal Spark serialization; design of trusted inter-process protocol, not hidden payload.
-
returnlikely benign Decompresses serialized data before deserializing in Spark's serializer.Reasoning
zlib-wrapped serializer for compressing Spark data between trusted workers; ordinary compression, not a dropper.
-
=likely benign Interactive shell executes the file named by PYTHONSTARTUP.Reasoning
Shell startup honors PYTHONSTARTUP by compiling and executing the user's own startup file, the standard Python interactive behavior. Not hidden code; it runs only where the user sets the variable.
-
=likely benign Executes user-supplied PYTHONSTARTUP code in the PySpark shell.Reasoning
Companion exec of the PYTHONSTARTUP compiled code, same legitimate user-configured startup hook.
-
likely benign Test cleanup removing a temp directory via os.system with a formatted path.
Reasoning
This is a test in the PySpark catalog suite that removes a temporary directory with os.system and a formatted path. The command is built from a tmp_dir the test controls, not from external input. Unsafe-looking shell use, but it is ordinary test cleanup rather than malicious.
-
likely benign Round-trip repr/eval check of type instances in a unit test.
Reasoning
The test calls eval(repr(instance)) to check round-trip representation of Spark types. The pickle import is incidental; this is a round-trip assertion in a test, not a multi-stage payload.
-
likely benign eval of repr output of test-created type instances.
Reasoning
eval on repr of locally constructed type objects in a test assertion. Legitimate test technique, not attacker-controlled input.
-
# check repr =likely benign eval of repr output of a type object in a test assertion.Reasoning
Same pattern: eval(repr(variants[0])) inside a test checking string representation of a type. Benign test code.
-
= =likely benign Dynamic __import__ used to resolve a UDT class from its module path.Reasoning
This is the UDT deserialization path that imports a module named from a stored class path, then checks hasattr. It is a dynamic import that can be abused in principle, but it mirrors the expected design for loading user-defined types by module name and is a known legitimate pattern in PySpark.
-
= return return Falselikely benign Fixed tput shell probe to detect terminal color support.Reasoning
The command is a fixed string checking terminal color support via tput, with no external input. os.popen on a constant is benign, even though the finding labels it non-literal.
-
# iterator is a tuple in the form of (pandas.DataFrame, arrow_return_type). yield from yield fromlikely benign Worker applies the user's UDF to batched arguments via a local eval name.Reasoning
In the worker, eval is used as the UDF function invoked on batched arguments; this is the core Python UDF execution mechanism in PySpark, operating on user-supplied functions deliberately. Expected behavior for this component.
-
yield yieldlikely benign Worker invokes the UDF on batched arguments, part of normal UDF execution.Reasoning
Same as the sibling worker finding: eval here invokes the pickled UDF callable in the Spark worker, the designed execution path for Python UDFs.
-
echo "Combining collected coverage data under $COVERAGE_DIR/coverage_data" $COV_EXEC combine echo "Creating XML report file at python/coverage.xml" $COV_EXEC xml --ignore-errors --include "pyspark/*" --omit "*/pyspark/cloudpickle/*,*/pyspark/sql/connect/proto/*,*/python/pyspark/loose_version.py" -
echo "Creating XML report file at python/coverage.xml" $COV_EXEC xml --ignore-errors --include "pyspark/*" --omit "*/pyspark/cloudpickle/*,*/pyspark/sql/connect/proto/*,*/python/pyspark/loose_version.py" echo "Reporting the coverage data at $COVERAGE_DIR/coverage_data/coverage" -
echo "Reporting the coverage data at $COVERAGE_DIR/coverage_data/coverage" $COV_EXEC report --include "pyspark/*" --omit "*/pyspark/cloudpickle/*,*/pyspark/sql/connect/proto/*,*/python/pyspark/loose_version.py" echo "Generating HTML files for PySpark coverage under $COVERAGE_DIR/htmlcov" -
echo "Generating HTML files for PySpark coverage under $COVERAGE_DIR/htmlcov" $COV_EXEC html --ignore-errors --include "pyspark/*" --directory "$COVERAGE_DIR/htmlcov" --omit "*/pyspark/cloudpickle/*,*/pyspark/sql/connect/proto/*,*/python/pyspark/loose_version.py" popd -
likely benign Test runner removes a temporary directory via os.system.
Reasoning
Test runner cleanup removing a temp directory with os.system on a concatenated path. The path comes from the runner's own temp directory, so it is a poor-practice shell call but not malicious.
-
info
warn→ info by reviewnarrow-file-charsetpython/test_support/sql/streaming/time/text-with-time-test.txt:1:12024-05-24 15:03:20;1 2024-05-24 15:03:21;2 2024-05-24 15:03:24;3likely benign Plain-text streaming test fixture of timestamps and counters.Reasoning
The file is timestamped test data with digits, colons, dashes and semicolons, which naturally uses a small character set. Not obfuscation.
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.
&&