CVE-2024-35185: Github.com/stacklok/minder Denial of Service Vulnerability

MODERATE
Advisory Identifier: GHSA-fjw8-3gp8-4cvx
CVSS 5.3
CWE-400
Published
Advisory Summary

CVE-2024-35185 is a MODERATE (CVSS 5.3) denial of service vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Github.com/stacklok/minder libraries in the Go ecosystem. The issue involves denial of service of minder server with attacker-controlled rest endpoint. Remediation is available by upgrading affected packages to version 0.0.49.

CVE-2024-35185 at a Glance

CVE Identifier CVE-2024-35185
GHSA Identifier GHSA-fjw8-3gp8-4cvx
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product Github.com/stacklok/minder
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 5.3

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

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

How to Fix CVE-2024-35185

To remediate this vulnerability, upgrade all affected Github.com/stacklok/minder 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/stacklok/minder fixed: 0.0.49
Upgrade github.com/stacklok/minder to 0.0.49
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/stacklok/minder

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-35185, inspect your project dependencies for Github.com/stacklok/minder:

inspect dependencies for github.com/stacklok/minder

Analyze the terminal output to locate any version of Github.com/stacklok/minder in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.0.49), 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-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In Github.com/stacklok/minder, 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

The Minder REST ingester is vulnerable to a denial of service attack via an attacker-controlled REST endpoint that can crash the Minder server. The REST ingester allows users to interact with REST endpoints to fetch data for rule evaluation. When fetching data with the REST ingester, Minder sends a request to an endpoint and will use the data from the body of the response as the data to evaluate against a certain rule. Minder sends the request on these lines: https://github.com/stacklok/minder/blob/daccbc12e364e2d407d56b87a13f7bb24cbdb074/internal/engine/ingester/rest/rest.go#L131-L139 … and parses the response body on these lines: https://github.com/stacklok/minder/blob/daccbc12e364e2d407d56b87a13f7bb24cbdb074/internal/engine/ingester/rest/rest.go#L147-L150 https://github.com/stacklok/minder/blob/daccbc12e364e2d407d56b87a13f7bb24cbdb074/internal/engine/ingester/rest/rest.go#L196-L220 Minder creates the URL of the endpoint via templating on these lines: https://github.com/stacklok/minder/blob/daccbc12e364e2d407d56b87a13f7bb24cbdb074/internal/engine/ingester/rest/rest.go#L121-L123 As far as I can tell, at this stage in rule evaluation, users fully control the raw template and the params passed to the template via the RuleType type: https://github.com/stacklok/minder/blob/daccbc12e364e2d407d56b87a13f7bb24cbdb074/pkg/api/protobuf/go/minder/v1/minder.pb.go#L6151-L6173 I have not seen anything that enforces users to only send requests to GitHub REST endpoints. If there is such a constraint, it limits the ease with which this vulnerability can be exploited, but it is still possible. If there is not such a constraint, it is easy to exploit this vuln. When Minder parses the response from a remote endpoint, it reads the response entirely into memory on these lines: https://github.com/stacklok/minder/blob/daccbc12e364e2d407d56b87a13f7bb24cbdb074/internal/engine/ingester/rest/rest.go#L207 and https://github.com/stacklok/minder/blob/daccbc12e364e2d407d56b87a13f7bb24cbdb074/internal/engine/ingester/rest/rest.go#L213 If the response is sufficiently large, it can drain memory on the machine and crash the Minder server. The attacker can control the remote REST endpoints that Minder sends requests to, and they can configure the remote REST endpoints to return responses with large bodies. They would then instruct Minder to send a request to their configured endpoint that would return the large response which would crash the Minder server.

CVE-2024-35185 Affected Github.com/stacklok/minder Versions

1 component(s)
Fixed Versions:
0.0.49
Product / Package Ecosystem Affected Versions Fixed Version
github.com/stacklok/minder
Go
< 0.0.49
0.0.49

References

Frequently Asked Questions

