7171 Commits

Author SHA1 Message Date
nicolargo
1f5aead12c Merge branch 'issue3559' into develop 2026-05-31 17:35:59 +02:00
nicolargo
2e5ab02bda Get back to default ThreadedIterableStreamer.sleep_duration to 0.1 second 2026-05-31 17:35:44 +02:00
nicolargo
e68e9f4452 Add unit test to containers/docker plugin 2026-05-31 17:34:25 +02:00
nicolargo
2353e49655 Make only one API call for multiple containers (use sparse=True option). Also correct behavor for Podman and LXD. 2026-05-31 17:33:37 +02:00
nicolargo
d050ab4151 Merge branch 'issue3559' into develop 2026-05-30 09:18:23 +02:00
nicolargo
476a26defc Try to reduce the time between two containers when stats are collected - #3559 2026-05-30 09:18:08 +02:00
nicolargo
4f399c41b2 Merge branch '20086080-Issue-3555_load_additional_plugins' into develop 2026-05-23 15:50:00 +02:00
nicolargo
2afc533d67 Merge branch 'Issue-3555_load_additional_plugins' of github.com:20086080/glances into 20086080-Issue-3555_load_additional_plugins 2026-05-23 15:48:42 +02:00
nicolargo
07080cdca4 Update WebUI, requirements and docs 2026-05-23 15:42:02 +02:00
nicolargo
3fdd03964b Merge branch 'GHSA-v5r2-qh84-fjx5' into develop 2026-05-23 12:27:38 +02:00
nicolargo
ff3eec3295 Command Injection via KVM/QEMU VM Domain Names in glances/plugins/vms/engines/virsh.py - CVE-2026-46606 2026-05-23 12:27:19 +02:00
nicolargo
e1f6c387dd Command Injection via KVM/QEMU VM Domain Names in glances/plugins/vms/engines/virsh.py - CVE-2026-46606 2026-05-23 12:27:00 +02:00
nicolargo
6986c382d9 Merge branch 'GHSA-9837-48hr-q32j' into develop 2026-05-23 11:57:50 +02:00
nicolargo
cf14166fbe test(outdated): json round-trip and graceful migration from legacy pickle cache
Cover the non-RCE behaviour of the new JSON cache:
- round-trip: written file is valid JSON, re-read produces equivalent dict
- legacy pickle: a pre-fix pickle cache is treated as a cache miss, not
  a crash (upgrade path)
- expiry: caches older than 7 days are invalidated
- version skew: caches written by a different installed version are
  invalidated
- first run: a missing file is not an error
2026-05-23 11:52:53 +02:00
nicolargo
622994add7 fix(outdated): replace pickle with json for version cache (GHSA-9837-48hr-q32j)
The version-check cache at $XDG_CACHE_HOME/glances/glances-version.db is
read at every Glances startup via pickle.load() — an execution-capable
deserialization format. Any process able to write that path (local user
on a shared host, sibling container on a shared volume, symlink race
during first run) could plant a pickle whose __reduce__ runs arbitrary
code as the Glances user, including root in typical deployments.

Switch to json for both load and save. The stored payload is trivial:
two strings plus a timestamp that round-trips via isoformat(). Any
unreadable, malformed, or legacy-pickle file is caught by the existing
exception handler and treated as a cache miss — the next PyPI refresh
overwrites it with a JSON file. No user-visible behaviour change.

The pickle module is removed from the imports — it has no other use in
this file.

Mitigates CVE-2026-46607.
2026-05-23 11:51:36 +02:00
nicolargo
7098478c39 test(outdated): failing test — malicious pickle cache must not execute (CVE-2026-46607)
Regression test for GHSA-9837-48hr-q32j: glances/outdated.py reads its
version-check cache file via pickle.load(), a deserialization format
that executes arbitrary callables embedded via __reduce__.

The test plants a poisoned pickle at the cache path and asserts that
_load_cache() does NOT trigger the embedded callable. Against the
current (vulnerable) code this fails because the payload fires before
the TypeError is raised on the unrelated dict subscript.

The fix in the next commit replaces pickle with json, which is a passive
data format.
2026-05-23 11:50:55 +02:00
nicolargo
74c5352ebc Merge branch 'GHSA-87qc-fj39-wccr' into develop 2026-05-23 11:40:35 +02:00
nicolargo
0de3b8f875 XML-RPC Multi-Origin CORS Configuration Silently Falls Back to Wildcard - CVE-2026-46608 2026-05-23 11:40:20 +02:00
nicolargo
8eeacd8856 Merge branch 'GHSA-w856-8p3r-p338' into develop 2026-05-23 10:04:50 +02:00
nicolargo
16c7ca8e13 Update other glances.conf file 2026-05-23 10:04:32 +02:00
nicolargo
4976bd7509 docs(quickstart): document xmlrpc_allowed_hosts DNS rebinding protection
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-23 09:56:46 +02:00
nicolargo
d9316dfac2 docs(conf): document xmlrpc_allowed_hosts in glances.conf
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-23 09:56:28 +02:00
nicolargo
cbc22e77d4 feat(server): warn at startup when XML-RPC server has no Host allowlist
Mirrors the existing REST/WebUI warning style. Makes unprotected
XML-RPC deployments visible to operators without changing default
behaviour (no enforcement).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-23 09:56:15 +02:00
nicolargo
cad6f985a5 test(xmlrpc): port stripping and missing-Host edge cases
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-23 09:53:06 +02:00
nicolargo
8e6c9c955c test(xmlrpc): wildcard Host patterns via fnmatch
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-23 09:52:30 +02:00
nicolargo
575dc7e81b test(xmlrpc): allowlisted Host returns 200
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-23 09:51:58 +02:00
nicolargo
5961e0b507 fix(server): validate Host header in XML-RPC server (GHSA-w856-8p3r-p338)
Add opt-in DNS rebinding protection to the XML-RPC server via a new
xmlrpc_allowed_hosts config key in [outputs]. When set, the handler
rejects requests whose Host header does not match any of the listed
patterns (fnmatch wildcards supported). Validation runs before
authentication so spoofed Host values are rejected regardless of
credentials.

