Details
Impact:
- Confidentiality: High — complete system monitoring data readable remotely without credentials.
- Integrity: None — read-only XML-RPC API.
- Availability: None — no denial-of-service component.
The attack is amplified by the companion CORS wildcard issue (vuln03): without Access-Control-Allow-Origin: *, the browser would still block the response read. Both issues must be fixed together for effective remediation.
---
Suggested Fix
Option 1 — Add Host validation to the XML-RPC handler (preferred)
Add a webui_allowed_hosts (or new xmlrpc_allowed_hosts) configuration key, and validate the Host header in GlancesXMLRPCHandler:
# server.py
class GlancesXMLRPCHandler(SimpleXMLRPCRequestHandler, GlancesAPI):
allowed_hosts: list[str] = [] # populated from config
def parse_request(self) -> bool:
if not super().parse_request():
return False
if self.allowed_hosts:
host = self.headers.get('Host', '').split(':')[0]
if host not in self.allowed_hosts:
self.send_error(400, 'Bad Request: invalid Host header')
return False
return True
Populate allowed_hosts from the existing webui_allowed_hosts config key (already used by the REST server), so operators have a single knob.
Option 2 — Deprecate and remove the XML-RPC server
The XML-RPC server is a legacy interface. The REST API (glances -w) provides a superset of functionality, is actively maintained, and has all current security controls. Deprecating the XML-RPC server in the next major release and directing users to the REST API would eliminate this attack surface entirely.
---
Responsible Disclosure
The AFINE Team is committed to responsible / coordinated disclosure. The AFINE Team will not publish details of this vulnerability or release exploit code publicly until a fix has been released, or 90 days have elapsed from the date of this report, whichever comes first.
---
Credits
This issue was identified by Michał Majchrowicz and Marcin Wyczechowski, members of the AFINE Team.
---