What is CVE-2024-35185?
CVE-2024-35185 is a security vulnerability in Github.com/stacklok/minder involving Denial of service of Minder Server with attacker-controlled REST endpoint under CWE-400: Uncontrolled Resource Consumption.
Which Github.com/stacklok/minder versions are affected?
Affected versions include releases prior to 0.0.49 across affected packages: github.com/stacklok/minder.
What version fixes CVE-2024-35185?
Upgrading to 0.0.49 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/stacklok/minder affected?
Yes, github.com/stacklok/minder is affected in releases prior to 0.0.49. Upgrade your dependency to 0.0.49 or later.
What is the CVSS score of CVE-2024-35185?
CVE-2024-35185 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2024-35185?
CVE-2024-35185 is classified under CWE-400: Uncontrolled Resource Consumption (The product does not properly control the allocation and maintenance of a limited resource.).
How can I check Go dependencies for CVE-2024-35185?
Run the dependency tree command: 'inspect dependencies for github.com/stacklok/minder'. 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-fjw8-3gp8-4cvx",
  "modified" : "2024-05-16T19:06:00Z",
  "published" : "2024-05-16T17:44:39Z",
  "aliases" : [ "CVE-2024-35185" ],
  "summary" : "Denial of service of Minder Server with attacker-controlled REST endpoint",
  "details" : "The Minder REST ingester is vulnerable to a denial of service attack via an attacker-controlled REST endpoint that can crash the Minder server.\n\nThe REST ingester allows users to interact with REST endpoints to fetch data for rule evaluation. When fetching data with the REST ingester, Minder sends a request to an endpoint and will use the data from the body of the response as the data to evaluate against a certain rule. Minder sends the request on these lines:\nhttps://github.com/stacklok/minder/blob/daccbc12e364e2d407d56b87a13f7bb24cbdb074/internal/engine/ingester/rest/rest.go#L131-L139\n\n… and parses the response body on these lines:\n\nhttps://github.com/stacklok/minder/blob/daccbc12e364e2d407d56b87a13f7bb24cbdb074/internal/engine/ingester/rest/rest.go#L147-L150\n\nhttps://github.com/stacklok/minder/blob/daccbc12e364e2d407d56b87a13f7bb24cbdb074/internal/engine/ingester/rest/rest.go#L196-L220\n\nMinder creates the URL of the endpoint via templating on these lines:\n\nhttps://github.com/stacklok/minder/blob/daccbc12e364e2d407d56b87a13f7bb24cbdb074/internal/engine/ingester/rest/rest.go#L121-L123\n\nAs far as I can tell, at this stage in rule evaluation, users fully control the raw template and the params passed to the template via the RuleType type:\n\nhttps://github.com/stacklok/minder/blob/daccbc12e364e2d407d56b87a13f7bb24cbdb074/pkg/api/protobuf/go/minder/v1/minder.pb.go#L6151-L6173\n\nI have not seen anything that enforces users to only send requests to GitHub REST endpoints. If there is such a constraint, it limits the ease with which this vulnerability can be exploited, but it is still possible. If there is not such a constraint, it is easy to exploit this vuln.\n\nWhen Minder parses the response from a remote endpoint, it reads the response entirely into memory on these lines:\n\nhttps://github.com/stacklok/minder/blob/daccbc12e364e2d407d56b87a13f7bb24cbdb074/internal/engine/ingester/rest/rest.go#L207\n\nand\n\nhttps://github.com/stacklok/minder/blob/daccbc12e364e2d407d56b87a13f7bb24cbdb074/internal/engine/ingester/rest/rest.go#L213\n\nIf the response is sufficiently large, it can drain memory on the machine and crash the Minder server.\n\nThe attacker can control the remote REST endpoints that Minder sends requests to, and they can configure the remote REST endpoints to return responses with large bodies.  They would then instruct Minder to send a request to their configured endpoint that would return the large response which would crash the Minder server.\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/stacklok/minder"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.0.49"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/stacklok/minder/security/advisories/GHSA-fjw8-3gp8-4cvx"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-35185"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/stacklok/minder/commit/065049336aac0621ee00a0bb2211f8051d47c14b"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/stacklok/minder"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-400" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-05-16T17:44:39Z",
    "nvd_published_at" : "2024-05-16T16:15:09Z"
  }
}