Executive brief
Glances is a real-time system monitoring tool that exposes a REST API for remote access to performance data and process lists. A flaw in its cross-origin (CORS) security check allows attackers to bypass authentication credential protections when a configuration includes both a wildcard and specific trusted origins. An attacker can trick a victim's browser into making cross-origin requests to the Glances API and steal sensitive monitoring data, including process command lines (which may contain secrets), usernames, and PIDs.
Technical details
The vulnerability is a logic error in the CORS credentials guard at glances/outputs/glances_restful_api.py:298. The code checks `if cors_origins == ["*"] and cors_credentials:` using exact list equality, but Starlette's underlying CORSMiddleware determines wildcard behavior via membership test (`"*" in allow_origins`). When an operator configures cors_origins as a multi-entry list containing "*" (e.g., ["*", "https://trusted.example.com"]), the Glances guard fails to trigger (because the list is not exactly ["*"]), but Starlette still treats it as "allow all origins" and reflects the request's Origin header together with Access-Control-Allow-Credentials: true. An unauthenticated attacker can then craft a malicious webpage that, when visited by a victim who has previously logged into Glances via their browser, automatically sends cross-origin API requests that include the victim's cached HTTP Basic Auth credentials. This exposes the full authenticated monitoring dataset including process lists with command-line arguments. The fix is to change the check from exact equality to membership test: `if "*" in cors_origins and cors_credentials:`, matching the corrected pattern already deployed in the sibling XML-RPC server. Patch version 4.5.6 is available.
Affected products
- nicolargo Glances < 4.5.6
Timeline
- 2026-08-17: disclosed: Published in GitHub Advisory Database
- 2026-08-01: patched: Fix released in version 4.5.6