GHSA-4h34-v6r8-mmjc CVE-2026-68520 PYSEC-2026-3664
Glances: as_dict_secure() Value-Level Bypass Leaks Credentials in URL Values via /api/4/config
- Severity
- 5.3 / 10
- Medium · CVSS 3.1
- Exploit chance (EPSS)
- 0.40%
- Chance of exploitation in the next 30 days. Higher than 34.82% of scored vulnerabilities.
- Known exploited
- No
- Not in CISA's catalog
- Weakness
- CWE-200 Exposure of Sensitive Information to an Unauthorized Actor
- Fix
4.5.6- Upgrade glances to this version or later
Description
Summary
Glances provides as_dict_secure() explicitly designed for unauthenticated API access, with a docstring stating it returns "a sanitised copy of the configuration dict" where "Sensitive keys in remaining sections are replaced by '********'". However, the implementation only checks KEY names against a regex pattern and never inspects VALUE content. The documented [ip] config section supports public_api (URL), public_username (login), and public_password (password). While public_password is correctly masked, both public_api (when containing embedded credentials like https://user:pass@host/) and public_username are returned in full to unauthenticated users via GET /api/4/config.
Affected Versions
Glances latest (Docker: nicolargo/glances:latest)
Root Cause
In glances/config.py, as_dict_secure():
_SECURE_SENSITIVE_KEY_RE = re.compile(r"password|token|secret|api_key|apikey|ssl_keyfile", re.IGNORECASE)
def as_dict_secure(self):
"""Return a sanitised copy of the configuration dict.
Intended for unauthenticated API access.
- Sensitive keys in remaining sections are replaced by '********'.
"""
sanitized = {}
for section, options in self.as_dict().items():
if section in _SECURE_BLOCKED_SECTIONS: continue
sanitized[section] = {
key: "********" if _SECURE_SENSITIVE_KEY_RE.search(key) else value
for key, value in options.items()
}
return sanitized
In glances/outputs/glances_restful_api.py:
# Line 1294
args_json = self.config.as_dict() if self.args.password else self.config.as_dict_secure()
The [ip] config section documents: public_api (URL), public_username (login), public_password (password).
public_password→ matches "password" → masked ✓public_api→ no match → returned in full (containsuser:pass@in URL) ✗public_username→ no match → returned in full ✗
Impact
- Unauthenticated credential disclosure via
GET /api/4/configorGET /api/4/config/ip as_dict_secure()exists specifically to protect credentials in no-auth mode but fails to maskpublic_usernameand credential-bearing URLs inpublic_api
Prerequisites
- Glances in web server mode without
--password(default, no auth) glances.conf[ip]section withpublic_apicontaining embedded credentials and/orpublic_usernameset
Environment
- Glances latest (Docker:
nicolargo/glances:latest) - Remote Docker lab at
http://10.140.200.102:8080
Reproduction Steps
docker run -d --name glances-test -p 8080:61208 -e GLANCES_OPT='-w' nicolargo/glances:latest
sleep 20
docker exec glances-test sed -i 's|public_api=https://ipv4.ipleak.net/json/|public_api=https://admin:secret123@ipv4.ipleak.net/json/|' /etc/glances/glances.conf
docker exec glances-test sed -i 's|#public_username=<myname>|public_username=myname|' /etc/glances/glances.conf
docker exec glances-test sed -i 's|#public_password=<mysecret>|public_password=mysecret|' /etc/glances/glances.conf
docker restart glances-test
sleep 15
curl -s "$TARGET/api/4/config/ip"
# Returns: {"public_api": "https://admin:secret123@...", "public_username": "myname", "public_password": "********"}
Evidence
See C:/Tools/glances-config-leak-evidence.txt.
Dedup Check
- GHSA-gfc2-9qmw-w7vh covers CORS but NOT value-level credential leak
- No existing GHSA covers
as_dict_secure()value-level filtering gap - 13 published GHSA, none covering this issue
Suggested Remediation
Add "username" and "login" to sensitive key pattern, and check values for embedded credentials in URLs.
Disclosure Timeline
- 2026-07-28: Vulnerability discovered and verified via Docker deployment
Reporter
GitHub username: Todor
Affected versions
PyPI
| Package | Vulnerable | Fixed in |
|---|---|---|
| glances | < 4.5.6 |
4.5.6 |
How to fix
Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.
glances PyPI → 4.5.6
- pip
pip install --upgrade "glances>=4.5.6"- poetry
poetry add "glances>=4.5.6"- uv
uv add "glances>=4.5.6"
Severity breakdown
CVSS 3.1 5.3
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- Low
- Integrity
- None
- Availability
- None
Weakness
CWE-200: Exposure of Sensitive Information to an Unauthorized Actor
The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.
How to prevent it
- Architecture and Design: Compartmentalize the system to have "safe" areas where trust boundaries can be unambiguously drawn. Do not allow sensitive data to go outside of the trust boundary and always be careful when interfacing with a compartment outside of the safe area. Ensure that appropriate compartmentalization is built into the system design, and the compartmentalization allows for and reinforces privilege separation functionality. Architects and designers should rely on the principle of least privilege to decide the appropriate time to use privileges and the time to drop privileges.
References
Advisories
Packages
Other links
Timeline
- Published
- Last updated by the source
- Latest EPSS score
Related advisories
| Advisory | Severity | Why it's related |
|---|---|---|
| GHSA-59fj-m2j6-hcxh Glances: `--disable-config-exec` does not cover on-alert action commands (incomplete fix of CVE-2026-53925) | High | Also affects glances |
| GHSA-73wf-9vmv-5pv9 Glances: Incomplete fix of CVE-2026-32608: action-template sanitizer is bypassed by nested stat values (process 'cmdline') → OS command injection | High | Also affects glances |
| GHSA-fp27-88fp-2phg Glances: REST API CORS Credentials Guard Uses Exact-Match Instead of Membership Test — Bypassed by Any Multi-Origin Allowlist Containing the Wildcard | Medium | Also affects glances |
| GHSA-qcpp-8x79-hhp3 Glances has a command injection bypass of action-template sanitizer via cross-field shell-operator reconstruction | High | Also affects glances |
| GHSA-3vwc-qwhc-3mj7 Glances has arbitrary file write and command execution via `secure_popen` redirection and chaining operators in AMP command configuration | High | Also affects glances |
| GHSA-w856-8p3r-p338 Glances: XML-RPC Server Missing Host Header Validation Enables DNS Rebinding Attack | Medium | Also affects glances |
| GHSA-87qc-fj39-wccr Glances: XML-RPC Multi-Origin CORS Configuration Silently Falls Back to Wildcard (Incomplete Fix for CVE-2026-33533) | High | Also affects glances |
| GHSA-9837-48hr-q32j Glances has Insecure Pickle Deserialization in its Version Cache that Leads to Arbitrary Code Execution | High | Also affects glances |
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor