CVE-2022-35411: Rpc.py Rpc.py Vulnerable To Deserialization Of Vulnerability

CRITICAL
Advisory Identifier: GHSA-8rq8-f485-7v8x
CVSS 9.8
CWE-502 CWE-522
Published
Advisory Summary

CVE-2022-35411 is a CRITICAL (CVSS 9.8) rpc.py vulnerable to deserialization of vulnerability (CWE-502: Deserialization of Untrusted Data) affecting Rpc.py libraries in the PyPI ecosystem. The issue involves rpc.py vulnerable to deserialization of untrusted data. Remediation is available in the latest vendor maintenance releases.

CVE-2022-35411 at a Glance

CVE Identifier CVE-2022-35411
GHSA Identifier GHSA-8rq8-f485-7v8x
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-502: Deserialization of Untrusted Data
Affected Product Rpc.py
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 9.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2022-35411

To remediate this vulnerability, upgrade all affected Rpc.py dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

rpc.py fixed: Latest secure release
pip install rpc.py>=Latest secure release
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show rpc.py

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2022-35411, inspect your installed packages using pip:

pip show rpc.py

Analyze the terminal output to locate any version of Rpc.py in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.

Note: The pip show rpc.py command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-502: Deserialization of Untrusted Data, where the product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid. In Rpc.py, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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](https://github.com/abersheeran/rpc.py/issues/22), 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](https://github.com/abersheeran/rpc.py/commit/491e7a841ed9a754796d6ab047a9fb16e23bf8bd) 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]

CVE-2022-35411 Affected Rpc.py Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
rpc.py
PyPI
≥ 0.4.2
≤ 0.6.0

References

Frequently Asked Questions

What is CVE-2022-35411?
CVE-2022-35411 is a security vulnerability in Rpc.py involving rpc.py vulnerable to Deserialization of Untrusted Data under CWE-502: Deserialization of Untrusted Data.
Which Rpc.py versions are affected?
Affected versions include releases prior to current release patches across affected packages: rpc.py.
What version fixes CVE-2022-35411?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is rpc.py affected?
Yes, rpc.py is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2022-35411?
CVE-2022-35411 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2022-35411?
CVE-2022-35411 is classified under CWE-502: Deserialization of Untrusted Data (The product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid.).
How can I check PyPI dependencies for CVE-2022-35411?
Run the dependency tree command: 'pip show rpc.py'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-8rq8-f485-7v8x",
  "modified" : "2024-04-22T21:11:25Z",
  "published" : "2022-07-09T00:00:19Z",
  "aliases" : [ "CVE-2022-35411" ],
  "summary" : "rpc.py vulnerable to Deserialization of Untrusted Data",
  "details" : "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.\n\n[Per the maintainer](https://github.com/abersheeran/rpc.py/issues/22), 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.\n\nA [fix](https://github.com/abersheeran/rpc.py/commit/491e7a841ed9a754796d6ab047a9fb16e23bf8bd) exists on the `master` branch. As a workaround, use the following code to turn off pickle in older versions:\n```\ndel SERIALIZER_NAMES[PickleSerializer.name]\ndel SERIALIZER_TYPES[PickleSerializer.content_type]",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "rpc.py"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.4.2"
      }, {
        "last_affected" : "0.6.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-35411"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/abersheeran/rpc.py/issues/22"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/abersheeran/rpc.py/commit/491e7a841ed9a754796d6ab047a9fb16e23bf8bd"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/abersheeran/rpc.py"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ehtec/rpcpy-exploit"
  }, {
    "type" : "WEB",
    "url" : "https://medium.com/%40elias.hohl/remote-code-execution-0-day-in-rpc-py-709c76690c30"
  }, {
    "type" : "WEB",
    "url" : "https://medium.com/@elias.hohl/remote-code-execution-0-day-in-rpc-py-709c76690c30"
  }, {
    "type" : "WEB",
    "url" : "http://packetstormsecurity.com/files/167872/rpc.py-0.6.0-Remote-Code-Execution.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-502", "CWE-522" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-07-12T17:55:02Z",
    "nvd_published_at" : "2022-07-08T19:15:00Z"
  }
}