CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-68518

CVE-2026-68518: Command Injection Bypass in Glances via Cross-Field Shell-Operator Reconstruction

Amit Schendel
Amit Schendel
Senior Security Researcher

Aug 17, 2026·9 min read·4 visits

Executive Summary (TL;DR)

Incomplete sanitization of individual variables allows adjacent unescaped Mustache parameters to combine into a shell command operator (such as '&&'), leading to command execution when the template is rendered and executed.

A command injection bypass vulnerability exists in the Glances system monitoring tool prior to v4.5.6. This flaw permits an attacker with local process or container metadata control to bypass action-template sanitizers by reconstructing shell execution operators across adjacent unescaped variables. When a system alert triggers a configured action template, the reconstructed operators are evaluated by the underlying shell, leading to arbitrary code execution in the context of the Glances process.

Vulnerability Overview

The Glances system monitoring tool includes a flexible action system designed to automate administrative tasks when system metrics cross predefined thresholds. This action framework allows administrators to configure commands that execute shell-level operations in response to system states, such as high CPU usage, memory exhaustion, or unexpected process behaviors. These commands are defined using Mustache-based template strings, which Glances dynamically populates with real-time system metrics before executing them via a shell environment.

Because the system metrics used to populate these action templates often originate from potentially untrusted local entities—such as process names, container metadata, or user command-line parameters—these fields represent an attack surface. If an adversary can influence these metric values, they can attempt to inject command-chaining operators to execute arbitrary commands. To counter this risk, Glances implements an automated sanitization pass on the template data dictionary prior to rendering.

This vulnerability, designated as CVE-2026-68518, is a high-severity command injection bypass that circumvents this sanitization mechanism. The underlying flaw resides in how the per-field sanitization routine processes special characters, specifically failing to account for characters that can be split across variable boundaries. When administrators configure adjacent unescaped variables within a template, an attacker can split a command operator such as && into two parts, positioning each half at the boundary of a distinct variable.

The consequence of this bypass is arbitrary OS command execution with the privileges of the Glances daemon process, which is frequently run as a high-privilege system user or root to gather comprehensive system telemetry. This allows local authenticated users or attackers capable of launching processes with controlled metadata to escalate their privileges to the system level.

Root Cause Analysis

The core of the vulnerability lies in the sanitization logic defined within glances/actions.py, specifically inside the _sanitize_mustache_dict() function. This component was designed to scrub a dictionary of template values before passing it to the Chevron Mustache rendering engine. The sanitization relies on an explicit blacklist of multi-character shell operators defined as _SHELL_OPERATORS = ('&&', '|', '>>', '>').

During a sanitization pass, each string value within the template data dictionary is inspected independently. If any of the blacklisted sequences are identified, they are neutralized. However, a single ampersand character (&) was not included in this blacklist because it is not, by itself, a command-chaining operator in standard POSIX shells. This omission creates a logical gap when variables are positioned adjacently in a template without intermediate spacing or escaping.

If an action template contains adjacent unescaped Mustache variables, such as {{{name}}}{{{cmdline}}} or {{&name}}{{&cmdline}}, the Chevron rendering engine executes simple string concatenation to resolve the final command. An attacker exploiting this behavior can supply a trailing single ampersand (&) at the end of the first field, and a leading single ampersand (&) at the start of the second field. Because neither field contains a forbidden multi-character operator on its own, both fields bypass the sanitization routine without modification.

Upon rendering, the Chevron engine concatenates these values directly, placing the trailing and leading ampersands side-by-side to construct a literal double ampersand (&&) in the final output. The reconstructed operator is then passed to the execution function, secure_popen(). Although secure_popen() is designed to enforce security controls, it receives the fully rendered command string containing the reconstructed && operator, which it parses as a command sequencer, causing the secondary injected command to execute.

Source Code and Patch Analysis

The vulnerability is resolved in commit 9c280eae5419da680827024b60f6265956e31994 by expanding the blacklist of shell operators. The patch inserts the single ampersand character & into the _SHELL_OPERATORS tuple. This change ensures that any standalone ampersand is neutralized within individual fields before the template rendering step, preventing the cross-boundary reconstruction of &&.

The following code diff displays the modification made to glances/actions.py:

# PRE-PATCH: Only multi-character operators were blocked, leaving single ampersands unscrubbed
# _SHELL_OPERATORS = ('&&', '|', '>>', '>')
 
# POST-PATCH: A lone '&' is added to prevent cross-boundary reconstruction
# of '&&' across adjacent unescaped Mustache variables (GHSA-qcpp-8x79-hhp3).
_SHELL_OPERATORS = ('&&', '|', '>>', '>', '&')

