{"id":"CVE-2021-41090","aliases":["CVE-2021-41090","GHSA-9c4x-5hgq-q3wh","GO-2022-0305"],"related":[],"kind":"vulnerability","state":"published","title":"Instance config inline secret exposure","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### 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.","format":"markdown","source":"ghsa"},{"lang":"en","text":"Instance config inline secret exposure in Grafana in github.com/grafana/agent","format":"markdown","source":"go"},{"lang":"es","text":"Grafana Agent es un recolector de telemetría para enviar métricas, registros y datos de rastreo a la pila de observabilidad de Grafana. Antes de las versiones 0.20.1 y 0.21.2, los secretos en línea definidos dentro de una configuración de instancia de métrica se exponen en texto plano en dos endpoints: las configuraciones de instancia de métrica definidas en el archivo YAML base se exponen en \"/-/config\" y las configuraciones de instancia de métrica definidas para el servicio de raspado se exponen en \"/agent/api/v1/configs/:key\". Los secretos en línea son expuestos a cualquiera que pueda alcanzar estos endpoints. Si no se configura HTTPS con autenticación de cliente, estos endpoints son accesibles a usuarios no autenticados. Los secretos que son encontrados en estas secciones son usados para entregar métricas a un sistema de escritura remota de Prometheus, autenticar contra un sistema para detectar objetivos de Prometheus y autenticar contra un sistema para recopilar métricas. Esto no es aplicado a los secretos no alineados, como los secretos basados en \"*_file\". Este problema se ha parcheado en Grafana Agent versiones 0.20.1 y 0.21.2. Se presentan algunas soluciones disponibles. Los usuarios que no puedan actualizares deberían usar secretos no basados en la línea siempre que sea posible. Los usuarios también pueden querer restringir el acceso a la API de Grafana Agent con alguna combinación de restricción de las interfaces de red que escucha Grafana Agent mediante \"http_listen_address\" en el bloque \"server\", configurando Grafana Agent para usar HTTPS con autenticación de cliente, y/o usando reglas de firewall para restringir el acceso externo a la API de Grafana Agent","source":"nvd"}],"published":"2021-12-08T16:15:19.000Z","modified":"2026-07-08T06:28:55.459Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N","score":6.5,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N","score":6.5,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N","score":6.5,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","score":7.5,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:M/Au:N/C:P/I:N/A:N","score":4.3,"rating":"MEDIUM"}],"cwes":["CWE-200","CWE-312"],"affected":[{"ranges":[{"version":">= 0.14.0, < 0.20.1","status":"affected"},{"version":">= 0.21.0, < 0.21.2","status":"affected"}],"vendor":"grafana","product":"agent","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0.14.0","status":"affected","fixed":"0.21.2"}],"ecosystem":"Go","package":"github.com/grafana/agent","purl":"pkg:golang/github.com/grafana/agent","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.14.0","status":"affected","fixed":"0.21.2"}],"ecosystem":"Go","package":"github.com/grafana/agent","purl":"pkg:golang/github.com/grafana/agent","source":"go"},{"ranges":[{"status":"affected","introduced":"0.14.0","fixed":"0.20.1"},{"status":"affected","introduced":"0.21.0","fixed":"0.21.2"}],"vendor":"grafana","product":"agent","cpe":"cpe:2.3:a:grafana:agent:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/grafana/agent/security/advisories/GHSA-9c4x-5hgq-q3wh","tags":["advisory","third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/grafana/agent/pull/1152","tags":["fix","patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/grafana/agent/commit/af7fb01e31fe2d389e5f1c36b399ddc46b412b21","tags":["fix","patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/grafana/agent/releases/tag/v0.20.1","tags":["release-notes","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/grafana/agent/releases/tag/v0.21.2","tags":["release-notes","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://security.netapp.com/advisory/ntap-20211229-0004/","tags":["third-party-advisory","x-refsource-confirm","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-41090","tags":["advisory"],"sources":["ghsa","go"]},{"url":"https://github.com/grafana/agent/commit/a5479755e946e5c7cddb793ee9adda8f5692ba11","tags":["fix","web"],"sources":["ghsa","go"]},{"url":"https://github.com/grafana/agent","tags":["package"],"sources":["ghsa"]},{"url":"https://security.netapp.com/advisory/ntap-20211229-0004","tags":["web"],"sources":["ghsa","go"]}],"credits":[],"assigner":"GitHub_M","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-41090","url":"https://www.cve.org/CVERecord?id=CVE-2021-41090","licence":"CVE Terms of Use","modified":"2024-08-04T02:59:31.578Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-9c4x-5hgq-q3wh","url":"https://github.com/advisories/GHSA-9c4x-5hgq-q3wh","licence":"CC-BY-4.0","modified":"2026-07-08T06:28:55.459Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2022-0305","url":"https://pkg.go.dev/vuln/GO-2022-0305","licence":"CC-BY-4.0","modified":"2026-03-03T04:52:08.075Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-41090","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-41090","licence":"Public domain","modified":"2026-06-17T04:07:51.260Z"}],"updatedAt":"2026-11-25T22:58:05.891Z","epss":{"score":0.0076,"percentile":0.56517,"date":"2026-12-01T12:00:22.000Z"}}