pyspark 4.1.4
- Source
- https://github.com/apache/spark
- Tag scanned
v4.1.4- Directory
python- Compared with
v4.1.3(0 signals introduced since)- Files
- 1324 scanned, 43 skipped (binary, oversized, or unrecognised)
- Signals
- 0 critical · 0 warn · 38 info
- Scan time
- 27.1 s
- LLM review
- Reviewed by claude-haiku-5-5 (Anthropic): 32 of 32 warn and critical signals; 32 demoted to info.
- Disclude version
- 4.3.0
- Scanned (UTC)
- 2026-10-28 14:29
Signals
Ordered by severity, then signals introduced in this release. Hidden characters are shown as ⟨U+…⟩.
-
; IFS=:;likely benign Docs bash example that sets IFS to colon to build PYTHONPATH from zip files.Reasoning
Documentation example of shell IFS to join a list of zip paths for PYTHONPATH. Standard word-splitting usage in a docs snippet, not obfuscation.
-
likely benign setup.py executes the local version.py to obtain the package version.
Reasoning
Standard PySpark packaging idiom: exec of pyspark/version.py to read the version string from a file in the source tree. Flagged as critical due to exec pattern, but the source is a local version file, not remote or encoded data.
-
likely benign setup.py execs pyspark/version.py to read the version.
Reasoning
Same benign version-file exec idiom as the classic packaging setup script; reads a local module to set the version.
-
likely benign setup.py execs the local connect version file to set the version.
Reasoning
Same benign pattern: exec of local pyspark_connect/version.py for version metadata during packaging.
-
# module. returnlikely benign cloudpickle helper that imports a module by its dotted name during deserialization.Reasoning
cloudpickle's subimport helper imports a module by name, a well-known legitimate mechanism for reconstructing modules during unpickling.
-
# noqa: S102likely benign tblib re-raises traceback code via exec with the original frame globals and locals.Reasoning
tblib's reraise/exec of traceback code objects is a known library pattern used to re-raise exceptions with original frames; the noqa comment indicates intentional use, not malicious.
-
= yieldlikely benign Walks the call stack via inspect.currentframe to build error context.Reasoning
Error-reporting utility walking the call stack to find the user's frame for error context; ordinary introspection.
-
= = Falselikely benign Uses inspect.currentframe to check whether logging originates inside pyspark.Reasoning
Logging helper inspecting frames to determine whether the call originates from pyspark; benign.
-
= = returnlikely benign Loads a class by dotted path using __import__ for ML model deserialization.Reasoning
Standard class-path loader that imports a module from a dotted name taken from saved metadata, a common ML persistence pattern; the name comes from the library's own serialized class names rather than attacker-controlled network input.
-
= = returnlikely benign Dynamic import of an ML class from its dotted name during model loading.Reasoning
Same class-by-name import helper for ML read/write; legitimate reflection on library class names.
-
= = returnlikely benign Resolves an ML class by dotted name via __import__.Reasoning
Standard ML utility resolving a class from a dotted name for reconstruction; legitimate reflection.
-
= = returnlikely benign Resolves an ML wrapper class by dotted name via __import__.Reasoning
Same ML class-resolution pattern in the Java wrapper; legitimate reflection.
-
return . returnlikely benign Retrieves caller frame locals via inspect.stack to resolve SQL variable references.Reasoning
Pandas-on-Spark SQL helper reads caller locals via inspect.stack to resolve variables for query interpolation. The anti-analysis note is a heuristic artifact of exec/eval appearing in the file; the code itself is legitimate frame introspection.
-
info
warn→ info by reviewframe-introspectionpython/pyspark/pipelines/source_code_location.py:65:37# Stack is ordered from the caller first to the callee last. = =likely benign Extracts the caller's source location via traceback and currentframe.Reasoning
Computes source location for pipeline definitions by inspecting the stack; ordinary introspection.
-
returnlikely benign Marshal-based serializer loads for PySpark internal data transfer.Reasoning
PySpark's marshal serializer for Python bytecode exchange between its own driver and workers; the marshal use is the documented internal serialization format, not attacker-facing input.
-
return == b: returnlikely benign Type-tagged deserializer choosing marshal or pickle for internal PySpark data.Reasoning
Type-prefixed deserialization dispatching to marshal or pickle for internal PySpark worker communication; the same legitimate serializer design as the adjacent code.
-
returnlikely benign A serializer wrapper decompresses zlib-compressed data before deserializing it.Reasoning
The loads method wraps a serializer's payload with zlib.decompress in a compressed-serializer wrapper. This is ordinary data compression for Spark's serialization, not a hidden payload.
-
=likely benign The PySpark shell compiles and executes the file named by PYTHONSTARTUP.Reasoning
The shell runs the user's own PYTHONSTARTUP file via compile and exec, which is the documented startup-script behaviour of the PySpark interactive shell. The code is user-supplied configuration, not an embedded payload, though exec at import time is worth noting.
-
=likely benign Executes the compiled PYTHONSTARTUP code in the shell.Reasoning
This exec call is the second half of the same PYTHONSTARTUP handling, executing the compiled user startup file. It is the expected behaviour of the shell.
-
info
encoding-base64python/pyspark/sql/tests/pandas/streaming/test_transform_with_state_state_variable_checkpoint_v2.py:26:7 -
info
encoding-base64python/pyspark/sql/tests/pandas/streaming/test_transform_with_state_state_variable_checkpoint_v2.py:37:5pass -
likely benign A test cleans up a temp directory via a shell rm command.
Reasoning
A unit test removes a temporary directory with os.system using a format string built from a test-created temp path. This is test cleanup with no untrusted input.
-
likely benign A test uses eval on repr output to verify type round-tripping.
Reasoning
The test imports pickle and calls eval(repr(instance)) to check round-tripping of type objects. The pickle import and eval are in a test checking repr behaviour, not a multi-stage payload.
-
likely benign A test evaluates the repr of type instances to compare them.
Reasoning
The eval call is the repr round-trip assertion in the same test; its input is the object's own repr in a unit test.
-
# check repr =likely benign A test evaluates a variant's repr to verify its string form.Reasoning
The test evals the repr of a variant to check its string form. Input is generated in the test itself, so this is a benign self-check.
-
= =likely benign Dynamically imports the module of a user-defined type from its JSON class path.Reasoning
The UDT loader imports the module named in a serialized UDT class path to recover the class. This is dynamic import driven by schema data, which carries some risk from untrusted JSON, but it matches the documented UDT deserialization design.
-
= return return Falselikely benign Runs a constant shell check to see whether the terminal supports colours.Reasoning
The os.popen argument is a fixed shell test string checking terminal colour support, so the command is not attacker-controlled despite the flag.
-
# iterator is a tuple in the form of (pandas.DataFrame, arrow_return_type). yield from yield fromlikely benign Calls a UDTF's eval method on batch arguments.Reasoning
eval here is a local UDTF evaluation function invoked on Arrow batch arguments, not Python's builtin eval. The non-literal flag is a false positive from the name.
-
# iterator is a tuple in the form of (pyarrow.RecordBatch, arrow_return_type). yield from yield fromlikely benign Calls a UDTF's eval method on Arrow record batch arguments.Reasoning
Same pattern: a UDTF eval method applied to RecordBatch arguments within the worker's data path, not builtin eval.
-
# For PyArrow UDTFs, pass RecordBatches directly (no row conversion needed) yield from yield fromlikely benign Calls a UDTF's eval method on Arrow record batches.Reasoning
Same UDTF eval method call, applied to Arrow record batches. The name collides with builtin eval and there is no dynamic code evaluation.
-
yield yieldlikely benign Calls a UDTF's eval method over argument rows.Reasoning
Same pattern again: a UDTF eval method call over row arguments, a legitimate worker function, not dynamic execution.
-
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 The test runner deletes a temp directory with a shell rm on macOS.
Reasoning
The test runner removes a temp directory via os.system with a path from tempfile. The path is internally generated, and the non-Darwin branch uses shutil.rmtree, so this is ordinary cleanup.
-
exec "$@"likely benign Bash launcher that execs its arguments under the viztracer profiler.Reasoning
A wrapper script ending in exec "$@" is the standard idiom for running a command with a prefix tool (viztracer) and passing through arguments. The argument source is the caller's own command line, so the dynamic path is expected for a launcher wrapper, not a dropper.
-
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;3dismissed Plain-text test fixture containing timestamped rows for SQL streaming tests.Reasoning
The file is test data for Spark streaming timestamp parsing: lines of dates, times, and row numbers. A narrow digit-and-punctuation charset is the natural result of timestamp content and is not an obfuscation technique.
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.
&&