CVE-2026-68517: Glances REST API CORS Credentials Guard Vulnerability

MODERATE
Advisory Identifier: GHSA-fp27-88fp-2phg
CVSS 6.5
CWE-942
Published
Advisory Summary

CVE-2026-68517 is a MODERATE (CVSS 6.5) rest api cors credentials guard vulnerability (CWE-942: Permissive Cross-domain Security Policy with Untrusted Domains) affecting Glances libraries in the PyPI ecosystem. The issue involves rest api cors credentials guard uses exact-match instead of membership test — bypassed by any multi-origin allowlist containing the wildcard. Remediation is available by upgrading affected packages to version 4.5.6.

CVE-2026-68517 at a Glance

CVE Identifier CVE-2026-68517
GHSA Identifier GHSA-fp27-88fp-2phg
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-942: Permissive Cross-domain Security Policy with Untrusted Domains
Affected Product Glances
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 6.5

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:H/I:N/A:N).

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 High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2026-68517

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: 4.5.6
pip install glances>=4.5.6
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-2026-68517, 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 4.5.6), 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-942: Permissive Cross-domain Security Policy with Untrusted Domains, where the product uses a web-client protection mechanism such as a content security policy (csp) or cross-domain policy file, but the policy includes untrusted domains with which the web client is allowed to communicate. 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

### Summary Glances's REST API server includes a documented safety check intended to guarantee that `cors_credentials=True` can never be combined with an unrestricted CORS origin allowlist. The check compares the configured origin list to the wildcard using exact list equality (`cors_origins == ["*"]`) instead of a membership test. Any multi-entry origin configuration that merely includes `"*"` alongside other origins (e.g. `cors_origins=*,https://trusted.example.com`) bypasses the check entirely, while Starlette's underlying `CORSMiddleware` still treats the presence of `"*"` anywhere in the list as "allow all origins" and reflects the request's actual `Origin` header together with `Access-Control-Allow-Credentials: true`. This allows any website to read a victim's authenticated Glances monitoring data — including full process lists with command-line arguments — by exploiting the browser's automatic replay of cached HTTP Basic Auth credentials in a cross-origin request. ### Details `glances/outputs/glances_restful_api.py:298`: ```python if cors_origins == ["*"] and cors_credentials: logger.warning(...) cors_credentials = False ``` The intended guarantee is documented in `glances/outputs/glances_stdout_api_restful_doc.py:247-260`: *"Setting cors_credentials=True with cors_origins=* is not allowed. Glances will automatically disable credentials and log a warning if this combination is detected."* The exact-equality comparison only matches when `cors_origins` is precisely the single-element list `["*"]`. Starlette's `CORSMiddleware`, by contrast, determines wildcard behavior via `"*" in allow_origins` — a membership test — so any multi-entry list containing `"*"` is still treated by Starlette as "allow all origins," while Glances's own guard silently fails to disable credentials for that case, breaking the documented guarantee with no warning logged. This is the same exact-match-versus-membership-test bug shape that CVE-2026-46608 fixed in the sibling XML-RPC server (`glances/server.py`, which correctly performs `if '*' in cors_origins:`). The REST API's analogous check was never updated to the corrected pattern. ### PoC Configuration: ```ini [outputs] cors_origins=*,https://trusted.example.com cors_credentials=true ``` ``` # Confirm auth is required curl -s -i http://127.0.0.1:36212/api/4/cpu -> 401 Unauthorized, www-authenticate: Basic # Authenticated request, Origin header set to an arbitrary domain never configured curl -s -i -u glances:<password> -H "Origin: https://totally-evil-attacker.com" \ http://127.0.0.1:36212/api/4/cpu -> 200 OK access-control-allow-origin: https://totally-evil-attacker.com access-control-allow-credentials: true {"total": 0.0, "user": 0.0, ...} # Same against the process list, exposing command lines/usernames/PIDs curl -s -u glances:<password> -H "Origin: https://totally-evil-attacker.com" \ http://127.0.0.1:36212/api/4/processlist -> [{"cmdline": [...], "username": "...", "pid": ..., ...}, ...] (same access-control-allow-origin / access-control-allow-credentials headers) ``` ### Impact Any operator who configures `cors_origins` as a multi-entry list that includes the wildcard alongside one or more specific trusted origins — a plausible configuration mistake given the documented default is the bare wildcard, and an operator attempting to additionally permit a second legitimate dashboard origin may not realize the wildcard must first be removed — silently loses the documented credentials-disable protection. Any third-party website can then read the full authenticated monitoring dataset of any visitor who has previously logged into that Glances instance via their browser, including process command-line arguments (which frequently contain secrets passed as CLI flags), usernames, and PIDs. ### Remediation suggestion Change the check at `glances_restful_api.py:298` from `cors_origins == ["*"]` to `"*" in cors_origins`, matching the corrected pattern already used in `glances/server.py` for the XML-RPC server.

CVE-2026-68517 Affected Glances Versions

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

References

Frequently Asked Questions

