Ecosyste.ms: Advisories
An open API service providing security vulnerability metadata for many open source software ecosystems.
Security Advisories: GSA_kwCzR0hTQS04Zm1qLTMzZ3ctZzdwd84AA8i8
Denial of service of Minder Server from maliciously crafted GitHub attestations
Minder 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.
To demonstrate this in an isolated way, consider the following example:
package main
import (
"encoding/json"
"fmt"
"io"
"strings"
)
type Attestation struct {
Bundle json.RawMessage `json:"bundle"`
}
type AttestationReply struct {
Attestations []Attestation `json:"attestations"`
}
func main() {
m1 := strings.NewReader("{\"attestations\":[")
maliciousBody := strings.NewReader(strings.Repeat("{\"bundle\":{\"k\": \"v\"{{,", 100000000))
m2 := strings.NewReader("{\"bundle\":{\"k\": \"v\"}}]}")
maliciousBodyReader := io.MultiReader(m1, maliciousBody, maliciousBody, maliciousBody, m2)
fmt.Println("Created malicious body")
var attestationReply AttestationReply
_ = json.NewDecoder(maliciousBodyReader).Decode(&attestationReply)
}
This example mimics the behavior of Minders getAttestationReply
and how a malicious response body passed to getAttestationReply’s
parsing of the response will cause DoS.
When running this script locally on my system, Go incrementally increases memory consumption up to above 90%, freezes the machine and then performs a sigkill.
Attack vector
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:
- The attacker adds a package to ghcr.io with attestations that can be fetched via the
orgs/$owner/attestations/$checksumref
GitHub endpoint. - The attacker registers on Minder and makes Minder fetch the attestations.
- Minder fetches attestations and crashes thereby being denied of service.
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS04Zm1qLTMzZ3ctZzdwd84AA8i8
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Moderate
Classification: General
Published: 6 months ago
Updated: 6 months ago
CVSS Score: 5.3
CVSS vector: CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H
Identifiers: GHSA-8fmj-33gw-g7pw, CVE-2024-35238
References:
- https://github.com/stacklok/minder/security/advisories/GHSA-8fmj-33gw-g7pw
- https://nvd.nist.gov/vuln/detail/CVE-2024-35238
- https://github.com/stacklok/minder/commit/fe321d345b4f738de6a06b13207addc72b59f892
- https://github.com/stacklok/minder/blob/daccbc12e364e2d407d56b87a13f7bb24cbdb074/internal/verifier/sigstore/container/container.go#L271-L300
- https://github.com/advisories/GHSA-8fmj-33gw-g7pw
Blast Radius: 1.0
Affected Packages
go:github.com/stacklok/minder
Dependent packages: 0Dependent repositories: 0
Downloads:
Affected Version Ranges: < 0.0.51
Fixed in: 0.0.51
All affected versions: 0.0.1, 0.0.2, 0.0.3, 0.0.4, 0.0.5, 0.0.6, 0.0.7, 0.0.8, 0.0.9, 0.0.10, 0.0.11, 0.0.12, 0.0.13, 0.0.14, 0.0.15, 0.0.16, 0.0.17, 0.0.18, 0.0.19, 0.0.20, 0.0.21, 0.0.22, 0.0.23, 0.0.24, 0.0.25, 0.0.26, 0.0.27, 0.0.28, 0.0.29, 0.0.30, 0.0.31, 0.0.32, 0.0.33, 0.0.34, 0.0.35, 0.0.36, 0.0.37, 0.0.38, 0.0.39, 0.0.40, 0.0.41, 0.0.42, 0.0.43, 0.0.44, 0.0.45, 0.0.46, 0.0.47, 0.0.48, 0.0.49, 0.0.50
All unaffected versions: 0.0.51, 0.0.52, 0.0.53, 0.0.54, 0.0.55, 0.0.56, 0.0.57, 0.0.58, 0.0.59, 0.0.60, 0.0.61, 0.0.62, 0.0.63, 0.0.64, 0.0.65, 0.0.66, 0.0.67, 0.0.68, 0.0.69, 0.0.70, 0.0.71, 0.0.72, 0.0.73, 0.0.74