The accompanying unit tests verify this behavior by ensuring that standalone ampersands are stripped out of individual dictionary items, and that rendering consecutive values does not result in the generation of active shell operators:

def test_lone_ampersand_is_stripped(self):
    """GHSA-qcpp-8x79-hhp3: a single '&' must be neutralized to prevent reconstruction."""
    safe = _sanitize_mustache_dict({'name': 'evilproc&'})
    assert '&' not in safe['name']
    assert safe['name'] == 'evilproc '
 
def test_cross_field_ampersand_reconstruction_blocked(self):
    """Ensure trailing and leading ampersands do not form '&&' after rendering."""
    d = {'a': 'evilproc&', 'b': '& touch /tmp/evil'}
    safe = _sanitize_mustache_dict(d)
    rendered = safe['a'] + safe['b']
    assert '&&' not in rendered

While this patch successfully mitigates the specific cross-field reconstruction vector using ampersands, it highlights the architectural limitations of blacklist-based string sanitization. The core rendering flow remains structurally vulnerable to any unblacklisted metacharacter sequences that might be parsed by downstream shells or interpreters, depending on the execution context and environment.

Architectural Limitations and Bypass Vectors

An analysis of the remediation patch reveals that while the specific vector involving & is mitigated, the underlying architecture retains design limitations. The sanitization logic within _sanitize_mustache_dict() is shallow; it only evaluates top-level string values in the passed dictionary using isinstance(v, str). If a configuration or metric relies on a nested data structure, such as an object or dictionary, the type check evaluates to False, and the complex structure is copied to the sanitized dictionary completely unmodified.

If an administrator configures a custom action template that references these nested properties (for example, {{{process.metadata.name}}}) or iterates over list elements using Mustache block tags, these values bypass the sanitization routine entirely. In such scenarios, an attacker can inject standard shell operators like && or | directly into the nested fields to achieve command execution without needing to use the cross-field reconstruction technique.

