Summary
Glances: asdictsecure() Value-Level Bypass Leaks Credentials in URL Values via /api/4/config
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 ✗
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:[email protected]/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
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
CVE-2026-68520 has a CVSS score of 5.3 (Medium). The vector is network-reachable, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (4.5.6); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
Frequently Asked Questions
- What is CVE-2026-68520? CVE-2026-68520 is a medium-severity security vulnerability in glances (pip), affecting versions < 4.5.6. It is fixed in 4.5.6.
- How severe is CVE-2026-68520? CVE-2026-68520 has a CVSS score of 5.3 (Medium). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which versions of glances are affected by CVE-2026-68520? glances (pip) versions < 4.5.6 is affected.
- Is there a fix for CVE-2026-68520? Yes. CVE-2026-68520 is fixed in 4.5.6. Upgrade to this version or later.
- Is CVE-2026-68520 exploitable, and should I be worried? Whether CVE-2026-68520 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2026-68520 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2026-68520? Upgrade
glancesto 4.5.6 or later.