Default behaviour is unchanged (no allowlist = no filtering). A
startup warning is added in a follow-up commit to make unprotected
deployments visible to operators.

Mitigates CVE-2026-46611.
2026-05-23 09:51:25 +02:00
nicolargo
b88dd7bcfd test(xmlrpc): failing test — spoofed Host should be rejected (CVE-2026-46611)
Adds a second test server bound to a config that enables xmlrpc_allowed_hosts,
plus the failing assertion that a spoofed Host header returns 400. The fix in
glances/server.py follows in the next commit.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-23 09:50:40 +02:00
nicolargo
b2965cca96 test(xmlrpc): lock in current permissive default (regression baseline)
This test passes on the unpatched server and proves the CVE-2026-46611
vulnerability exists today: a spoofed Host header is accepted.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-23 09:49:43 +02:00
nicolargo
01437d61e2 test(xmlrpc): scaffold for Host header validation tests
Re-creates tests/test_xmlrpc.py (deleted symlink) with a pytest module
modelled on test_restful.py: subprocess-launched server and a helper
to POST XML-RPC calls with a controllable Host header. Restores the
existing 'make test-xmlrpc' Makefile target.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-23 09:48:47 +02:00
nicolargo
8b6cab83e8 docs(plan): implementation plan for GHSA-w856-8p3r-p338 XML-RPC fix
11-task TDD plan covering test scaffold, regression baseline,
parse_request Host validation, wildcard/port/missing-Host edge
cases, startup warning, conf entry, docs and lint/format check.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-23 09:43:23 +02:00
nicolargo
bcbeae7af6 docs(spec): design for GHSA-w856-8p3r-p338 XML-RPC Host validation
Design document for CVE-2026-46611 patch: add opt-in Host header
validation to the XML-RPC server via a new xmlrpc_allowed_hosts
config key, with permissive default and startup warning (mirrors
the REST/WebUI mitigation pattern).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-23 09:38:43 +02:00
Nicolas Hennion
2cfc64e8e9 Update MCP configuration instructions in mcp.rst
Added instructions for configuring Glances MCP from the Claude command line.
2026-05-21 17:18:50 +02:00
20086080
bcc18b4ab3 Fix : Codacy 2026-05-21 03:06:41 +00:00
20086080
389b6d45bb Fix : Codacy 2026-05-21 02:57:23 +00:00
20086080
c3a8fb2f05 Test : Unit tests 2026-05-21 02:22:17 +00:00
20086080
86f821340d Doc : Comments 2026-05-20 15:23:45 +00:00
20086080
b71094adc5 Refactor : load_additional_plugins seperation of concerns 2026-05-20 15:16:45 +00:00
Nicolas Hennion
7e118d5946 Merge pull request #3557 from DeepSpace2/feat-containers-cpu-limits
feat: add cpu limit to docker, podman and lxd containers
2026-05-17 11:24:50 +02:00
Nicolas Hennion
fccf7c0401 Merge pull request #3558 from metayan/fix100
Keep auto_unit within limits, so columns stay aligned
2026-05-17 11:23:05 +02:00
Yan
b42defb1d8 Keep auto_unit within limits, so columns stay aligned
Occasionally, columns got misaligned, because auto_unit returned too
many decimals when the number was slightly below 10 or 100.
Actually, when (9.995 <= n < 10) and (99.95 < n < 100).

For example,
10*2**20-1 returned 10.00M instead of 10.0M and
100*2**20-1 returned 100.0M instead of 100M.

Tests added to verify correctness.
2026-05-16 21:45:09 +00:00
Adi
b4b2118933 feat: add cpu limit to docker, podman and lxd containers 2026-05-15 17:32:25 +03:00
nicolargo
04579778e7 Reduce max size of quicklook plugin 2026-05-11 16:21:02 +02:00
nicolargo
ceba2bbc2e Merge branch '20086080-refactor/issue3460-__display_top' into develop 2026-05-11 16:00:14 +02:00
20086080
7407f35661 Fix : Codacy Issues 2026-05-07 12:59:37 +00:00
20086080
31f07cd6c9 Fix : Codacy Issues 2026-05-07 12:54:47 +00:00
20086080
d529cf2d59 Fix : Codacy Issues 2026-05-07 12:49:09 +00:00
20086080
e6139651e8 Fix : Codacy Issues 2026-05-07 12:44:11 +00:00
20086080
399586d61b Fix : Codacy Issues 2026-05-07 12:32:05 +00:00
20086080
9c6a5beb73 Doc : Comments & Doc Strings 2026-05-07 12:08:32 +00:00