# CVE-2026-26189: Trivy Action has a script injection via sourced env file in composite action

> Attackers can execute arbitrary commands in GitHub Actions runners by injecting shell metacharacters into Trivy Action inputs.

- **Severity:** Medium 5.9 (`CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** An administrator
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 19 Feb 2026
- **Updated:** 19 Feb 2026
- **Also known as:** GHSA-9p44-j4g5-cfx5

## What is CVE-2026-26189?

CVE-2026-26189 is a medium-severity command injection vulnerability in aquasecurity trivy-action, published on 19 Feb 2026. An attacker needs administrator access to exploit it, with no action from the victim.

### Official description

Trivy Action runs Trivy as GitHub action to scan a Docker container image for vulnerabilities. A command injection vulnerability exists in `aquasecurity/trivy-action` versions 0.31.0 through 0.33.1 due to improper handling of action inputs when exporting environment variables. The action writes `export VAR=<input>` lines to `trivy_envs.txt` based on user-supplied inputs and subsequently sources this file in `entrypoint.sh`. Because input values are written without appropriate shell escaping, attacker-controlled input containing shell metacharacters (e.g., `$(...)`, backticks, or other command substitution syntax) may be evaluated during the sourcing process. This can result in arbitrary command execution within the GitHub Actions runner context. Version 0.34.0 contains a patch for this issue. The vulnerability is exploitable when a consuming workflow passes attacker-controlled data into any action input that is written to `trivy_envs.txt`. Access to user input is required by the malicious actor. Workflows that do not pass attacker-controlled data into `trivy-action` inputs, workflows that upgrade to a patched version that properly escapes shell values or eliminates the `source ./trivy_envs.txt` pattern, and workflows where user input is not accessible are not affected.

Weakness: CWE-78 (Improper Neutralization of Special Elements used in an OS Command)

## Which versions are affected by CVE-2026-26189?

1 open source package ship an affected version, including aquasecurity/trivy-action. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `aquasecurity/trivy-action` | GitHub Actions | From 0.31.0 | 0.34.0 |

Products: Aquasec Trivy Action.

## How do I fix CVE-2026-26189?

Upgrade aquasecurity/trivy-action to 0.34.0 or later.

## Is CVE-2026-26189 being exploited?

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

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-26189 and fix it if it is affected.

What it is: CVE-2026-26189 is a medium-severity command injection vulnerability in aquasecurity trivy-action, published on 19 Feb 2026. An attacker needs administrator access to exploit it, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-26189 in the wild and no public exploit code.

Affected packages and fixed versions:
- aquasecurity/trivy-action (GitHub Actions): affected from 0.31.0; fixed in 0.34.0

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-2026-26189/ (Markdown: https://insights.sbomify.com/CVE-2026-26189/index.md)
```

## Sources

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

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