{"id":"CVE-2026-33641","aliases":["CVE-2026-33641","GHSA-qhj7-v7h7-q4c7","PYSEC-2026-2174"],"related":[],"kind":"vulnerability","state":"published","title":"Glances Vulnerable to Command Injection via Dynamic Configuration Values","summary":"Glances is an open-source system cross-platform monitoring tool. Prior to version 4.5.3, 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. This issue has been patched in version 4.5.3.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Glances is an open-source system cross-platform monitoring tool. Prior to version 4.5.3, 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. This issue has been patched in version 4.5.3.","source":"cvelist"},{"lang":"en","text":"## Summary\nGlances 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.\n\nIf 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.\n\n## Details\n\n1. Glances loads configuration files from user, system, or custom paths during initialization.\n2. When retrieving a configuration value, Config.get_value() scans for substrings enclosed in backticks.\n\n   **File: glances/config.py**\n  \n```\nmatch = self.re_pattern.findall(ret)\nfor m in match:\n    ret = ret.replace(m, system_exec(m[1:-1]))\n```\n\n\n3. The extracted string is passed directly to system_exec().\n\n   **File: glances/globals.py**\n   \n   \n```sh\nres = subprocess.run(command.split(' '), stdout=subprocess.PIPE).stdout.decode('utf-8')\n```\n\n4. The command is executed and its output replaces the original configuration value.\n\nThis execution occurs automatically whenever the configuration value is read.\n\n### Affected Files\n\n   glances/config.py — dynamic configuration parsing\n\n   glances/globals.py — command execution helper\n\n## Proof of Concept (PoC)\n\nScenario: Arbitrary command execution via configuration value\n\n**Step 1 — Create malicious configuration file**\n\n```sh\n/tmp/glances.conf\n```\n\nadd below txt on the file\n\n```\n[outputs]\nurl_prefix = 'id'\n```\n\n**Step 2 — Launch Glances with custom configuration**\n\n```sh\nglances -C /tmp/glances.conf\n```\n\n**Step 3 — Observe behavior**\n\nWhen Glances reads the configuration:\n\n  - The command inside backticks is executed\n  - Output replaces the configuration value\n  - Execution occurs without user interaction\n  \n  \n  Reproduce using  Python code\n  \n  \n```\nimport subprocess\nimport re\n\ndef system_exec(command):\n    return subprocess.run(command.split(' '), stdout=subprocess.PIPE).stdout.decode().strip()\n\nvalue = \"`id`\"\npattern = re.compile(r'(`.+?`)')\n\nfor m in pattern.findall(value):\n    print(system_exec(m[1:-1]))\n```\n\n**Output:**\n\n\n`uid=1000(user) gid=1000(user) groups=1000(user)`\n\n## Impact\n\n### Arbitrary Command Execution\n\nAny command enclosed in backticks inside a configuration value will execute with the privileges of the Glances process.\n\n### Potential Privilege Escalation\n\nIf Glances runs as a privileged service (e.g., root), commands execute with those privileges.\n\nPossible scenarios include:\n\n-   Misconfigured file permissions allowing unauthorized config modification\n-   Shared systems where configuration directories are writable by multiple users\n-   Container environments with mounted configuration volumes\n-   Automated configuration management systems that ingest untrusted data","format":"markdown","source":"ghsa"},{"lang":"es","text":"Glances es una herramienta de monitoreo de sistema de código abierto multiplataforma. Antes de la versión 4.5.3, Glances admite valores de configuración dinámicos en los que las subcadenas encerradas entre comillas invertidas se ejecutan como comandos del sistema durante el análisis de la configuración. Este comportamiento ocurre en Config.get_value() y se implementa sin validación ni restricción de los comandos ejecutados. Si un atacante puede modificar o influir en los archivos de configuración, se ejecutarán automáticamente comandos arbitrarios con los privilegios del proceso de Glances durante el inicio o la recarga de la configuración. En implementaciones donde Glances se ejecuta con privilegios elevados (por ejemplo, como un servicio del sistema), esto puede conducir a una escalada de privilegios. Este problema ha sido parcheado en la versión 4.5.3.","source":"nvd"}],"published":"2026-03-30T17:01:27.000Z","modified":"2026-10-26T22:10:00.163Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"}],"cwes":["CWE-78"],"affected":[{"ranges":[{"version":"< 4.5.3","status":"affected"}],"vendor":"nicolargo","product":"glances","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"4.5.3"}],"ecosystem":"PyPI","package":"glances","purl":"pkg:pypi/glances","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"4.5.3"}],"vendor":"nicolargo","product":"glances","cpe":"cpe:2.3:a:nicolargo:glances:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"4.5.3"}],"ecosystem":"PyPI","package":"glances","purl":"pkg:pypi/glances","source":"pysec"}],"references":[{"url":"https://github.com/nicolargo/glances/security/advisories/GHSA-qhj7-v7h7-q4c7","tags":["evidence","exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/nicolargo/glances/commit/358d76a225fc21a9f95d2c4d7e46fafe64a644c6","tags":["fix","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/nicolargo/glances/releases/tag/v4.5.3","tags":["advisory","product","release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-33641","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/nicolargo/glances","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2026-04-02T16:09:58.862Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-33641","url":"https://www.cve.org/CVERecord?id=CVE-2026-33641","licence":"CVE Terms of Use","modified":"2026-04-02T16:22:08.154Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-qhj7-v7h7-q4c7","url":"https://github.com/advisories/GHSA-qhj7-v7h7-q4c7","licence":"CC-BY-4.0","modified":"2026-07-13T07:26:25.827Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-33641","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-33641","licence":"Public domain","modified":"2026-10-26T22:10:00.163Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-2174","url":"https://osv.dev/vulnerability/PYSEC-2026-2174","licence":"CC-BY-4.0","modified":"2026-07-13T07:15:31.861Z"}],"updatedAt":"2026-11-25T22:59:17.788Z","epss":{"score":0.00965,"percentile":0.6271,"date":"2026-12-01T12:00:22.000Z"}}