GHSA-5344-6X9J-2W33
Plugin config secrets (ip public_password, ports URL/proxy credentials) disclosed unauthenticated via the limits endpoints (incomplete fix of GHSA-2jqf-3j6f-683p)
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-5344-6X9J-2W33 divulgada · CVSS 7.5 (GitHub) | |
| Divulgación | Modificada | Última actualización del registro | |
| 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
`GlancesPluginModel.load_limits()` copies every option of a plugin's config section into the
plugin's `_limits` dict. That is how plugins read their own settings, so it includes the
credentials glances.conf documents for plugins: `[ip] public_username` / `public_password`,
and in `[ports]` the userinfo of `web_N_url` and the `web_N_http_proxy` / `web_N_https_proxy`
values. The limits dict is then served as-is, with no `secure_option()` step, by
`GET /api/4/all/limits`, `GET /api/4/<plugin>/limits`, XML-RPC `getAllLimits()` and the MCP
resources `glances://limits` and `glances://limits/{plugin}`.
So on a default `glances -w` (bind 0.0.0.0, no password) `/api/4/config/ip` shows
`public_password: "******"` and `/api/4/ports` shows the URL as `http://******@host/...`
(the GHSA-2jqf-3j6f-683p fix), while `/api/4/ip/limits` and `/api/4/ports/limits` return the
same values in cleartext. This looks like a missed output path of GHSA-2jqf-3j6f-683p and of
the `/api/4/config` redaction (GHSA-gh4x-f7cq-wwx6, GHSA-4h34-v6r8-mmjc).
One detail makes it a bit worse than the config endpoint ever was: `load_limits` reads values
through `config.get_value()`, which evaluates backtick dynamic values. With
`` public_password=`cat /run/secrets/ip` `` the config endpoint only shows the unevaluated
template, but the limits endpoint serves the evaluated secret.
Affected code (develop, de61f9ab)
- `glances/plugins/plugin/model.py:740-755` — `load_limits` walks `config.items(<plugin>)` and
- `glances/plugins/plugin/model.py:788-792` — `get_limits()` returns `self._limits` unchanged.
- `glances/stats.py:426-435` — `getAllLimitsAsDict()` returns `{p: plugin.limits}` unchanged.
- `glances/outputs/glances_restful_api.py:956-970` (`_api_all_limits`) and `:1065-1081`
- `glances/server.py:198-200` — XML-RPC `getAllLimits()` dumps the same dict.
- `glances/outputs/glances_mcp.py:283-299` — `all_limits` / `plugin_limits` serialize the
The same code is in 4.5.6 (`model.py:738-746`), so every 4.x release I checked is affected.
Impact
Any client that can reach the REST API (default bind 0.0.0.0, no auth unless `--password`)
or the XML-RPC server can read credentials for third-party services that Glances uses: the
account of the public-IP lookup service, basic-auth credentials of monitored intranet sites,
proxy credentials, and anything loaded through a backtick dynamic value in a plugin section.
Commit 61b11b3a explicitly treats the web URL userinfo and the proxy settings as secrets
(`_web_secrets`, "never publish this"); the limits output still publishes them.
With the default `cors_origins = *` the response is also readable cross-origin, and the
WebUI itself fetches `api/4/all/limits` on load, but browser private-network checks can get
in the way of that, so the main case is a plain network client.
Precondition: the admin has put a credential in a plugin section. glances.conf documents
exactly that for `[ip]` and `[ports]`.
Reproduction
All on loopback, nothing external contacted.
- Config with `[ip] public_username=alice`, `public_password=IP-SECRET-123` and
- Run `glances -C test.conf -w --bind 127.0.0.1 --disable-plugin all --enable-plugin ip,ports`.
- `GET /api/4/ip/limits` returns `ip_public_username: ["alice"]` and
- For comparison, in the same run `/api/4/config/ip` returns `public_password: "********"`
- The same config under `glances -s` returns the same cleartext values from XML-RPC
- In-process on develop: with `` public_password=`hostname` ``, `as_dict()` shows the template,
The MCP path I checked by reading the code only (the `mcp` package was not installed).
Suggested fix
Plugins read their raw settings through `get_conf_value()`, `get_limits(item)` and the
`limits` property. The only callers of `get_limits()` with no item are output paths: REST
`_api_limits`, MCP `plugin_limits`, and `GlancesStats.getAllLimits()` / `getAllLimitsAsDict()`
(REST `_api_all_limits`, XML-RPC `getAllLimits`, MCP `all_limits`, the exports). So the
redaction fits in `get_limits()` itself:
# glances/plugins/plugin/model.py
from glances.config import secure_option
def get_limits(self, item=None):
if item is None:
ret = {}
for key, value in self._limits.items():
# Match on the option name, `\buser\b` does not match `<plugin>_user`
option = key.removeprefix(f'{self.plugin_name}_')
if isinstance(value, list):
# Rejoin the value load_limits() split on ',', a comma is valid in URL userinfo
ret[key] = secure_option(option, ','.join(value)).split(',')
else:
ret[key] = value if secure_option(option, str(value)) == str(value) else '********'
return ret
return self._limits.get(f'{self.plugin_name}_{item}', None)and `getAllLimits()` / `getAllLimitsAsDict()` in `glances/stats.py` call
`self._plugins[p].get_limits()` instead of reading `.limits`.
Notes on that shape:
- The list values are joined back before the check. `load_limits` splits every non-numeric
- The redaction is always on, like the ports fix in 61b11b3a, not only when `args.password`
- Numeric thresholds are unchanged (`cpu_user_careful` does not match `\buser\b`). A numeric
I have this ready as a commit with a regression test (`tests/test_limits_no_credential_leak.py`,
next to `tests/test_ports_no_credential_leak.py`). I can push it to a temporary private fork
of this advisory, or paste the diff here, whichever you prefer.
Two smaller notes, separate from the core issue:
- `secure_option` does not redact tokens passed in a query string (e.g. an API key in
- `_SECURE_URL_CREDENTIALS_RE` stops at the first `@`, so a malformed value such as
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-5344-6x9j-2w33Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
