Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: GSA_kwCzR0hTQS1xNmg4LTRqMnYtcGpnNM4AA5gv

Minder trusts client-provided mapping from repo name to upstream ID

Summary

When using a modified client or the grpc interface directly, the RegisterRepository call accepts both the repository owner / repo and the repo_id. Furthermore, these two are not checked for matching before registering webhooks and data in the database.

Details

It is possible for an attacker to register a repository with a invalid or differing upstream ID, which causes Minder to report the repository as registered, but not remediate any future changes which conflict with policy (because the webhooks for the repo do not match any known repository in the database). When attempting to register a repo with a different repo ID, the registered provider must have admin on the named repo, or a 404 error will result. Similarly, if the stored provider token does not have repo access, then the remediations will not apply successfully. Lastly, it appears that reconciliation actions do not execute against repos with this type of mismatch.

PoC

With an RPC like the following text proto:

context {
  ...
}
repository {
  owner: "Stacklok-Demo-Org"
  repo: "python-app"
  # repo_id is defaulted to 0
}

I was able to produce the following minder output:

+--------------------------------------+--------------------------------------+----------+-------------+-------------------+------------+
|                  ID                  |               PROJECT                | PROVIDER | UPSTREAM ID |       OWNER       |    NAME    |
+--------------------------------------+--------------------------------------+----------+-------------+-------------------+------------+
| da3acba4-ef66-4d9b-b41e-250869107fd5 | f9f4aef0-74af-4909-a0c3-0e8ac7fbc38d | github   |           0 | Stacklok-Demo-Org | python-app |
+--------------------------------------+--------------------------------------+----------+-------------+-------------------+------------+
| 7cf8f7b8-b19b-40dd-a96b-b88bb1ef5563 | f9f4aef0-74af-4909-a0c3-0e8ac7fbc38d | github   |   762029128 | evankanderson     | bad-python |
+--------------------------------------+--------------------------------------+----------+-------------+-------------------+------------+
$ gh api repos/Stacklok-Demo-Org/python-app | jq .id                  
762029128

I've registered bad-python with the ID of python-app, and python-app with an ID of 0.

Impact

This appears to primarily be a potential denial-of-service vulnerability.

Permalink: https://github.com/advisories/GHSA-q6h8-4j2v-pjg4
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS1xNmg4LTRqMnYtcGpnNM4AA5gv
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Moderate
Classification: General
Published: 9 months ago
Updated: 4 months ago


CVSS Score: 4.6
CVSS vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:L/A:L

Identifiers: GHSA-q6h8-4j2v-pjg4, CVE-2024-27093
References: Repository: https://github.com/stacklok/minder
Blast Radius: 1.0

Affected Packages

go:github.com/stacklok/minder
Dependent packages: 0
Dependent repositories: 0
Downloads:
Affected Version Ranges: < 0.20240226.1425
Fixed in: 0.20240226.1425
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, 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
All unaffected versions: