Skip to content

rpc.py vulnerable to Deserialization of Untrusted Data

Critical severity GitHub Reviewed Published Jul 9, 2022 to the GitHub Advisory Database • Updated Apr 22, 2024

Package

pip rpc.py (pip)

Affected versions

>= 0.4.2, <= 0.6.0

Patched versions

None

Description

rpc.py through 0.6.0 allows Remote Code Execution because an unpickle occurs when the "serializer: pickle" HTTP header is sent. In other words, although JSON (not Pickle) is the default data format, an unauthenticated client can cause the data to be processed with unpickle.

Per the maintainer, rpc.py is not designed for an API that is open to the outside world, and external requests cannot reach rpc.py in real world use.

A fix exists on the master branch. As a workaround, use the following code to turn off pickle in older versions:

del SERIALIZER_NAMES[PickleSerializer.name]
del SERIALIZER_TYPES[PickleSerializer.content_type]
### References
- https://nvd.nist.gov/vuln/detail/CVE-2022-35411
- https://github.com/abersheeran/rpc.py/commit/491e7a841ed9a754796d6ab047a9fb16e23bf8bd
- https://github.com/ehtec/rpcpy-exploit
- https://medium.com/@elias.hohl/remote-code-execution-0-day-in-rpc-py-709c76690c30
- https://github.com/abersheeran/rpc.py/issues/22
- http://packetstormsecurity.com/files/167872/rpc.py-0.6.0-Remote-Code-Execution.html
- https://medium.com/%40elias.hohl/remote-code-execution-0-day-in-rpc-py-709c76690c30
Published by the National Vulnerability Database Jul 8, 2022
Published to the GitHub Advisory Database Jul 9, 2022
Reviewed Jul 12, 2022
Last updated Apr 22, 2024

Severity

Critical
9.8
/ 10

CVSS base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

CVE ID

CVE-2022-35411

GHSA ID

GHSA-8rq8-f485-7v8x

Source code

Checking history
See something to contribute? Suggest improvements for this vulnerability.