Skip to content

Commit

Permalink
PickleSerializer is turned off by default
Browse files Browse the repository at this point in the history
  • Loading branch information
abersheeran committed Jul 6, 2022
1 parent 3d5c319 commit 491e7a8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions rpcpy/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,21 @@ def decode(self, data: bytes) -> typing.Any:
return cbor.loads(data)


# Since the release of pickle to the external network may lead to
# arbitrary code execution vulnerabilities, this serialization
# method is not enabled by default. It is recommended to turn it on
# when there is physical isolation from the outside.

SERIALIZER_NAMES = {
JSONSerializer.name: JSONSerializer(),
PickleSerializer.name: PickleSerializer(),
# PickleSerializer.name: PickleSerializer(),
MsgpackSerializer.name: MsgpackSerializer(),
CBORSerializer.name: CBORSerializer(),
}

SERIALIZER_TYPES = {
JSONSerializer.content_type: JSONSerializer(),
PickleSerializer.content_type: PickleSerializer(),
# PickleSerializer.content_type: PickleSerializer(),
MsgpackSerializer.content_type: MsgpackSerializer(),
CBORSerializer.content_type: CBORSerializer(),
}
Expand Down

0 comments on commit 491e7a8

Please sign in to comment.