Loading HuntDB...

CVE-2021-41090

MEDIUM
Published 2021-12-08T16:15:19
Actions:

Expert Analysis

Professional remediation guidance

Get tailored security recommendations from our analyst team for CVE-2021-41090. We'll provide specific mitigation strategies based on your environment and risk profile.

CVSS Score

V3.1
6.5
/10
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
Base Score Metrics
Exploitability: N/A Impact: N/A

EPSS Score

v2025.03.14
0.007
probability
of exploitation in the wild

There is a 0.7% chance that this vulnerability will be exploited in the wild within the next 30 days.

Updated: 2025-06-25
Exploit Probability
Percentile: 0.719
Higher than 71.9% of all CVEs

Attack Vector Metrics

Attack Vector
NETWORK
Attack Complexity
LOW
Privileges Required
NONE
User Interaction
NONE
Scope
UNCHANGED

Impact Metrics

Confidentiality
LOW
Integrity
LOW
Availability
NONE

Description

Grafana Agent is a telemetry collector for sending metrics, logs, and trace data to the opinionated Grafana observability stack. Prior to versions 0.20.1 and 0.21.2, inline secrets defined within a metrics instance config are exposed in plaintext over two endpoints: metrics instance configs defined in the base YAML file are exposed at `/-/config` and metrics instance configs defined for the scraping service are exposed at `/agent/api/v1/configs/:key`. Inline secrets will be exposed to anyone being able to reach these endpoints. If HTTPS with client authentication is not configured, these endpoints are accessible to unauthenticated users. Secrets found in these sections are used for delivering metrics to a Prometheus Remote Write system, authenticating against a system for discovering Prometheus targets, and authenticating against a system for collecting metrics. This does not apply for non-inlined secrets, such as `*_file` based secrets. This issue is patched in Grafana Agent versions 0.20.1 and 0.21.2. A few workarounds are available. Users who cannot upgrade should use non-inline secrets where possible. Users may also desire to restrict API access to Grafana Agent with some combination of restricting the network interfaces Grafana Agent listens on through `http_listen_address` in the `server` block, configuring Grafana Agent to use HTTPS with client authentication, and/or using firewall rules to restrict external access to Grafana Agent's API.

Available Exploits

No exploits available for this CVE.

Related News

No news articles found for this CVE.

Affected Products

GitHub Security Advisories

Community-driven vulnerability intelligence from GitHub

✓ GitHub Reviewed MODERATE

Instance config inline secret exposure in Grafana

GHSA-9c4x-5hgq-q3wh

Advisory Details

### Impact Some inline secrets are exposed in plaintext over the Grafana Agent HTTP server: * Inline secrets for metrics instance configs in the base YAML file are exposed at `/-/config` * Inline secrets for integrations are exposed at `/-/config` * Inline secrets for Consul ACL tokens and ETCD basic auth when configured for the scraping service at `/-/config`. * Inline secrets for the Kafka receiver for OpenTelemetry-Collector tracing at `/-/config`. * Inline secrets for metrics instance configs loaded from the scraping service are exposed at `/agent/api/v1/configs/{name}`. Inline secrets will be exposed to anyone being able to reach these endpoints. Secrets found in these sections are used for: * Delivering metrics to a Prometheus Remote Write system * Authenticating against a system for discovering Prometheus targets * Authenticating against a system for collecting metrics (scrape_configs and integrations) * Authenticating against a Consul or ETCD for storing configurations to distribute in scraping service mode * Authenticating against Kafka for receiving traces Non-inlined secrets, such as `*_file`-based secrets, are not impacted by this vulnerability. ### Patches Download [v0.20.1](https://github.com/grafana/agent/releases/tag/v0.20.1) or any version past [v0.21.2](https://github.com/grafana/agent/releases/tag/v0.21.2) to patch Grafana Agent. These patches obfuscate the listed impacted secrets from the vulnerable endpoints. The patches also disable the endpoints by default. Pass the command-line flag `--config.enable-read-api` to opt-in and re-enable the endpoints. ### Workarounds If for some reason you cannot upgrade, use non-inline secrets where possible. Not all configuration options may have a non-inline equivalent. You also may desire to restrict API access to Grafana Agent, with some combination of: * Restrict network interfaces Grafana Agent listens on through `http_listen_address` in the `server` block. `127.0.0.1` is the most restrictive, `0.0.0.0` is the default. * Configure Grafana Agent to use HTTPS with client authentication. * Use firewall rules to restrict external access to Grafana Agent's API.

Affected Packages

Go github.com/grafana/agent
ECOSYSTEM: ≥0.14.0 <0.21.2

CVSS Scoring

CVSS Score

5.0

CVSS Vector

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N

Advisory provided by GitHub Security Advisory Database. Published: December 8, 2021, Modified: December 14, 2021

References

Published: 2021-12-08T16:15:19
Last Modified: 2024-08-04T02:59:31.578Z
Copied to clipboard!