{"id":"CVE-2026-68520","aliases":["CVE-2026-68520","GHSA-4h34-v6r8-mmjc","PYSEC-2026-3664"],"related":[],"kind":"vulnerability","state":"published","title":"Glances: as_dict_secure() Value-Level Bypass Leaks Credentials in URL Values via /api/4/config","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nGlances 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`.\n\n## Affected Versions\n\nGlances latest (Docker: `nicolargo/glances:latest`)\n\n## Root Cause\n\nIn `glances/config.py`, `as_dict_secure()`:\n```python\n_SECURE_SENSITIVE_KEY_RE = re.compile(r\"password|token|secret|api_key|apikey|ssl_keyfile\", re.IGNORECASE)\n\ndef as_dict_secure(self):\n    \"\"\"Return a sanitised copy of the configuration dict.\n    Intended for unauthenticated API access.\n    - Sensitive keys in remaining sections are replaced by '********'.\n    \"\"\"\n    sanitized = {}\n    for section, options in self.as_dict().items():\n        if section in _SECURE_BLOCKED_SECTIONS: continue\n        sanitized[section] = {\n            key: \"********\" if _SECURE_SENSITIVE_KEY_RE.search(key) else value\n            for key, value in options.items()\n        }\n    return sanitized\n```\n\nIn `glances/outputs/glances_restful_api.py`:\n```python\n# Line 1294\nargs_json = self.config.as_dict() if self.args.password else self.config.as_dict_secure()\n```\n\nThe `[ip]` config section documents: `public_api` (URL), `public_username` (login), `public_password` (password).\n- `public_password` → matches \"password\" → masked ✓\n- `public_api` → no match → returned in full (contains `user:pass@` in URL) ✗\n- `public_username` → no match → returned in full ✗\n\n## Impact\n\n- Unauthenticated credential disclosure via `GET /api/4/config` or `GET /api/4/config/ip`\n- `as_dict_secure()` exists specifically to protect credentials in no-auth mode but fails to mask `public_username` and credential-bearing URLs in `public_api`\n\n## Prerequisites\n\n- Glances in web server mode without `--password` (default, no auth)\n- `glances.conf` `[ip]` section with `public_api` containing embedded credentials and/or `public_username` set\n\n## Environment\n\n- Glances latest (Docker: `nicolargo/glances:latest`)\n- Remote Docker lab at `http://10.140.200.102:8080`\n\n## Reproduction Steps\n\n```bash\ndocker run -d --name glances-test -p 8080:61208 -e GLANCES_OPT='-w' nicolargo/glances:latest\nsleep 20\ndocker exec glances-test sed -i 's|public_api=https://ipv4.ipleak.net/json/|public_api=https://admin:secret123@ipv4.ipleak.net/json/|' /etc/glances/glances.conf\ndocker exec glances-test sed -i 's|#public_username=<myname>|public_username=myname|' /etc/glances/glances.conf\ndocker exec glances-test sed -i 's|#public_password=<mysecret>|public_password=mysecret|' /etc/glances/glances.conf\ndocker restart glances-test\nsleep 15\ncurl -s \"$TARGET/api/4/config/ip\"\n# Returns: {\"public_api\": \"https://admin:secret123@...\", \"public_username\": \"myname\", \"public_password\": \"********\"}\n```\n\n## Evidence\n\nSee `C:/Tools/glances-config-leak-evidence.txt`.\n\n## Dedup Check\n\n- GHSA-gfc2-9qmw-w7vh covers CORS but NOT value-level credential leak\n- No existing GHSA covers `as_dict_secure()` value-level filtering gap\n- 13 published GHSA, none covering this issue\n\n## Suggested Remediation\n\nAdd \"username\" and \"login\" to sensitive key pattern, and check values for embedded credentials in URLs.\n\n## Disclosure Timeline\n\n- 2026-07-28: Vulnerability discovered and verified via Docker deployment\n\n## Reporter\n\nGitHub username: Todor","format":"markdown","source":"ghsa"},{"lang":"es","text":"Glances es una herramienta de monitoreo de sistemas multiplataforma de código abierto. Antes de 4.5.6, as_dict_secure() en glances/config.py verifica solo los nombres de las opciones y expone public_username y las credenciales incrustadas en los valores de public_api a través de solicitudes GET /API/4/config y GET /API/4/config/ip no autenticadas. Este problema se solucionó en 4.5.6.","source":"nvd"}],"published":"2026-08-17T17:06:06.446Z","modified":"2026-10-23T16:10:00.313Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N","score":5.3,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N","score":5.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N","score":5.3,"rating":"MEDIUM"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N","score":5.3,"rating":"MEDIUM"}],"cwes":["CWE-200"],"affected":[{"ranges":[{"version":"< 4.5.6","status":"affected"}],"vendor":"nicolargo","product":"glances","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"4.5.6"}],"ecosystem":"PyPI","package":"glances","purl":"pkg:pypi/glances","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"4.5.6"}],"ecosystem":"PyPI","package":"glances","purl":"pkg:pypi/glances","source":"pysec"}],"references":[{"url":"https://github.com/nicolargo/glances/security/advisories/GHSA-4h34-v6r8-mmjc","tags":["exploit","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/nicolargo/glances/commit/8d0f8276c2abd2e9d400bd6c84bdfba0dfcab065","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/nicolargo/glances/releases/tag/v4.5.6","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/nicolargo/glances","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/glances","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-4h34-v6r8-mmjc","tags":["advisory"],"sources":["pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-68520","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2026-08-17T19:35:46.469Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-68520","url":"https://www.cve.org/CVERecord?id=CVE-2026-68520","licence":"CVE Terms of Use","modified":"2026-08-17T19:36:26.683Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-4h34-v6r8-mmjc","url":"https://github.com/advisories/GHSA-4h34-v6r8-mmjc","licence":"CC-BY-4.0","modified":"2026-08-19T12:55:45.103Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-68520","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-68520","licence":"Public domain","modified":"2026-10-23T16:10:00.313Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-3664","url":"https://osv.dev/vulnerability/PYSEC-2026-3664","licence":"CC-BY-4.0","modified":"2026-08-19T12:45:11.252Z"}],"updatedAt":"2026-11-25T22:59:33.373Z","epss":{"score":0.00297,"percentile":0.24118,"date":"2026-12-01T12:00:22.000Z"}}