Vulnerabilities in pkg:golang/github.com/go-vela/worker

PACKAGE
Advisory Identifier: GHSA-5m7g-pj8w-7593
Advisory Summary

CVE-2022-39395 is a CRITICAL (CVSS 9.9) vela insecure defaults vulnerability (CWE-269: Improper Privilege Management) affecting Github.com/go vela/server libraries in the Go ecosystem. The issue involves vela insecure defaults. Remediation is available by upgrading affected packages to version 0.16.0.

2 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:golang/github.com/go-vela/worker

2 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:golang/github.com/go-vela/worker. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-5m7g-pj8w-7593 CVE-2022-39395 CRITICAL Vela Insecure Defaults
GHSA-pwx5-6wxg-px5h CVE-2024-28236 HIGH Insecure Variable Substitution in Vela

CVE-2022-39395 at a Glance

CVE Identifier CVE-2022-39395
GHSA Identifier GHSA-5m7g-pj8w-7593
Severity CRITICAL
CVSS v3.1 Base Score 9.9
CWE Classification CWE-269: Improper Privilege Management
Affected Product Github.com/go vela/server
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 9.9

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:C/C:H/I:H/A:H).

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

How to Fix CVE-2022-39395

To remediate this vulnerability, upgrade all affected Github.com/go vela/server 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/go-vela/server fixed: 0.16.0
Upgrade github.com/go-vela/server to 0.16.0
github.com/go-vela/worker fixed: 0.16.0
Upgrade github.com/go-vela/worker to 0.16.0
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/go-vela/server

How to Check if You Are Affected

To determine whether your application is affected by CVE-2022-39395, inspect your project dependencies for Github.com/go vela/server:

inspect dependencies for github.com/go-vela/server

Analyze the terminal output to locate any version of Github.com/go vela/server in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.16.0), 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-269: Improper Privilege Management, where the product does not properly assign, modify, track, or check privileges for an actor, creating an unintended sphere of control for that actor. In Github.com/go vela/server, 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

### Impact Some current default configurations for Vela allow exploitation and container breakouts. #### Default Privileged Images Running Vela plugins as privileged Docker containers allows a malicious user to easily break out of the container and gain access to the worker host operating system. On a fresh install of Vela without any additional configuration, the `target/vela-docker` plugin will run as a privileged container, even if the Vela administrators did not intend to allow for any privileged plugins, and even if the `vela.yml` configuration file does not use the `privileged = True` flag. Privileged containers permit trivial breakouts, which can pose significant risk to the environment in which Vela is running. #### Default Allowed Repositories On a fresh install of Vela, anyone with a GitHub account (or other enabled source control management solution) is allowed to enable a repository within Vela and run builds. This means that, if a Vela instance is accessible to the public, a third party could add their own malicious repos to the Vela instance and run arbitrary code. An example of a publicly accessible Vela instance would be one not protected behind a VPN. Whether Vela is publicly accessible depends on how Vela is set up, NOT how it is connected to GitHub. #### Default Enabled Events allows Pull Requests By default, Vela currently enables pull request events when a repository is Vela-enabled. Unless this default was changed when enabling each repository, anyone who can issue a pull request against a repository can trigger a Vela job. This not only permits a third party to run arbitrary code in a Vela environment, but also poses an additional risk when secrets within Vela are configured to be available in pull requests, permitting anyone with access to create pull requests to access these secrets. ### Patches Upgrade to 0.16.0 or later. After upgrading, Vela administrators will need to explicitly change the default settings to configure Vela as desired. Some of the fixes will interrupt existing workflows and will require Vela administrators to modify default settings (see release notes for more information). However, not applying the patch (or workarounds) will continue existing risk exposure. ### Workarounds #### Default Privileged Images Instead of upgrading, the Vela administrators can adjust the worker's `VELA_RUNTIME_PRIVILEGED_IMAGES` setting to be explicitly empty: `VELA_RUNTIME_PRIVILEGED_IMAGES=""` By assigning `VELA_RUNTIME_PRIVILEGED_IMAGES` to an empty value it disallows any images from running as privileged containers in Vela. #### Default Allowed Repositories Instead of upgrading, the Vela administrators can leverage the `VELA_REPO_ALLOWLIST` setting on the server component to restrict access to a list of repositories that are allowed to be enabled. By changing it from the default empty list (currently interpreted by Vela as "all repositories") to a list explicitly allowing specific repositories, Vela administrators can control what repositories are allowed to be enabled in Vela. Vela's current default list of approved repositories that can be added to a Vela instance is an empty list. However this is currently interpreted as allowing all repositories. In the updated version, a null value (the empty list) will be interpreted as permitting no repositories to be added to a Vela instance. #### Default Enabled Events allows Pull Requests Audit enabled repositories and disable `pull_requests` if they are not needed. Instead of upgrading, the pull request trigger can be disabled on a per-repository basis. Additional protection can be provided by preventing unauthorized users from submitting pull requests in GitHub (or other source control management solution). ### Residual Risk #### Default Privileged Images After applying the update, any repos that Vela administrators manually define as "trusted repos" will be able to run the manually-specified images that are allowed to run as privileged. Those repos will continue to be vulnerable to breakout, but applying the update will help protect against the risk of trivial breakout arising from an image running as a privileged container. The recommendation is to utilize plugins that do not require privileged capabilities. For example, utilize `target/vela-kaniko` instead of `target/vela-docker` as the Kaniko plugin does not require privileged access. #### Default Allowed Repositories Applying this update (or workaround) will protect against the risk of Vela interpreting the default empty list of approved repositories as "all repositories" rather than "no repositories" (the current default). #### Default Enabled Events allows Pull Requests Since this change only impacts newly enabled repositories, the update will not address the risk to existing enabled repositories resulting from Vela enabling pull request events when a repository is Vela-enabled. Additionally, this change only impacts defaults; users can still configure their repositories to allow pull requests as triggering events. In order to monitor risk going forward, refer to the `Workaround` section with the heading `Default Enabled Events allows Pull Requests`. ### For more information If you have any questions or comments about this advisory: * Email us at [vela@target.com](mailto:vela@target.com) Affected products: `go-vela/worker`, `go-vela/server`, `go-vela/ui`, `go-vela/documentation`

