Vulnerabilities in pkg:golang/github.com/grafana/agent

PACKAGE
Advisory Identifier: GHSA-m5gv-m5f9-wgv4
Advisory Summary

CVE-2024-8996 is a MODERATE (CVSS 7.3) grafana agent (flow mode) on vulnerability (CWE-428: Unquoted Search Path or Element) affecting Github.com/grafana/agent libraries in the Go ecosystem. The issue involves grafana agent (flow mode) on windows has unquoted search path or element vulnerability. Remediation is available by upgrading affected packages to version 0.43.3.

2 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:golang/github.com/grafana/agent

2 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:golang/github.com/grafana/agent. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-m5gv-m5f9-wgv4 CVE-2024-8996 MODERATE Grafana Agent (Flow mode) on Windows has Unquoted Search Path or Element vulnerability
GHSA-9c4x-5hgq-q3wh CVE-2021-41090 MODERATE Instance config inline secret exposure in Grafana

CVE-2024-8996 at a Glance

CVE Identifier CVE-2024-8996
GHSA Identifier GHSA-m5gv-m5f9-wgv4
Severity MODERATE
CVSS v3.1 Base Score 7.3
CWE Classification CWE-428: Unquoted Search Path or Element
Affected Product Github.com/grafana/agent
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 7.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2024-8996

To remediate this vulnerability, upgrade all affected Github.com/grafana/agent dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/grafana/agent fixed: 0.43.3
Upgrade github.com/grafana/agent to 0.43.3
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/grafana/agent

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-8996, inspect your project dependencies for Github.com/grafana/agent:

inspect dependencies for github.com/grafana/agent

Analyze the terminal output to locate any version of Github.com/grafana/agent in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.43.3), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-428: Unquoted Search Path or Element, where the product uses a search path that contains an unquoted element, in which the element contains whitespace or other separators. this can cause the product to access resources in a parent path. In Github.com/grafana/agent, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

Unquoted Search Path or Element vulnerability in Grafana Agent (Flow mode) on Windows allows Privilege Escalation from Local User to SYSTEM. This issue affects Agent Flow before 0.43.3.

CVE-2024-8996 Affected Github.com/grafana/agent Versions

1 component(s)
Fixed Versions:
0.43.3
Product / Package Ecosystem Affected Versions Fixed Version
github.com/grafana/agent
Go
< 0.43.3
0.43.3

References

Frequently Asked Questions

What is CVE-2024-8996?
CVE-2024-8996 is a security vulnerability in Github.com/grafana/agent involving Grafana Agent (Flow mode) on Windows has Unquoted Search Path or Element vulnerability under CWE-428: Unquoted Search Path or Element.
Which Github.com/grafana/agent versions are affected?
Affected versions include releases prior to 0.43.3 across affected packages: github.com/grafana/agent.
What version fixes CVE-2024-8996?
Upgrading to 0.43.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/grafana/agent affected?
Yes, github.com/grafana/agent is affected in releases prior to 0.43.3. Upgrade your dependency to 0.43.3 or later.
What is the CVSS score of CVE-2024-8996?
CVE-2024-8996 has a CVSS v3.1 base score of 7.3 (MODERATE) with vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2024-8996?
CVE-2024-8996 is classified under CWE-428: Unquoted Search Path or Element (The product uses a search path that contains an unquoted element, in which the element contains whitespace or other separators. This can cause the product to access resources in a parent path.).
How can I check Go dependencies for CVE-2024-8996?
Run the dependency tree command: 'inspect dependencies for github.com/grafana/agent'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-m5gv-m5f9-wgv4",
  "modified" : "2024-10-09T22:12:28Z",
  "published" : "2024-09-25T18:31:21Z",
  "aliases" : [ "CVE-2024-8996" ],
  "summary" : "Grafana Agent (Flow mode) on Windows has Unquoted Search Path or Element vulnerability",
  "details" : "Unquoted Search Path or Element vulnerability in Grafana Agent (Flow mode) on Windows allows Privilege Escalation from Local User to SYSTEM.\nThis issue affects Agent Flow before 0.43.3.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:U"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/grafana/agent"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.43.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-8996"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/grafana/agent/commit/91bab2c05906938d3f8e1e3c61a863f037985299"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/grafana/agent"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/grafana/agent/releases/tag/v0.43.2"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/grafana/agent/releases/tag/v0.43.3"
  }, {
    "type" : "WEB",
    "url" : "https://grafana.com/blog/2024/09/25/grafana-alloy-and-grafana-agent-flow-security-release-high-severity-fix-for-cve-2024-8975-and-cve-2024-8996"
  }, {
    "type" : "WEB",
    "url" : "https://grafana.com/security/security-advisories/cve-2024-8996"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2024-3170"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-428" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-10-01T22:29:13Z",
    "nvd_published_at" : "2024-09-25T17:15:19Z"
  }
}