# CVE-2024-28236: Insecure Variable Substitution in Vela

> Attackers can bypass log masking and expose secrets in Vela pipelines by manipulating variable substitution in insensitive fields, undermining security restrictions.

- **Severity:** High 7.7 (`CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 12 Mar 2024
- **Updated:** 2 Aug 2024
- **Also known as:** GHSA-pwx5-6wxg-px5h, GO-2024-2641

## What is CVE-2024-28236?

CVE-2024-28236 is a high-severity vulnerability in go-vela worker, published on 12 Mar 2024. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

Vela is a Pipeline Automation (CI/CD) framework built on Linux container technology written in Golang. 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. **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. This issue has been addressed in version 0.23.2. Users are advised to upgrade. Users unable to upgrade should 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, and limit use of shared secrets, as they are less restrictive to access by nature.

Weakness: CWE-532 (Insertion of Sensitive Information into Log File), CWE-200 (Exposure of Sensitive Information to an Unauthorized Actor)

## Which versions are affected by CVE-2024-28236?

3 open source packages ship an affected version, including github.com/go-vela/worker. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/go-vela/worker` | Go | All versions | 0.23.2 |
| `github.com/go-vela/worker` | Go | All versions | 0.23.2 |
| `github.com/go-vela/worker` | Go | All versions | 0.23.2 |

Products: Go-Vela Worker.

## How do I fix CVE-2024-28236?

Upgrade github.com/go-vela/worker to 0.23.2 or later.

## Is CVE-2024-28236 being exploited?

There is no known exploitation of CVE-2024-28236 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-28236 and fix it if it is affected.

What it is: CVE-2024-28236 is a high-severity vulnerability in go-vela worker, published on 12 Mar 2024. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2024-28236 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/go-vela/worker (Go): affected all versions; fixed in 0.23.2
- github.com/go-vela/worker (Go): affected all versions; fixed in 0.23.2
- github.com/go-vela/worker (Go): affected all versions; fixed in 0.23.2

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-28236/ (Markdown: https://insights.sbomify.com/CVE-2024-28236/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-28236
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-28236
- OSV: https://osv.dev/vulnerability/CVE-2024-28236

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-28236/
Summaries are generated and may contain mistakes; the official description above is the record.
