CVE-2022-31604: Nvflare Unsafe Deserialisation Vulnerability

CRITICAL
Advisory Identifier: GHSA-rcxc-3w2m-mp8h
CVSS 9.8
CWE-502
Published
Advisory Summary

CVE-2022-31604 is a CRITICAL (CVSS 9.8) unsafe deserialisation vulnerability (CWE-502: Deserialization of Untrusted Data) affecting Nvflare libraries in the PyPI ecosystem. The issue involves unsafe deserialisation in the pki implementation scheme of nvflare. Remediation is available by upgrading affected packages to version 2.1.2.

CVE-2022-31604 at a Glance

CVE Identifier CVE-2022-31604
GHSA Identifier GHSA-rcxc-3w2m-mp8h
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-502: Deserialization of Untrusted Data
Affected Product Nvflare
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-31604

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

nvflare fixed: 2.1.2
pip install nvflare>=2.1.2
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 nvflare

How to Check if You Are Affected

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

pip show nvflare

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

Note: The pip show nvflare 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 Nvflare, 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

### Impact NVFLARE contains a vulnerability in its PKI implementation module, where The CA credentials are transported via pickle and no safe deserialization. The deserialization of Untrusted Data may allow an unprivileged network attacker to cause Remote Code Execution, Denial Of Service, and Impact to both Confidentiality and Integrity. All versions before 2.1.2 are affected. CVSS Score = 9.8 [AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H](https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fnvd.nist.gov%2Fvuln-metrics%2Fcvss%2Fv3-calculator%3Fvector%3DAV%3AN%2FAC%3AL%2FPR%3AN%2FUI%3AN%2FS%3AU%2FC%3AH%2FI%3AH%2FA%3AH&data=05%7C01%7Cchesterc%40nvidia.com%7Ce9600bde16854b0b380008da4fc544f7%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C637910005925574215%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=5kBrXEmAbqp8R31JCH%2FG95MUly72UPVihnBwiRFmvBY%3D&reserved=0) ### Patches The patch will be included in nvflare==2.1.2 ### Workarounds Replace pickle serialization with JSON and change the code accordingly Additional information Issue Found by: Oliver Sellwood (@Nintorac)

CVE-2022-31604 Affected Nvflare Versions

1 component(s)
Fixed Versions:
2.1.2
Product / Package Ecosystem Affected Versions Fixed Version
nvflare
PyPI
< 2.1.2
2.1.2

References

Frequently Asked Questions

What is CVE-2022-31604?
CVE-2022-31604 is a security vulnerability in Nvflare involving Unsafe deserialisation in the PKI implementation scheme of NVFlare under CWE-502: Deserialization of Untrusted Data.
Which Nvflare versions are affected?
Affected versions include releases prior to 2.1.2 across affected packages: nvflare.
What version fixes CVE-2022-31604?
Upgrading to 2.1.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is nvflare affected?
Yes, nvflare is affected in releases prior to 2.1.2. Upgrade your dependency to 2.1.2 or later.
What is the CVSS score of CVE-2022-31604?
CVE-2022-31604 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-31604?
CVE-2022-31604 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-31604?
Run the dependency tree command: 'pip show nvflare'. 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-rcxc-3w2m-mp8h",
  "modified" : "2022-06-22T21:22:42Z",
  "published" : "2022-06-22T21:22:42Z",
  "aliases" : [ "CVE-2022-31604" ],
  "summary" : "Unsafe deserialisation in the PKI implementation scheme of NVFlare",
  "details" : "### Impact\nNVFLARE contains a vulnerability in its PKI implementation module, where The CA credentials are transported via pickle and no safe deserialization. The deserialization of Untrusted Data may allow an unprivileged network attacker to cause Remote Code Execution, Denial Of Service, and Impact to both Confidentiality and Integrity.\nAll versions before 2.1.2 are affected.\n\nCVSS Score = 9.8\n[AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H](https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fnvd.nist.gov%2Fvuln-metrics%2Fcvss%2Fv3-calculator%3Fvector%3DAV%3AN%2FAC%3AL%2FPR%3AN%2FUI%3AN%2FS%3AU%2FC%3AH%2FI%3AH%2FA%3AH&data=05%7C01%7Cchesterc%40nvidia.com%7Ce9600bde16854b0b380008da4fc544f7%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C637910005925574215%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=5kBrXEmAbqp8R31JCH%2FG95MUly72UPVihnBwiRFmvBY%3D&reserved=0)\n\n\n\n### Patches\nThe patch will be included in nvflare==2.1.2\n\n### Workarounds\nReplace pickle serialization with JSON and change the code accordingly\n\nAdditional information\nIssue Found by: Oliver Sellwood (@Nintorac)\n\n",
  "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" : "nvflare"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.1.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/NVIDIA/NVFlare/security/advisories/GHSA-rcxc-3w2m-mp8h"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-31604"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/NVIDIA/NVFlare/commit/fd018eea9dff925a765079a94c2f017920fcda67"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/NVIDIA/NVFlare"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/nvflare/PYSEC-2022-231.yaml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-502" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-06-22T21:22:42Z",
    "nvd_published_at" : "2022-07-01T18:15:00Z"
  }
}