Loading advisory.
Loading advisory.
Glances: as_dict_secure() 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 ''".
Published 2026-08-17 17:06 UTC · Modified 2026-08-19 12:55 UTC
Severity and EPSS are shown separately. Helm does not combine them into one score. How tiers work
| Package | Ecosystem | Affected | Fixed in | Upgrade command |
|---|---|---|---|---|
| glances | PyPI | < 4.5.6 versions 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.3.6, 1.3.7, 1.4, 1.4.1, 1.4.1.1, 1.4.2, 1.4.2.1, 1.5, 1.5.1, 1.5.2, 1.6, 1.6.1, 1.7, 1.7.1, 1.7.2 and 115 more | 4.5.6 | pip install --upgrade 'glances>=4.5.6' |
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.
Glances latest (Docker: nicolargo/glances:latest)
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 sanitizedIn 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 (contains user:pass@ in URL) ✗
public_username → no match → returned in full ✗
Unauthenticated credential disclosure via GET /api/4/config or GET /api/4/config/ip
as_dict_secure() exists specifically to protect credentials in no-auth mode but fails to mask public_username and credential-bearing URLs in public_api
Glances in web server mode without --password (default, no auth)
glances.conf [ip] section with public_api containing embedded credentials and/or public_username set
Glances latest (Docker: nicolargo/glances:latest)
Remote Docker lab at http://10.140.200.102:8080
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": "********"}See C:/Tools/glances-config-leak-evidence.txt.
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
Add "username" and "login" to sensitive key pattern, and check values for embedded credentials in URLs.
2026-07-28: Vulnerability discovered and verified via Docker deployment
GitHub username: Todor
No public exploit code known to Helm's sources (Nuclei templates, Metasploit, Exploit-DB and PoC-in-GitHub). That does not mean none exists.
One EPSS score on record: 0.004 on 2026-11-24.
| Date | Score | Previous | Model |
|---|---|---|---|
| 2026-11-24 | 0.004 | first score | v2026.06.15 |