# CVE-2024-35238: Denial of service of Minder Server from maliciously crafted GitHub attestations

> An attacker can crash the Minder server by forcing it to fetch a maliciously large GitHub attestation response, causing a denial of service.

- **Severity:** Medium 5.3 (`CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 27 May 2024
- **Updated:** 3 Sep 2024
- **Also known as:** GHSA-8fmj-33gw-g7pw, GO-2024-2885

## What is CVE-2024-35238?

CVE-2024-35238 is a medium-severity denial of service vulnerability in stacklok minder, published on 27 May 2024. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

Minder by Stacklok is an open source software supply chain security platform. Minder prior to version 0.0.51 is vulnerable to a denial-of-service (DoS) attack which could allow an attacker to crash the Minder server and deny other users access to it. The root cause of the vulnerability is that Minders sigstore verifier reads an untrusted response entirely into memory without enforcing a limit on the response body. An attacker can exploit this by making Minder make a request to an attacker-controlled endpoint which returns a response with a large body which will crash the Minder server. Specifically, the point of failure is where Minder parses the response from the GitHub attestations endpoint in `getAttestationReply`. Here, Minder makes a request to the `orgs/$owner/attestations/$checksumref` GitHub endpoint (line 285) and then parses the response into the `AttestationReply` (line 295). The way Minder parses the response on line 295 makes it prone to DoS if the response is large enough. Essentially, the response needs to be larger than the machine has available memory.  Version 0.0.51 contains a patch for this issue.

The content that is hosted at the `orgs/$owner/attestations/$checksumref` GitHub attestation endpoint is controlled by users including unauthenticated users to Minders threat model. However, a user will need to configure their own Minder settings to cause Minder to make Minder send a request to fetch the attestations. The user would need to know of a package whose attestations were configured in such a way that they would return a large response when fetching them. As such, the steps needed to carry out this attack would look as such:

1. The attacker adds a package to ghcr.io with attestations that can be fetched via the `orgs/$owner/attestations/$checksumref` GitHub endpoint.
2. The attacker registers on Minder and makes Minder fetch the attestations.
3. Minder fetches attestations and crashes thereby being denied of service.

Weakness: CWE-770 (Allocation of Resources Without Limits or Throttling)

## Which versions are affected by CVE-2024-35238?

3 open source packages ship an affected version, including github.com/stacklok/minder.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/stacklok/minder` | Go | All versions | 0.0.51 |
| `github.com/stacklok/minder` | Go | All versions | 0.0.51 |
| `github.com/stacklok/minder` | Go | All versions | 0.0.51 |

## How do I fix CVE-2024-35238?

Upgrade github.com/stacklok/minder to 0.0.51 or later.

## Is CVE-2024-35238 being exploited?

There is no known exploitation of CVE-2024-35238 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-35238 and fix it if it is affected.

What it is: CVE-2024-35238 is a medium-severity denial of service vulnerability in stacklok minder, published on 27 May 2024. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2024-35238 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/stacklok/minder (Go): affected all versions; fixed in 0.0.51
- github.com/stacklok/minder (Go): affected all versions; fixed in 0.0.51
- github.com/stacklok/minder (Go): affected all versions; fixed in 0.0.51

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-35238/ (Markdown: https://insights.sbomify.com/CVE-2024-35238/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-35238
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-35238
- OSV: https://osv.dev/vulnerability/CVE-2024-35238

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-35238/
Summaries are generated and may contain mistakes; the official description above is the record.
