CVE-2024-35185: Denial of service of Minder Server with attacker-controlled REST endpoint
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.
Published May 16, 2024
Affected packages
github.com/stacklok/minder
- Ecosystem
- Go
- Affected
- < 0.0.49
- Fixed in
- 0.0.49
- Check
go list -m github.com/stacklok/minder
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
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.
Credited to AdamKorcz, DavidKorczynski.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More Go vulnerabilities
All Go entriesCVE-2024-37904
Minder affected by denial of service from maliciously configured Git repository
medium5.7Jun 18, 2024CVE-2024-35238
Denial of service of Minder Server from maliciously crafted GitHub attestations
medium5.3May 28, 2024CVE-2024-35194
Stacklok Minder vulnerable to denial of service from maliciously crafted templates
medium5.3May 20, 2024CVE-2024-34084
Minder's GitHub Webhook Handler vulnerable to DoS from un-validated requests
high7.5May 7, 2024CVE-2024-31455
Minder GetRepositoryByName data leak
medium4.3Apr 9, 2024CVE-2024-27916
`GetRepositoryByName`, `DeleteRepositoryByName` and `GetArtifactByName` allow access of arbitrary repositories in Minder by any authenticated user
high7.1Mar 5, 2024
