Update dependency Glances to v4.5.4 [SECURITY]#317
Open
renovate[bot] wants to merge 1 commit into
Open
Conversation
40a047c to
a5a2224
Compare
a5a2224 to
aa51531
Compare
aa51531 to
53432da
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
==4.3.1→==4.5.4Warning
Some dependencies could not be looked up. Check the Dependency Dashboard for more information.
Glances Exposes Unauthenticated Configuration Secrets
CVE-2026-30928 / GHSA-gh4x-f7cq-wwx6
More information
Details
Summary
The /api/4/config REST API endpoint returns the entire parsed Glances configuration file (glances.conf) via self.config.as_dict() with no filtering of sensitive values. The configuration file contains credentials for all configured backend services including database passwords, API tokens, JWT signing keys, and SSL key passwords.
Details
Root Cause: The as_dict() method in config.py iterates over every section and every key in the ConfigParser and returns them all as a flat dictionary. No sensitive key filtering or redaction is applied.
Affected Code:
PoC
Step 3: Extract specific secrets:
Impact
Full Infrastructure Compromise: Database credentials (InfluxDB, MongoDB, PostgreSQL/TimescaleDB, CouchDB, Cassandra) allow direct access to all connected backend data stores.
Severity
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Glances has SQL Injection via Process Names in TimescaleDB Export
CVE-2026-30930 / GHSA-x46r-mf5g-xpr6
More information
Details
Summary
The TimescaleDB export module constructs SQL queries using string concatenation with unsanitized system monitoring data. The normalize() method wraps string values in single quotes but does not escape embedded single quotes, making SQL injection trivial via attacker-controlled data such as process names, filesystem mount points, network interface names, or container names.
Root Cause: The normalize() function uses f"'{value}'" for string values without escaping single quotes within the value. The resulting strings are concatenated into INSERT queries via string formatting and executed directly with cur.execute() — no parameterized queries are used.
Affected Code
PoC
Impact
Severity
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:PReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Glances exposes the REST API without authentication
CVE-2026-32596 / GHSA-wvxv-4j8q-4wjq
More information
Details
Summary
Glances web server runs without authentication by default when started with
glances -w, exposing REST API with sensitive system information including process command-lines containing credentials (passwords, API keys, tokens) to any network client.Details
Root Cause: Authentication is optional and disabled by default. When no password is provided, the API router initializes without authentication dependency, and the server binds to 0.0.0.0 exposing all endpoints.
Affected Code:
glances/outputs/glances_restful_api.py, lines 259-272glances/outputs/glances_restful_api.py, lines 477-480glances/outputs/glances_restful_api.py, lines 98-99glances/plugins/processlist/__init__.py, lines 127-140PoC
glances -w ##### Output: Glances Web User Interface started on http://0.0.0.0:61208/curl -s http://TARGET:61208/api/4/all > system_dump.json{ "pid": 4059, "username": "root", "process": "python3", "cmdline": [ "python3", "-c", "import time; time.sleep(3600)", "--api-key=sk-super-secret-token-12345", "--password=MySecretPassword123", "--db-pass=admin123" ] }Impact
Complete system reconnaissance and credential harvesting from any network client. Exposed endpoints include system info, process lists with full command-line arguments (containing passwords/API keys/tokens), network connections, filesystems, and Docker containers. Enables lateral movement and targeted attacks using stolen credentials.
Severity
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Glances has a Command Injection via Process Names in Action Command Templates
CVE-2026-32608 / GHSA-vcv2-q258-wrg7
More information
Details
Summary
The Glances action system allows administrators to configure shell commands that execute when monitoring thresholds are exceeded. These commands support Mustache template variables (e.g.,
,) that are populated with runtime monitoring data. Thesecure_popen()function, which executes these commands, implements its own pipe, redirect, and chain operator handling by splitting the command string before passing each segment tosubprocess.Popen(shell=False). When a Mustache-rendered value (such as a process name, filesystem mount point, or container name) contains pipe, redirect, or chain metacharacters, the rendered command is split in unintended ways, allowing an attacker who controls a process name or container name to inject arbitrary commands.Details
The action execution flow:
The mustache_dict contains the full stat dictionary, including user-controllable fields like process name, filesystem mnt_point, container name, etc. (glances/plugins/plugin/model.py:920-943).
In glances/actions.py:77-78, the Mustache library renders the template:
The secure_popen vulnerability (glances/secure.py:17-30):
And __secure_popen() (glances/secure.py:33-77) splits by > and | then calls Popen(sub_cmd_split, shell=False) for each segment. The function splits the ENTIRE command string (including Mustache-rendered user data) by &&, >, and | characters, then executes each segment as a separate subprocess.
Additionally, the redirect handler at line 69-72 writes to arbitrary file paths:
PoC
Scenario 1: Command injection via pipe in process name
Scenario 2: Command chain via && in container name
Impact
Arbitrary command execution: An attacker who can control a process name, container name, filesystem mount point, or other monitored entity name can execute arbitrary commands as the Glances process user (often root).
Privilege escalation: If Glances runs as root (common for full system monitoring), a low-privileged user who can create processes can escalate to root.
Arbitrary file write: The > redirect handling in secure_popen enables writing arbitrary content to arbitrary file paths.
Preconditions: Requires admin-configured action templates referencing user-controllable fields + attacker ability to run processes on monitored system.
Recommended Fix
Sanitize Mustache-rendered values before secure_popen processes them:
Severity
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:HReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Glances has Incomplete Secrets Redaction: /api/v4/args Endpoint Leaks Password Hash and SNMP Credentials
CVE-2026-32609 / GHSA-cvwp-r2g2-j824
More information
Details
Summary
The GHSA-gh4x fix (commit 5d3de60) addressed unauthenticated configuration secrets exposure on the
/api/v4/configendpoints by introducingas_dict_secure()redaction. However, the/api/v4/argsand/api/v4/args/{item}endpoints were not addressed by this fix. These endpoints return the complete command-line arguments namespace viavars(self.args), which includes the password hash (salt + pbkdf2_hmac), SNMP community strings, SNMP authentication keys, and the configuration file path. When Glances runs without--password(the default), these endpoints are accessible without any authentication.Details
The secrets exposure fix (GHSA-gh4x, commit 5d3de60) modified three config-related endpoints to use
as_dict_secure()when no password is configured:However, the
_api_argsand_api_args_itemendpoints were not part of this fix and still return all arguments without any sanitization:And the item-specific endpoint:
The
self.argsnamespace contains sensitive fields set during initialization inglances/main.py:password(line 806-819): When--passwordis used, this contains the salt + pbkdf2_hmac hash. An attacker can use this for offline brute-force attacks.snmp_community(line 445): Default"public", but may be set to a secret community string for SNMP monitoring.snmp_user(line 448): SNMP v3 username, default"private".snmp_auth(line 450): SNMP v3 authentication key, default"password"but typically set to a secret value.conf_file(line 198): Path to the configuration file, reveals filesystem structure.username(line 430/800): The Glances authentication username.Both endpoints are registered on the authenticated router (line 504-505):
When
--passwordis not set (the default), the router has NO authentication dependency (line 479-480), making these endpoints completely unauthenticated:PoC
Scenario 1: No password configured (default deployment)
Scenario 2: Password configured (authenticated deployment)
Impact
Unauthenticated network reconnaissance: When Glances runs without
--password(the common default for internal/trusted networks), anyone who can reach the web server can enumerate SNMP credentials, usernames, file paths, and all runtime configuration.Offline password cracking: When authentication is enabled, an authenticated user can retrieve the password hash (salt + pbkdf2_hmac) and perform offline brute-force attacks. The hash uses pbkdf2_hmac with SHA-256 and 100,000 iterations (see
glances/password.py:45), which provides some protection but is still crackable with modern hardware.Lateral movement: Exposed SNMP community strings and v3 authentication keys can be used to access other network devices monitored by the Glances instance.
Supply chain for CORS attack: Combined with the default CORS misconfiguration (finding 001), these secrets can be stolen cross-origin by a malicious website.
Recommended Fix
Apply the same redaction pattern used for the
/api/v4/configendpoints:Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Glances's Default CORS Configuration Allows Cross-Origin Credential Theft
CVE-2026-32610 / GHSA-9jfm-9rc6-2hfq
More information
Details
Summary
The Glances REST API web server ships with a default CORS configuration that sets
allow_origins=["*"]combined withallow_credentials=True. When both of these options are enabled together, Starlette'sCORSMiddlewarereflects the requestingOriginheader value in theAccess-Control-Allow-Originresponse header instead of returning the literal*wildcard. This effectively grants any website the ability to make credentialed cross-origin API requests to the Glances server, enabling cross-site data theft of system monitoring information, configuration secrets, and command line arguments from any user who has an active browser session with a Glances instance.Details
The CORS configuration is set up in
glances/outputs/glances_restful_api.pylines 290-299:The defaults are loaded from the config file, but when no config is provided (which is the common case for most deployments), the defaults are:
cors_origins = ["*"](all origins)cors_credentials = True(allow credentials)Per the CORS specification, browsers should not send credentials when
Access-Control-Allow-Origin: *. However, Starlette'sCORSMiddlewareimplements a workaround: whenallow_origins=["*"]andallow_credentials=True, the middleware reflects the requesting origin in the response header instead of using*. This means:https://evil.com/steal.htmlevil.commakesfetch("http://glances-server:61208/api/4/config", {credentials: "include"})Access-Control-Allow-Origin: https://evil.comandAccess-Control-Allow-Credentials: trueWhen Glances is running without
--password(the default for most internal network deployments), no authentication is required at all. Any website can directly read all API endpoints including system stats, process lists, configuration, and command line arguments.PoC
Step 1: Attacker hosts a malicious page.
Step 2: Verify CORS headers (without auth, default Glances).
Step 3: Verify data theft (without auth).
Step 4: With authentication enabled, verify CORS still allows cross-origin credentialed requests.
Impact
Without
--password(default): Any website visited by a user on the same network can silently read all Glances API endpoints, including complete system monitoring data (process list with command lines, CPU/memory/disk stats, network interfaces and IP addresses, filesystem mounts, Docker container info), configuration file contents (which may contain database passwords, export backend credentials, API keys), and command line arguments.With
--password: If the user has previously authenticated via the browser's Basic Auth dialog (which caches credentials), any website can make cross-origin requests that carry those cached credentials. This allows exfiltration of all the above data plus the password hash itself (via/api/4/args).Network reconnaissance: An attacker can use this to map internal network infrastructure by having victims visit a page that probes common Glances ports (61208) on internal IPs.
Chained with POST endpoints: The CORS policy also allows
POSTmethods, enabling an attacker to clear event logs (/api/4/events/clear/all) or modify process monitoring (/api/4/processes/extended/{pid}).Recommended Fix
Change the default CORS credentials setting to
False, and when credentials are enabled, require explicit origin configuration instead of wildcard:Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Glances has a SQL Injection in DuckDB Export via Unparameterized DDL Statements
CVE-2026-32611 / GHSA-49g7-2ww7-3vf5
More information
Details
Summary
The GHSA-x46r fix (commit 39161f0) addressed SQL injection in the TimescaleDB export module by converting all SQL operations to use parameterized queries and
psycopg.sqlcomposable objects. However, the DuckDB export module (glances/exports/glances_duckdb/__init__.py) was not included in this fix and contains the same class of vulnerability: table names and column names derived from monitoring statistics are directly interpolated into SQL statements via f-strings. While DuckDB INSERT values already use parameterized queries (?placeholders), the DDL construction and table name references do not escape or parameterize identifier names.Details
The DuckDB export module constructs SQL DDL statements by directly interpolating stat field names and plugin names into f-strings.
Vulnerable CREATE TABLE construction (
glances/exports/glances_duckdb/__init__.py:156-162):The
creation_listis built from stat dictionary keys in theupdate()method (glances/exports/glances_duckdb/__init__.py:117-118):The INSERT statement also uses the unescaped
pluginname (glances/exports/glances_duckdb/__init__.py:172-174):While INSERT values use
?placeholders (safe), the table name{plugin}is directly interpolated in both CREATE TABLE and INSERT INTO statements. Column names in creation_list are also directly interpolated without quoting.Comparison with the TimescaleDB fix (commit 39161f0):
The TimescaleDB fix addressed this exact pattern by:
psycopg.sql.Identifier()for table and column namespsycopg.sql.SQL()for composing queries%splaceholders for all valuesThe DuckDB module was not part of this fix despite having the same vulnerability class.
Attack vector:
The primary attack vector is through stat dictionary keys. While most keys come from hardcoded psutil field names (e.g.,
cpu_percent,memory_usage), any future plugin that introduces dynamic keys from external data (container labels, custom metrics, user-defined sensor names) would create an exploitable injection path. Additionally, the table name (plugin) comes from the internal plugins list, but any custom plugin with a crafted name could inject SQL.PoC
The injection is demonstrable when column or table names contain SQL metacharacters:
Impact
Defense-in-depth gap: The identical vulnerability pattern was identified and fixed in TimescaleDB (GHSA-x46r) but the fix was not applied to the sibling DuckDB module. This represents an incomplete patch that leaves the same attack surface open through a different code path.
Future exploitability: If any Glances plugin is added or modified to produce stat dictionary keys from external/user-controlled data (e.g., container metadata, custom metric names, SNMP OID labels), the DuckDB export would become immediately exploitable for SQL injection without any additional code changes.
Data integrity: A successful injection in the CREATE TABLE statement could corrupt the DuckDB database, create unauthorized tables, or modify schema in ways that affect other applications reading from the same database file.
Recommended Fix
Apply the same parameterization approach used in the TimescaleDB fix. DuckDB supports identifier quoting with double quotes:
Severity
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:LReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Glances's REST/WebUI Lacks Host Validation and Remains Exposed to DNS Rebinding
CVE-2026-32632 / GHSA-hhcg-r27j-fhv9
More information
Details
Summary
Glances recently added DNS rebinding protection for the MCP endpoint, but the main REST/WebUI FastAPI application still accepts arbitrary
Hostheaders and does not applyTrustedHostMiddlewareor an equivalent host allowlist.As a result, the REST API, WebUI, and token endpoint remain reachable through attacker-controlled domains in classic DNS rebinding scenarios. Once the victim browser has rebound the attacker domain to the Glances service, same-origin policy no longer protects the API because the browser considers the rebinding domain to be the origin.
This is a distinct issue from the previously reported default CORS weakness. CORS is not required for exploitation here because DNS rebinding causes the victim browser to treat the malicious domain as same-origin with the rebinding target.
Details
The MCP endpoint now has explicit host-based transport security:
However, the main FastAPI application for REST/WebUI/token routes is initialized without any host validation middleware:
There is no
TrustedHostMiddleware, no comparison against the configured bind host, and no allowlist enforcement for HTTPHostvalues on the REST/WebUI surface.The default bind configuration also exposes the service on all interfaces:
This combination means the HTTP service will typically be reachable from the victim machine under an attacker-selected hostname once DNS is rebound to the Glances listener.
The token endpoint is also mounted on the same unprotected FastAPI app:
Why This Is Exploitable
In a DNS rebinding attack:
https://attacker.example.attacker.exampleis rebound from the attacker's server to the Glances IP address.https://attacker.example, but those requests are delivered to Glances.Hostheader or enforce an allowed-host policy, it serves the response.The MCP code already acknowledges this threat model and implements host-level defenses. The REST/WebUI code path does not.
Proof of Concept
This issue is code-validated by inspection of the current implementation:
FastAPI(...)appTrustedHostMiddlewareor equivalent host validation is applied0.0.0.0In a live deployment, the expected verification is:
And if the operator exposes Glances without
--password(supported and common), the attacker can read endpoints such as:Even on password-enabled deployments, the missing host validation still leaves the REST/WebUI/token surface reachable through rebinding and increases the value of chains with other authenticated browser issues.
Impact
Recommended Fix
Apply host allowlist enforcement to the main REST/WebUI FastAPI app, similar in spirit to the MCP hardening:
At minimum:
Hostheader does not match an explicit allowlist0.0.0.0bind semantics as an access-control boundaryReferences
glances/outputs/glances_mcp.pyglances/outputs/glances_restful_api.pyglances/main.pySeverity
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Glances's Browser API Exposes Reusable Downstream Credentials via
/api/4/serverslistCVE-2026-32633 / GHSA-r297-p3v4-wp8m
More information
Details
Summary
In Central Browser mode, the
/api/4/serverslistendpoint returns raw server objects fromGlancesServersList.get_servers_list(). Those objects are mutated in-place during background polling and can contain aurifield with embedded HTTP Basic credentials for downstream Glances servers, using the reusable pbkdf2-derived Glances authentication secret.If the front Glances Browser/API instance is started without
--password, which is supported and common for internal network deployments,/api/4/serverslistis completely unauthenticated. Any network user who can reach the Browser API can retrieve reusable credentials for protected downstream Glances servers once they have been polled by the browser instance.Details
The Browser API route simply returns the raw servers list:
The main API router is only protected when the front instance itself was started with
--password. Otherwise there are no authentication dependencies at all:The Glances web server binds to
0.0.0.0by default:During Central Browser polling, server entries are modified in-place and gain a
urifield:For protected servers,
get_uri()loads the saved password from the[passwords]section (or thedefaultpassword), hashes it, and embeds it directly in the URI:Password lookup falls back to a global default:
The sample configuration explicitly supports browser-wide default password reuse:
The secret embedded in
uriis not the cleartext password, but it is still a reusable Glances authentication credential. Client connections send that pbkdf2-derived hash over HTTP Basic authentication:The Browser WebUI also consumes that raw
uridirectly and redirects the user to it:So once
server.uricontains credentials, those credentials are not just used internally; they are exposed to API consumers and frontend JavaScript.PoC
Step 1: Verified local live proof that server objects contain credential-bearing URIs
The following command executes the real
glances/servers_list.pyupdate logic against a live local HTTP server that always returns401. This forces Glances to mark the downstream server asPROTECTEDand then retry with the saved/default password. After the second refresh, the in-memory server list contains aurifield with embedded credentials.