What is CVE-2026-68517?
CVE-2026-68517 is a security vulnerability in Glances involving REST API CORS Credentials Guard Uses Exact-Match Instead of Membership Test — Bypassed by Any Multi-Origin Allowlist Containing the Wildcard under CWE-942: Permissive Cross-domain Security Policy with Untrusted Domains.
Which Glances versions are affected?
Affected versions include releases prior to 4.5.6 across affected packages: glances.
What version fixes CVE-2026-68517?
Upgrading to 4.5.6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is glances affected?
Yes, glances is affected in releases prior to 4.5.6. Upgrade your dependency to 4.5.6 or later.
What is the CVSS score of CVE-2026-68517?
CVE-2026-68517 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2026-68517?
CVE-2026-68517 is classified under CWE-942: Permissive Cross-domain Security Policy with Untrusted Domains (The product uses a web-client protection mechanism such as a Content Security Policy (CSP) or cross-domain policy file, but the policy includes untrusted domains with which the web client is allowed to communicate.).
How can I check PyPI dependencies for CVE-2026-68517?
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-fp27-88fp-2phg",
  "modified" : "2026-08-17T17:04:51Z",
  "published" : "2026-08-17T17:04:51Z",
  "aliases" : [ "CVE-2026-68517" ],
  "summary" : "Glances: REST API CORS Credentials Guard Uses Exact-Match Instead of Membership Test — Bypassed by Any Multi-Origin Allowlist Containing the Wildcard",
  "details" : "### Summary\nGlances's REST API server includes a documented safety check intended to guarantee that `cors_credentials=True` can never be combined with an unrestricted CORS origin allowlist. The check compares the configured origin list to the wildcard using exact list equality (`cors_origins == [\"*\"]`) instead of a membership test. Any multi-entry origin configuration that merely includes `\"*\"` alongside other origins (e.g. `cors_origins=*,https://trusted.example.com`) bypasses the check entirely, while Starlette's underlying `CORSMiddleware` still treats the presence of `\"*\"` anywhere in the list as \"allow all origins\" and reflects the request's actual `Origin` header together with `Access-Control-Allow-Credentials: true`. This allows any website to read a victim's authenticated Glances monitoring data — including full process lists with command-line arguments — by exploiting the browser's automatic replay of cached HTTP Basic Auth credentials in a cross-origin request.\n\n### Details\n`glances/outputs/glances_restful_api.py:298`:\n```python\nif cors_origins == [\"*\"] and cors_credentials:\n    logger.warning(...)\n    cors_credentials = False\n```\nThe intended guarantee is documented in `glances/outputs/glances_stdout_api_restful_doc.py:247-260`: *\"Setting cors_credentials=True with cors_origins=* is not allowed. Glances will automatically disable credentials and log a warning if this combination is detected.\"* The exact-equality comparison only matches when `cors_origins` is precisely the single-element list `[\"*\"]`. Starlette's `CORSMiddleware`, by contrast, determines wildcard behavior via `\"*\" in allow_origins` — a membership test — so any multi-entry list containing `\"*\"` is still treated by Starlette as \"allow all origins,\" while Glances's own guard silently fails to disable credentials for that case, breaking the documented guarantee with no warning logged.\n\nThis is the same exact-match-versus-membership-test bug shape that CVE-2026-46608 fixed in the sibling XML-RPC server (`glances/server.py`, which correctly performs `if '*' in cors_origins:`). The REST API's analogous check was never updated to the corrected pattern.\n\n### PoC\nConfiguration:\n```ini\n[outputs]\ncors_origins=*,https://trusted.example.com\ncors_credentials=true\n```\n```\n# Confirm auth is required\ncurl -s -i http://127.0.0.1:36212/api/4/cpu\n-> 401 Unauthorized, www-authenticate: Basic\n\n# Authenticated request, Origin header set to an arbitrary domain never configured\ncurl -s -i -u glances:<password> -H \"Origin: https://totally-evil-attacker.com\" \\\n  http://127.0.0.1:36212/api/4/cpu\n-> 200 OK\n   access-control-allow-origin: https://totally-evil-attacker.com\n   access-control-allow-credentials: true\n   {\"total\": 0.0, \"user\": 0.0, ...}\n\n# Same against the process list, exposing command lines/usernames/PIDs\ncurl -s -u glances:<password> -H \"Origin: https://totally-evil-attacker.com\" \\\n  http://127.0.0.1:36212/api/4/processlist\n-> [{\"cmdline\": [...], \"username\": \"...\", \"pid\": ..., ...}, ...]\n   (same access-control-allow-origin / access-control-allow-credentials headers)\n```\n\n### Impact\nAny operator who configures `cors_origins` as a multi-entry list that includes the wildcard alongside one or more specific trusted origins — a plausible configuration mistake given the documented default is the bare wildcard, and an operator attempting to additionally permit a second legitimate dashboard origin may not realize the wildcard must first be removed — silently loses the documented credentials-disable protection. Any third-party website can then read the full authenticated monitoring dataset of any visitor who has previously logged into that Glances instance via their browser, including process command-line arguments (which frequently contain secrets passed as CLI flags), usernames, and PIDs.\n\n### Remediation suggestion\nChange the check at `glances_restful_api.py:298` from `cors_origins == [\"*\"]` to `\"*\" in cors_origins`, matching the corrected pattern already used in `glances/server.py` for the XML-RPC server.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "glances"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.5.6"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/nicolargo/glances/security/advisories/GHSA-fp27-88fp-2phg"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nicolargo/glances/commit/890858944ab9d03730ec6b1ba42d4015e6d85db5"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/nicolargo/glances"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nicolargo/glances/releases/tag/v4.5.6"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-942" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-08-17T17:04:51Z",
    "nvd_published_at" : null
  }
}