/

CVE-2026-35587

Severity:

HIGH RISK

(8.8)

SSRF in Glances IP Plugin public_api Configuration

CVE-2026-35587

Analyzed

Vulnerability type

Category:

Server-Side Request Forgery (SSRF)

CWE:

CWE-918

Impact:

Network Pivoting and Data Exfiltration via SSRF

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Glances' IP plugin allows user-controlled configuration of the public_api endpoint, which is used directly in outbound HTTP requests without validating scheme, hostname, or IP address.

An attacker who can change the Glances configuration may abuse this to make the server perform arbitrary HTTP requests to internal or external systems and, when basic authentication is configured, to leak credentials to attacker-controlled endpoints.

Affected context

This vulnerability affects Glances deployments that:

  • Enable and use the IP plugin with the public_api configuration parameter,
  • Allow non-admin users, automation, or external processes to modify or influence the Glances configuration file or environment,
  • Run Glances in environments with network access to internal services, cloud metadata endpoints, or other sensitive HTTP(S) targets.

In such scenarios, the server's own network position and trust relationships can be abused to reach systems that are not directly accessible to the attacker.

Exploit preconditions

  • Attack surface: Glances configuration layer and any interface or mechanism that can modify the public_api, public_username, or public_password settings (e.g., configuration files, management scripts, container env templating).
  • Required access: Ability to influence or edit the Glances configuration; no direct HTTP endpoint in Glances needs to be exposed to the attacker for exploitation.
  • Trigger point: Execution of the Glances IP plugin functionality that performs outbound HTTP requests using public_api (typically during monitoring or plugin refresh cycles).
  • Why exploitation is possible: The public_api value is passed directly to the HTTP client (urlopen_auth) with no scheme restriction, hostname/IP validation, or allow/deny lists. When credentials are configured, they are automatically attached via an Authorization: Basic header to any requested URL, including attacker-specified ones.

Why this happens

The underlying issue is a classic Server-Side Request Forgery (SSRF) pattern: user-influenced URLs are used directly for server-initiated HTTP requests without enforcing a trust boundary.

Concretely:

  • The public_api configuration parameter is treated as a fully trusted URL.
  • No validation is performed to ensure it targets only intended, safe domains, protocols, or address ranges.
  • The HTTP client wrapper (urlopen_auth) blindly uses this value, allowing requests to arbitrary internal or external hosts.
  • When public_username and public_password are set, the code automatically includes them in the Authorization header for all such requests.

This behavior maps to CWE-918: Server-Side Request Forgery (SSRF), where a server's network position and credentials are exposed through unvalidated, user-controlled outbound requests.

Potential impact

  • Access to internal HTTP(S) services that are not directly exposed to the internet (e.g., internal APIs, admin panels).
  • Retrieval of sensitive data from cloud provider metadata endpoints, potentially exposing instance credentials or configuration details.
  • Credential exfiltration when public_username and public_password are configured, as these may be sent to attacker-controlled hosts in the Authorization: Basic header.
  • Use of the Glances host as a pivot for internal network reconnaissance, including port probing via HTTP-based responses.
  • Potential interaction with control-plane or management APIs reachable only from inside the network, which could expand the compromise if additional weaknesses exist.

General mitigation guidance

Effective mitigation patterns focus on reducing trust in configuration-controlled URLs and hardening outbound network behavior:

  • Constrain target endpoints:
  • Introduce strict allow-lists for public_api so only known, approved domains or paths can be used.
  • Enforce scheme restrictions (e.g., https:// only) and prohibit ambiguous or non-HTTP schemes.
  • Validate that hostnames and IPs do not resolve to loopback, link-local, or private address ranges unless explicitly required and controlled.
  • Separate sensitive credentials:
  • Avoid automatically attaching credentials to arbitrary URLs; tie credentials to specific, validated hosts or endpoints.
  • Use scoped authentication mechanisms where secrets are bound to particular domains rather than generic configuration parameters.
  • Harden network egress:
  • Apply firewall or egress filtering from the Glances host/container to limit which external and internal addresses can be reached over HTTP/HTTPS.
  • Use proxy or service mesh policies to confine outbound traffic to vetted services.
  • Improve configuration hygiene:
  • Restrict who can modify Glances configuration files or related deployment manifests.
  • Treat monitoring configuration as a sensitive asset, aligning its access controls with application-level secrets.

How teams detect issues like this

Detection should combine code-level analysis with runtime monitoring:

  • Static analysis and code review:
  • Flag any use of configuration-derived or user-controlled values passed directly into HTTP client APIs (e.g., urlopen, requests.get, or wrappers like urlopen_auth).
  • Look for lack of hostname, scheme, or IP range validation around outbound URL construction.
  • Review plugin and integration code for patterns where credentials are attached to all requests without host-bound scoping.
  • Configuration and policy checks:
  • Automatically audit Glances configuration for non-default or suspicious public_api values (e.g., IP literals, internal domain patterns, link-local/cloud metadata endpoints).
  • Implement CI/CD checks that reject deployment artifacts configuring public_api to unapproved targets.
  • Network and runtime monitoring:
  • Monitor outbound HTTP(S) requests from Glances hosts or containers, focusing on calls to internal IP ranges or metadata service endpoints.
  • Use anomaly detection to spot unusual destinations or spikes in traffic originating from monitoring nodes.

Automated security scanners and code review tools can be configured with SSRF-focused rules to surface these patterns before deployment.

Sources

SourceLink
github.comgithub.com/nicolargo/glances/commit/d6808be66728956477cc4b544bab1acd71ac65fb
github.comgithub.com/nicolargo/glances/security/advisories/GHSA-g5pq-48mj-jvw8

Frequently asked

questions

It can be, but only indirectly. An attacker must be able to modify or influence the Glances configuration (for example, via compromised deployment pipelines, weak file permissions, or management interfaces). Once they control public_api, they can cause the server to make SSRF requests without needing direct HTTP access to Glances itself.

The attacker needs write access to the Glances configuration or to any system that generates or manages that configuration (such as orchestration templates, configuration management tools, or environment variable injection mechanisms). They do not need shell access to the server if they can otherwise change these parameters.

The robust fix pattern is to treat configuration-provided URLs as untrusted: validate public_api against a strict allow-list of expected endpoints, enforce safe schemes, block private/loopback IP ranges by default, and avoid attaching credentials automatically to arbitrary URLs. Where possible, bind credentials to specific, validated hosts instead of using generic configuration fields.

Design outbound HTTP functionality with explicit trust boundaries: never use raw configuration or user input as full URLs; instead, compose URLs from vetted base endpoints and constrained paths. Implement central URL validation utilities, enforce egress controls at the network layer, and add security-focused code review and automated checks that flag unvalidated outbound requests and generic credential attachment patterns.

Find out what's already
exploitable in your codebase.