CVE-2021-23418: Glances XML External Entity Reference Vulnerability

MODERATE
Advisory Identifier: GHSA-r2mj-8wgq-73m6
CVSS 6.3
CWE-611
Published
Advisory Summary

CVE-2021-23418 is a MODERATE (CVSS 6.3) xml external entity reference vulnerability (CWE-611: Improper Restriction of XML External Entity Reference) affecting Glances libraries in the PyPI ecosystem. The issue involves xml external entity reference in glances. Remediation is available by upgrading affected packages to version 3.2.1.

CVE-2021-23418 at a Glance

CVE Identifier CVE-2021-23418
GHSA Identifier GHSA-r2mj-8wgq-73m6
Severity MODERATE
CVSS v3.1 Base Score 6.3
CWE Classification CWE-611: Improper Restriction of XML External Entity Reference
Affected Product Glances
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 6.3

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:R/S:U/C:L/I:L/A:L).

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

How to Fix CVE-2021-23418

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

Glances fixed: 3.2.1
pip install Glances>=3.2.1
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 Glances

How to Check if You Are Affected

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

pip show Glances

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

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-611: Improper Restriction of XML External Entity Reference, where the product processes an xml document that can contain xml entities with uris that resolve to documents outside of the intended sphere of control, causing the product to embed incorrect documents into its output. In Glances, 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

The package glances before 3.2.1 are vulnerable to XML External Entity (XXE) Injection via the use of Fault to parse untrusted XML data, which is known to be vulnerable to XML attacks.

CVE-2021-23418 Affected Glances Versions

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

References

Frequently Asked Questions

What is CVE-2021-23418?
CVE-2021-23418 is a security vulnerability in Glances involving XML External Entity Reference in Glances under CWE-611: Improper Restriction of XML External Entity Reference.
Which Glances versions are affected?
Affected versions include releases prior to 3.2.1 across affected packages: Glances.
What version fixes CVE-2021-23418?
Upgrading to 3.2.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is Glances affected?
Yes, Glances is affected in releases prior to 3.2.1. Upgrade your dependency to 3.2.1 or later.
What is the CVSS score of CVE-2021-23418?
CVE-2021-23418 has a CVSS v3.1 base score of 6.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:L.
What CWE is associated with CVE-2021-23418?
CVE-2021-23418 is classified under CWE-611: Improper Restriction of XML External Entity Reference (The product processes an XML document that can contain XML entities with URIs that resolve to documents outside of the intended sphere of control, causing the product to embed incorrect documents into its output.).
How can I check PyPI dependencies for CVE-2021-23418?
Run the dependency tree command: 'pip show Glances'. 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-r2mj-8wgq-73m6",
  "modified" : "2024-09-20T20:59:24Z",
  "published" : "2021-08-09T20:43:14Z",
  "aliases" : [ "CVE-2021-23418" ],
  "summary" : "XML External Entity Reference in Glances",
  "details" : "The package glances before 3.2.1 are vulnerable to XML External Entity (XXE) Injection via the use of Fault to parse untrusted XML data, which is known to be vulnerable to XML attacks.\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:L"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "Glances"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.2.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-23418"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nicolargo/glances/issues/1025"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nicolargo/glances/commit/4b87e979afdc06d98ed1b48da31e69eaa3a9fb94"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nicolargo/glances/commit/85d5a6b4af31fcf785d5a61086cbbd166b40b07a"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nicolargo/glances/commit/9d6051be4a42f692392049fdbfc85d5dfa458b32"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-r2mj-8wgq-73m6"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/nicolargo/glances"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/glances/PYSEC-2021-115.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://snyk.io/vuln/SNYK-PYTHON-GLANCES-1311807"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-611" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-08-02T18:18:37Z",
    "nvd_published_at" : "2021-07-29T18:15:00Z"
  }
}