ghsa-pwx5-6wxg-px5h
Vulnerability from github
Published
2024-03-14 21:17
Modified
2024-03-14 21:17
Summary
Insecure Variable Substitution in Vela
Details

Impact

Vela pipelines can use variable substitution combined with insensitive fields like parameters, image and entrypoint to inject secrets into a plugin/image and — by using common substitution string manipulation — can bypass log masking and expose secrets without the use of the commands block. This unexpected behavior primarily impacts secrets restricted by the "no commands" option. This can lead to unintended use of the secret value, and increased risk of exposing the secret during image execution bypassing log masking.

Given by the following substitution examples: using parameters yaml steps: - name: example image: <some plugin> secrets: [ example_secret ] parameters: example: $${EXAMPLE_SECRET}

using image tag yaml steps: - name: example image: <some plugin>:latest${EXAMPLE_SECRET} secrets: [ example_secret ]

using entrypoint as a shim for commands yaml steps: - name: example image: <some plugin> secrets: [ example_secret ] entrypoint: [ "sh", "-c", "echo $EXAMPLE_SECRET", ]

To exploit this the pipeline author must be supplying the secrets to a plugin that is designed in such a way that will print those parameters in logs. Plugin parameters are not designed for sensitive values and are often intentionally printed throughout execution for informational/debugging purposes. Parameters should therefore be treated as insensitive.

While Vela provides secrets masking, secrets exposure is not entirely solved by the masking process. A docker image (plugin) can easily expose secrets if they are not handled properly, or altered in some way. There is a responsibility on the end-user to understand how values injected into a plugin are used. This is a risk that exists for many CICD systems (like GitHub Actions) that handle sensitive runtime variables. Rather, the greater risk is that users who restrict a secret to the "no commands" option and use image restriction can still have their secret value exposed via substitution tinkering, which turns the image and command restrictions into a false sense of security.

Patches

N/A

Workarounds

  • Do not provide sensitive values to plugins that can potentially expose them, especially in parameters that are not intended to be used for sensitive values.
  • Ensure plugins (especially those that utilize shared secrets) follow best practices to avoid logging parameters that are expected to be sensitive.
  • Minimize secrets with pull_request events enabled, as this allows users to change pipeline configurations and pull in secrets to steps not typically part of the CI process.
  • Make use of the build approval setting, restricting builds from untrusted users
  • Limit use of shared secrets, as they are less restrictive to access by nature.

References

  • https://github.com/go-vela/worker

For more information

If you have any questions or comments about this advisory:

Affected products: go-vela/worker

Show details on source website


{
  "affected": [
    {
      "database_specific": {
        "last_known_affected_version_range": "\u003c= 0.23.1"
      },
      "package": {
        "ecosystem": "Go",
        "name": "github.com/go-vela/worker"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "0.23.2"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2024-28236"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-200",
      "CWE-532"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2024-03-14T21:17:05Z",
    "nvd_published_at": "2024-03-12T21:15:59Z",
    "severity": "HIGH"
  },
  "details": "### Impact\nVela pipelines can use variable substitution combined with insensitive fields like `parameters`, `image` and `entrypoint` to inject secrets into a plugin/image and \u2014 by using common substitution string manipulation \u2014 can bypass log masking and expose secrets without the use of the commands block. This unexpected behavior primarily impacts secrets restricted by the \"no commands\" option. This can lead to unintended use of the secret value, and increased risk of exposing the secret during image execution bypassing log masking.\n\nGiven by the following substitution examples:\nusing `parameters`\n```yaml\nsteps:\n  - name: example\n    image: \u003csome plugin\u003e\n    secrets: [ example_secret ]\n    parameters:\n      example: $${EXAMPLE_SECRET}\n```\n\nusing `image` tag\n```yaml\nsteps:\n  - name: example\n    image: \u003csome plugin\u003e:latest${EXAMPLE_SECRET}\n    secrets: [ example_secret ]\n```\n\nusing `entrypoint` as a shim for `commands`\n```yaml\nsteps:\n  - name: example\n    image: \u003csome plugin\u003e\n    secrets: [ example_secret ]\n    entrypoint:\n      [\n        \"sh\",\n        \"-c\",\n        \"echo $EXAMPLE_SECRET\",\n      ]\n```\n\n\n\n**To exploit this** the pipeline author must be supplying the secrets to a plugin that is designed in such a way that will print those parameters in logs. Plugin parameters are not designed for sensitive values and are often intentionally printed throughout execution for informational/debugging purposes. Parameters should therefore be treated as insensitive.\n\nWhile Vela provides secrets masking, secrets exposure is not entirely solved by the masking process. A docker image (plugin) can easily expose secrets if they are not handled properly, or altered in some way. There is a responsibility on the end-user to understand how values injected into a plugin are used. This is a risk that exists for many CICD systems (like GitHub Actions) that handle sensitive runtime variables. Rather, the greater risk is that users who restrict a secret to the \"no commands\" option and use image restriction can still have their secret value exposed via substitution tinkering, which turns the image and command restrictions into a false sense of security.\n\n### Patches\nN/A\n\n### Workarounds\n- Do not provide sensitive values to plugins that can potentially expose them, especially in `parameters` that are not intended to be used for sensitive values.\n- Ensure plugins (especially those that utilize shared secrets) follow best practices to avoid logging parameters that are expected to be sensitive.\n- Minimize secrets with `pull_request` events enabled, as this allows users to change pipeline configurations and pull in secrets to steps not typically part of the CI process.\n- Make use of the build approval setting, restricting builds from untrusted users\n- Limit use of shared secrets, as they are less restrictive to access by nature.\n\n### References\n- https://github.com/go-vela/worker\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n\n- Email us at [vela@target.com](mailto:vela@target.com)\n\nAffected products: `go-vela/worker`",
  "id": "GHSA-pwx5-6wxg-px5h",
  "modified": "2024-03-14T21:17:05Z",
  "published": "2024-03-14T21:17:05Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/go-vela/worker/security/advisories/GHSA-pwx5-6wxg-px5h"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-28236"
    },
    {
      "type": "WEB",
      "url": "https://github.com/go-vela/worker/commit/e1572743b008e4fbce31ebb1dcd23bf6a1a30297"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/go-vela/worker"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Insecure Variable Substitution in Vela"
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
  • Confirmed: The vulnerability is confirmed from an analyst perspective.
  • Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
  • Patched: This vulnerability was successfully patched by the user reporting the sighting.
  • Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
  • Not confirmed: The user expresses doubt about the veracity of the vulnerability.
  • Not patched: This vulnerability was not successfully patched by the user reporting the sighting.


Loading…

Loading…