{"id":"CVE-2021-41090","aliases":["GHSA-9c4x-5hgq-q3wh","GO-2022-0305"],"title":"Instance config inline secret exposure in Grafana","summary":"Instance config inline secret exposure in Grafana","severity":"medium","cvss":6.5,"cvssVector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N","vendor":"grafana","product":"github.com/grafana/agent","ecosystem":"go","affected":["github.com/grafana/agent >= 0.14.0, < 0.21.2"],"patched":["github.com/grafana/agent 0.21.2"],"published":"2021-12-08","updated":"2026-07-08","source":"OSV","sourceUrl":"https://osv.dev/vulnerability/GHSA-9c4x-5hgq-q3wh","references":[{"url":"https://github.com/grafana/agent/security/advisories/GHSA-9c4x-5hgq-q3wh"},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-41090"},{"url":"https://github.com/grafana/agent/pull/1152"},{"url":"https://github.com/grafana/agent/commit/a5479755e946e5c7cddb793ee9adda8f5692ba11"},{"url":"https://github.com/grafana/agent/commit/af7fb01e31fe2d389e5f1c36b399ddc46b412b21"},{"url":"https://github.com/grafana/agent"},{"url":"https://github.com/grafana/agent/releases/tag/v0.20.1"},{"url":"https://github.com/grafana/agent/releases/tag/v0.21.2"},{"url":"https://security.netapp.com/advisory/ntap-20211229-0004"}],"tags":["osv","go"],"epss":0.00736,"epssPercentile":0.52523,"ingestedAt":"2026-07-09T18:56:36.275Z","slug":"CVE-2021-41090","body":"## Overview\n\n### Impact\nSome inline secrets are exposed in plaintext over the Grafana Agent HTTP server:\n\n* Inline secrets for metrics instance configs in the base YAML file are exposed at `/-/config` \n* Inline secrets for integrations are exposed at `/-/config`\n* Inline secrets for Consul ACL tokens and ETCD basic auth when configured for the scraping service at `/-/config`.\n* Inline secrets for the Kafka receiver for OpenTelemetry-Collector tracing at `/-/config`.\n* Inline secrets for metrics instance configs loaded from the scraping service are exposed at `/agent/api/v1/configs/{name}`.\n\nInline secrets will be exposed to anyone being able to reach these endpoints.\n\nSecrets found in these sections are used for:\n\n* Delivering metrics to a Prometheus Remote Write system \n* Authenticating against a system for discovering Prometheus targets \n* Authenticating against a system for collecting metrics (scrape_configs and integrations)\n* Authenticating against a Consul or ETCD for storing configurations to distribute in scraping service mode \n* Authenticating against Kafka for receiving traces\n\nNon-inlined secrets, such as `*_file`-based secrets, are not impacted by this vulnerability. \n\n### Patches\n\nDownload [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.\n\nThe patches also disable the endpoints by default. Pass the command-line flag `--config.enable-read-api` to opt-in and re-enable the endpoints.  \n \n### Workarounds\nIf for some reason you cannot upgrade, use non-inline secrets where possible. Not all configuration options may have a non-inline equivalent.\n\nYou also may desire to restrict API access to Grafana Agent, with some combination of:\n\n* 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. \n* Configure Grafana Agent to use HTTPS with client authentication. \n* Use firewall rules to restrict external access to Grafana Agent's API.\n\n## Affected packages\n\n- `github.com/grafana/agent >= 0.14.0, < 0.21.2`\n\n## Remediation\n\nUpgrade to a patched release:\n\n- `github.com/grafana/agent 0.21.2`","depth":"sunlit","depthScore":36,"depthScoreParts":{"impact":35.8,"likelihood":0.1,"exploitation":0,"ransomware":0},"changes":[]}