Skip to content

[SPARK-59508][PYTHON] Harden client safety with restricted unpickle serializer - #58798

Open
gaogaotiantian wants to merge 1 commit into
apache:masterfrom
gaogaotiantian:safe-pickle
Open

gaogaotiantian wants to merge 1 commit into
apache:masterfrom
gaogaotiantian:safe-pickle

Conversation

@gaogaotiantian

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

  • Add an optional argument allowed_names for CloudPickleSerializer. If specified, it will be the allowlist for unpickling.
  • Replace the unrestricted pickleSer with a restricted one which only allows unpickling pstat.Stats.

Why are the changes needed?

The client unpickles arbitrary bytes from the server. If the server is compromised, this will behave as a RCE. We should only allow pickling on the data structure we actually use.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

A new test is added to test the restricted unpickler.

Was this patch authored or co-authored using generative AI tooling?

No.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant