Описание
Glances: as_dict_secure() Value-Level Bypass Leaks Credentials in URL Values via /api/4/config
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():
In glances/outputs/glances_restful_api.py:
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
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
Пакеты
glances
< 4.5.6
4.5.6
Связанные уязвимости
Glances is an open-source system cross-platform monitoring tool. Prior to 4.5.6, as_dict_secure() in glances/config.py checks only option names and exposes public_username and credentials embedded in public_api values through unauthenticated GET /api/4/config and GET /api/4/config/ip requests. This issue is fixed in 4.5.6.
Glances is an open-source system cross-platform monitoring tool. Prior to 4.5.6, as_dict_secure() in glances/config.py checks only option names and exposes public_username and credentials embedded in public_api values through unauthenticated GET /api/4/config and GET /api/4/config/ip requests. This issue is fixed in 4.5.6.
Glances is an open-source system cross-platform monitoring tool. Prior ...