Summary
Instance config inline secret exposure in Grafana
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_addressin theserverblock.127.0.0.1is the most restrictive,0.0.0.0is the default. - Configure Grafana Agent to use HTTPS with client authentication.
- Use firewall rules to restrict external access to Grafana Agent's API.
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.
CVE-2021-41090 has a CVSS score of 6.5 (Medium). The vector is network-reachable, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (0.21.2); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
Download v0.20.1 or any version past 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.
Frequently Asked Questions
- What is CVE-2021-41090? CVE-2021-41090 is a medium-severity security vulnerability in github.com/grafana/agent (go), affecting versions >= 0.14.0, < 0.21.2. It is fixed in 0.21.2.
- How severe is CVE-2021-41090? CVE-2021-41090 has a CVSS score of 6.5 (Medium). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which versions of github.com/grafana/agent are affected by CVE-2021-41090? github.com/grafana/agent (go) versions >= 0.14.0, < 0.21.2 is affected.
- Is there a fix for CVE-2021-41090? Yes. CVE-2021-41090 is fixed in 0.21.2. Upgrade to this version or later.
- Is CVE-2021-41090 exploitable, and should I be worried? Whether CVE-2021-41090 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2021-41090 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2021-41090? Upgrade
github.com/grafana/agentto 0.21.2 or later.