Additionally, the blacklist approach relies on filtering a specific set of shell operators. Depending on the underlying operating system and shell environment used to execute the commands, other control characters might not be handled. If characters such as semicolons (;), raw newline bytes (\n), or backticks (`) are supported by the active shell and are not thoroughly sanitized, they could potentially be leveraged to alter command execution flows.

To achieve complete protection, applications should avoid executing dynamically rendered strings inside a shell context. Instead of shell-based execution, commands should be executed as direct processes with array-based arguments, which completely bypasses shell parsing and eliminates the possibility of command injection.

Attack Methodology and Proof-of-Concept

To exploit this vulnerability, an attacker must have the ability to run processes or containers on the target system that are monitored by Glances, and the Glances configuration must utilize an action template with adjacent unescaped variables. A common administrative configuration is logging critical process events, as illustrated in the following glances.conf excerpt:

[actions]
processlist_critical_action=logger -p user.err "Alert: Critical Process Detected: {{{name}}}{{{cmdline}}}"

The attack flow begins when the low-privileged attacker registers or executes a process designed to supply the payload elements. The attacker names the process nginx& and executes it with arguments that begin with & followed by the target command sequence.

Once the system metrics trigger the critical threshold for the process list, the Glances action manager invokes the configured template action. The individual fields bypass the sanitization pass because neither field contains a forbidden operator sequence on its own. When Chevron renders the template, it concatenates nginx& and & touch /tmp/evil directly, producing nginx&& touch /tmp/evil. The resulting command is then executed, spawning the injected system command under the privileges of the Glances process.

Remediation and Mitigation Guidelines

The primary remediation for CVE-2026-68518 is upgrading the Glances installation to version 4.5.6 or later. This version contains the updated _SHELL_OPERATORS blacklist which strips standalone ampersands, preventing the cross-boundary reconstruction of double ampersands. If immediate patching is not feasible, several tactical mitigations should be implemented to reduce the exposure and risk of exploitation.

First, administrators should audit their glances.conf files to identify and modify any action templates that feature adjacent, unescaped Mustache variables. If variables must be positioned consecutively, they should be separated by hardcoded alphanumeric delimiters or spaces, such as {{{name}}} - {{{cmdline}}}. This separation prevents the concatenation of trailing and leading characters from forming contiguous shell operators.

Second, the principle of least privilege should be applied to the Glances service. Glances should not run as the root user unless absolutely necessary. Running the service under a dedicated, unprivileged system user account restricts the impact of any potential command execution vulnerability to the permissions of that specific service account, preventing full system compromise.

Finally, network and system monitoring tools should be configured to detect anomalous child processes spawned by Glances. Security teams should monitor process execution logs for instances where the Glances parent process initiates shell environments like /bin/sh or /bin/bash with unexpected arguments, particularly commands containing network retrieval tools like curl or wget or unexpected writes to system paths.

Official Patches

nicolargoFix commit for command injection bypass

Fix Analysis (1)

Technical Appendix

CVSS Score
8.8/ 10
CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H

Affected Systems

Glances

Affected Versions Detail

Product
Affected Versions
Fixed Version
Glances
nicolargo
< 4.5.64.5.6
AttributeDetail
CWE IDCWE-78
Attack VectorLocal
CVSS Score8.8
Exploit Statusnone
KEV StatusNot Listed

MITRE ATT&CK Mapping

T1059Command and Scripting Interpreter
Execution
CWE-78
Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')

The application constructs an OS command using externally-influenced input, but it does not neutralize or incorrectly neutralizes special elements that can modify the intended command when it is sent to a downstream component.

Vulnerability Timeline

Security patch committed to repository
2026-07-05
CVE-2026-68518 Published
2026-08-17
Glances version 4.5.6 released
2026-08-17

References & Sources

  • [1]GHSA-qcpp-8x79-hhp3: Command injection bypass of action-template sanitizer
  • [2]Glances Fix Commit
  • [3]Glances v4.5.6 Release Notes
  • [4]CVE-2026-68518 Authority Record
Related Vulnerabilities
CVE-2026-32608

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•15 minutes ago•CVE-2026-59903
6.5

CVE-2026-59903: Cache Poisoning and Information Disclosure via CorsHandler Vary Header Overwrite

A technical analysis of CVE-2026-59903 in Netty's HTTP CORS handler, where the CorsHandler overwrites existing application Vary headers with Origin, leading to unauthorized caching of sensitive information.

Alon Barad
Alon Barad
0 views•5 min read
•about 1 hour ago•CVE-2026-59902
7.5

CVE-2026-59902: Memory Exhaustion in Netty SctpMessageCompletionHandler

An uncontrolled resource consumption vulnerability in Netty's SctpMessageCompletionHandler allows unauthenticated remote attackers to cause a Denial of Service. By transmitting a series of large, fragmented Stream Control Transmission Protocol (SCTP) messages, an attacker can exhaust the Java Virtual Machine heap or direct memory. This occurs because the handler fails to enforce limits on the cumulative byte size of buffered, incomplete SCTP fragments.

Amit Schendel
Amit Schendel
3 views•6 min read
•3 days ago•CVE-2026-53653
8.7

CVE-2026-53653: Unauthenticated Denial of Service via Unbounded Image Derivative Dimensions in Grav CMS

Grav CMS prior to version 1.7.53 and 2.0.0-rc.8 is vulnerable to an unauthenticated remote denial of service (DoS) vulnerability. By supplying crafted query parameters with extremely large dimensions to image assets, remote unauthenticated attackers can force the server to allocate massive amounts of system memory, leading to kernel Out-Of-Memory (OOM) termination of web worker processes.

Amit Schendel
Amit Schendel
11 views•7 min read
•3 days ago•CVE-2026-53657
8.2

CVE-2026-53657: Privilege Escalation via Overly Permissive Unix Domain Socket in Lima Guest Agent

CVE-2026-53657 is a local privilege escalation vulnerability in Lima (lima-vm/lima) affecting versions prior to 2.1.3 when configured with the QEMU driver. The guest agent daemon, running as root, creates its communication socket `/run/lima-guestagent.sock` with world-writable permissions (0777). This allows unprivileged local users to command the agent to establish arbitrary tunnels, including to privileged local UNIX sockets (like D-Bus). Because the target daemon authenticates the incoming connection using the credentials of the root-owned guest agent (via SO_PEERCRED), unprivileged users can perform root operations, resulting in complete guest VM compromise.

Amit Schendel
Amit Schendel
8 views•9 min read
•3 days ago•CVE-2026-10740
5.3

CVE-2026-10740: Denial of Service in s2n-quic CryptoStream Reassembly

An unauthenticated Denial of Service vulnerability exists in the s2n-quic library's CryptoStream reassembler due to a lack of buffer limits on out-of-order cryptographic frames. An attacker can transmit a crafted CRYPTO frame with an extremely high offset and nominal payload, forcing the receiver to execute unbounded memory allocations and causing service crashes.

Amit Schendel
Amit Schendel
6 views•7 min read
•3 days ago•CVE-2026-55153
7.1

CVE-2026-55153: JNDI Injection and Deserialization Gadget Abuse in mchange-commons-java

A JNDI Injection and Deserialization Gadget vulnerability exists in mchange-commons-java prior to version 0.6.0. The com.mchange.v2.naming.JavaBeanObjectFactory component permits arbitrary class instantiation and setter invocation, allowing attackers to perform Server-Side Request Forgery (SSRF) and remote class loading.

Alon Barad
Alon Barad
7 views•5 min read