CVE-2022-0315: Horovod Use Of Insecure Temporary File Vulnerability

HIGH
Advisory Identifier: GHSA-47wv-vhj2-g66m
CVSS 8.2
CWE-668 CWE-377
Published
Advisory Summary

CVE-2022-0315 is a HIGH (CVSS 8.2) use of insecure temporary file vulnerability (CWE-668: Exposure of Resource to Wrong Sphere) affecting Horovod libraries in the PyPI ecosystem. The issue involves use of insecure temporary file in horovod. Remediation is available by upgrading affected packages to version 0.24.0.

CVE-2022-0315 at a Glance

CVE Identifier CVE-2022-0315
GHSA Identifier GHSA-47wv-vhj2-g66m
Severity HIGH
CVSS v3.1 Base Score 8.2
CWE Classification CWE-668: Exposure of Resource to Wrong Sphere
Affected Product Horovod
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 8.2

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/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 None (C:N)
Integrity Low (I:L)
Availability High (A:H)

How to Fix CVE-2022-0315

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

horovod fixed: 0.24.0
pip install horovod>=0.24.0
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 horovod

How to Check if You Are Affected

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

pip show horovod

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

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-668: Exposure of Resource to Wrong Sphere, where the product exposes a resource to the wrong control sphere, providing unintended actors with inappropriate access to the resource. In Horovod, 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 The insecure `tempfile.mktemp()` is used when Horovod is run in an LSF job with `jsrun`. In that situation, a jsrun rank file is created with `mktemp`, which could be hijacked by another process to read or manipulate the content. This issue does not impact the use of MPI, Gloo, Spark or Ray. ### Patches The problem has been fixed in [b96ecae4](https://github.com/horovod/horovod/commit/b96ecae4dc69fc0a83c7c2d3f1dde600c20a1b41). ### Workarounds The rank file is not created when `binding_args` are provided in the `Settings` instance. ### References Please see https://github.com/horovod/horovod/pull/3358 for details. ### For more information If you have any questions or comments about this advisory: * Open an issue in [https://github.com/horovod/horovod](https://github.com/horovod/horovod/issues/new/choose)

CVE-2022-0315 Affected Horovod Versions

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

References

Frequently Asked Questions

What is CVE-2022-0315?
CVE-2022-0315 is a security vulnerability in Horovod involving Use of insecure temporary file in Horovod under CWE-668: Exposure of Resource to Wrong Sphere.
Which Horovod versions are affected?
Affected versions include releases prior to 0.24.0 across affected packages: horovod.
What version fixes CVE-2022-0315?
Upgrading to 0.24.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is horovod affected?
Yes, horovod is affected in releases prior to 0.24.0. Upgrade your dependency to 0.24.0 or later.
What is the CVSS score of CVE-2022-0315?
CVE-2022-0315 has a CVSS v3.1 base score of 8.2 (HIGH) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H.
What CWE is associated with CVE-2022-0315?
CVE-2022-0315 is classified under CWE-668: Exposure of Resource to Wrong Sphere (The product exposes a resource to the wrong control sphere, providing unintended actors with inappropriate access to the resource.).
How can I check PyPI dependencies for CVE-2022-0315?
Run the dependency tree command: 'pip show horovod'. 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-47wv-vhj2-g66m",
  "modified" : "2024-09-20T21:30:25Z",
  "published" : "2022-03-29T19:18:32Z",
  "aliases" : [ "CVE-2022-0315" ],
  "summary" : "Use of insecure temporary file in Horovod",
  "details" : "### Impact\nThe insecure `tempfile.mktemp()` is used when Horovod is run in an LSF job with `jsrun`. In that situation, a jsrun rank file is created with `mktemp`, which could be hijacked by another process to read or manipulate the content.\n\nThis issue does not impact the use of MPI, Gloo, Spark or Ray.\n\n### Patches\nThe problem has been fixed in [b96ecae4](https://github.com/horovod/horovod/commit/b96ecae4dc69fc0a83c7c2d3f1dde600c20a1b41).\n\n### Workarounds\nThe rank file is not created when `binding_args` are provided in the `Settings` instance.\n\n### References\nPlease see https://github.com/horovod/horovod/pull/3358 for details.\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [https://github.com/horovod/horovod](https://github.com/horovod/horovod/issues/new/choose)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "horovod"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.24.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/horovod/horovod/security/advisories/GHSA-47wv-vhj2-g66m"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-0315"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/horovod/horovod/pull/3358"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/horovod/horovod/commit/b96ecae4dc69fc0a83c7c2d3f1dde600c20a1b41"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-47wv-vhj2-g66m"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/horovod/horovod"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/horovod/PYSEC-2022-175.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://huntr.dev/bounties/7e50397b-dd63-4bb5-b56d-704094a7da45"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-377", "CWE-668" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-03-29T19:18:32Z",
    "nvd_published_at" : "2022-03-24T09:15:00Z"
  }
}