CVE-2022-39395 Affected Github.com/go vela/server Versions

2 component(s)
Fixed Versions:
0.16.0
Product / Package Ecosystem Affected Versions Fixed Version
github.com/go-vela/server
Go
< 0.16.0
0.16.0
github.com/go-vela/worker
Go
< 0.16.0
0.16.0

References

Frequently Asked Questions

What is CVE-2022-39395?
CVE-2022-39395 is a security vulnerability in Github.com/go vela/server involving Vela Insecure Defaults under CWE-269: Improper Privilege Management.
Which Github.com/go vela/server versions are affected?
Affected versions include releases prior to 0.16.0 across affected packages: github.com/go-vela/server, github.com/go-vela/worker.
What version fixes CVE-2022-39395?
Upgrading to 0.16.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/go-vela/server affected?
Yes, github.com/go-vela/server is affected in releases prior to 0.16.0. Upgrade your dependency to 0.16.0 or later.
Is github.com/go-vela/worker affected?
Yes, github.com/go-vela/worker is affected in releases prior to 0.16.0. Upgrade your dependency to 0.16.0 or later.
What is the CVSS score of CVE-2022-39395?
CVE-2022-39395 has a CVSS v3.1 base score of 9.9 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H.
What CWE is associated with CVE-2022-39395?
CVE-2022-39395 is classified under CWE-269: Improper Privilege Management (The product does not properly assign, modify, track, or check privileges for an actor, creating an unintended sphere of control for that actor.).
How can I check Go dependencies for CVE-2022-39395?
Run the dependency tree command: 'inspect dependencies for github.com/go-vela/server'. 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-5m7g-pj8w-7593",
  "modified" : "2024-09-06T21:33:41Z",
  "published" : "2022-11-09T19:17:21Z",
  "aliases" : [ "CVE-2022-39395" ],
  "summary" : "Vela Insecure Defaults",
  "details" : "### Impact\nSome current default configurations for Vela allow exploitation and container breakouts.\n\n#### Default Privileged Images\n\nRunning Vela plugins as privileged Docker containers allows a malicious user to easily break out of the container and gain access to the worker host operating system. On a fresh install of Vela without any additional configuration, the `target/vela-docker` plugin will run as a privileged container, even if the Vela administrators did not intend to allow for any privileged plugins, and even if the `vela.yml` configuration file does not use the `privileged = True` flag.\n\nPrivileged containers permit trivial breakouts, which can pose significant risk to the environment in which Vela is running.\n\n#### Default Allowed Repositories\n\nOn a fresh install of Vela, anyone with a GitHub account (or other enabled source control management solution) is allowed to enable a repository within Vela and run builds. This means that, if a Vela instance is accessible to the public, a third party could add their own malicious repos to the Vela instance and run arbitrary code.\n\nAn example of a publicly accessible Vela instance would be one not protected behind a VPN. Whether Vela is publicly accessible depends on how Vela is set up, NOT how it is connected to GitHub.\n\n#### Default Enabled Events allows Pull Requests\n\nBy default, Vela currently enables pull request events when a repository is Vela-enabled. Unless this default was changed when enabling each repository, anyone who can issue a pull request against a repository can trigger a Vela job.\n\nThis not only permits a third party to run arbitrary code in a Vela environment, but also poses an additional risk when secrets within Vela are configured to be available in pull requests, permitting anyone with access to create pull requests to access these secrets.\n\n### Patches\n\nUpgrade to 0.16.0 or later. After upgrading, Vela administrators will need to explicitly change the default settings to configure Vela as desired.\n\nSome of the fixes will interrupt existing workflows and will require Vela administrators to modify default settings (see release notes for more information). However, not applying the patch (or workarounds) will continue existing risk exposure.\n\n### Workarounds\n\n#### Default Privileged Images\n\nInstead of upgrading, the Vela administrators can adjust the worker's `VELA_RUNTIME_PRIVILEGED_IMAGES` setting to be explicitly empty:\n\n`VELA_RUNTIME_PRIVILEGED_IMAGES=\"\"`\n\nBy assigning `VELA_RUNTIME_PRIVILEGED_IMAGES` to an empty value it disallows any images from running as privileged containers in Vela.\n\n#### Default Allowed Repositories\n\nInstead of upgrading, the Vela administrators can leverage the `VELA_REPO_ALLOWLIST` setting on the server component to restrict access to a list of repositories that are allowed to be enabled.\n\nBy changing it from the default empty list (currently interpreted by Vela as \"all repositories\") to a list explicitly allowing specific repositories, Vela administrators can control what repositories are allowed to be enabled in Vela.\n\nVela's current default list of approved repositories that can be added to a Vela instance is an empty list. However this is currently interpreted as allowing all repositories.\n\nIn the updated version, a null value (the empty list) will be interpreted as permitting no repositories to be added to a Vela instance.\n\n#### Default Enabled Events allows Pull Requests\n\nAudit enabled repositories and disable `pull_requests` if they are not needed.\n\nInstead of upgrading, the pull request trigger can be disabled on a per-repository basis.\n\nAdditional protection can be provided by preventing unauthorized users from submitting pull requests in GitHub (or other source control management solution).\n\n### Residual Risk\n\n#### Default Privileged Images\n\nAfter applying the update, any repos that Vela administrators manually define as \"trusted repos\" will be able to run the manually-specified images that are allowed to run as privileged. Those repos will continue to be vulnerable to breakout, but applying the update will help protect against the risk of trivial breakout arising from an image running as a privileged container.\n\nThe recommendation is to utilize plugins that do not require privileged capabilities.\n\nFor example, utilize `target/vela-kaniko` instead of `target/vela-docker` as the Kaniko plugin does not require privileged access.\n\n#### Default Allowed Repositories\n\nApplying this update (or workaround) will protect against the risk of Vela interpreting the default empty list of approved repositories as \"all repositories\" rather than \"no repositories\" (the current default).\n\n#### Default Enabled Events allows Pull Requests\n\nSince this change only impacts newly enabled repositories, the update will not address the risk to existing enabled repositories resulting from Vela enabling pull request events when a repository is Vela-enabled.\n\nAdditionally, this change only impacts defaults; users can still configure their repositories to allow pull requests as triggering events.\n\nIn order to monitor risk going forward, refer to the `Workaround` section with the heading `Default Enabled Events allows Pull Requests`.\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Email us at [vela@target.com](mailto:vela@target.com)\n\nAffected products: `go-vela/worker`, `go-vela/server`, `go-vela/ui`, `go-vela/documentation`",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/go-vela/server"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.16.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/go-vela/worker"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.16.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/go-vela/server/security/advisories/GHSA-5m7g-pj8w-7593"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/go-vela/ui/security/advisories/GHSA-xf39-98m2-889v"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/go-vela/worker/security/advisories/GHSA-2w78-ffv6-p46w"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-39395"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/go-vela/server/commit/05558ee99d70f7d6f83bed7c8f78ac0b35fa26f4"
  }, {
    "type" : "WEB",
    "url" : "https://docs.docker.com/engine/security/#docker-daemon-attack-surface"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/go-vela/server/releases/tag/v0.16.0"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/go-vela/ui/releases/tag/v0.17.0"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/go-vela/worker/releases/tag/v0.16.0"
  }, {
    "type" : "WEB",
    "url" : "https://go-vela.github.io/docs/installation/server/reference/#vela_repo_allowlist"
  }, {
    "type" : "WEB",
    "url" : "https://go-vela.github.io/docs/installation/worker/reference/#vela_runtime_privileged_images"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2022-1100"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-269" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-11-09T19:17:21Z",
    "nvd_published_at" : "2022-11-10T18:15:00Z"
  }
}