# GHSA-7f32-hm4h-w77q: github-slug-action use of `set-env` Runner commands which are processed via stdout

> Attackers can execute arbitrary code by injecting commands via stdout in the github-slug-action GitHub Action.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 3 Feb 2024

## What is GHSA-7f32-hm4h-w77q?

GHSA-7f32-hm4h-w77q is a code injection vulnerability in rlespinasse/github-slug-action, published on 3 Feb 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

### Impact
This GitHub Action use `set-env` runner commands which are processed via stdout related to GHSA-mfwh-5m23-j46w

### Patches
The following versions use the recommended [Environment File Syntax](https://github.com/actions/toolkit/blob/main/docs/commands.md#environment-files).

- 2.1.1
- 1.1.1

### Workarounds
None, it is strongly suggested that you upgrade as soon as possible.

### For more information
If you have any questions or comments about this advisory:
* Open an issue in [rlespinasse/github-slug-action](https://github.com/rlespinasse/github-slug-action)

## Which versions are affected by GHSA-7f32-hm4h-w77q?

2 open source packages ship an affected version, including rlespinasse/github-slug-action.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `rlespinasse/github-slug-action` | GitHub Actions | All versions | 1.1.1 |
| `rlespinasse/github-slug-action` | GitHub Actions | From 2.0.0 | 2.1.1 |

## How do I fix GHSA-7f32-hm4h-w77q?

Upgrade rlespinasse/github-slug-action to a fixed version for your release line: 1.1.1 or 2.1.1.

## Is GHSA-7f32-hm4h-w77q being exploited?

There is no known exploitation of GHSA-7f32-hm4h-w77q in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-7f32-hm4h-w77q and fix it if it is affected.

What it is: GHSA-7f32-hm4h-w77q is a code injection vulnerability in rlespinasse/github-slug-action, published on 3 Feb 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-7f32-hm4h-w77q in the wild and no public exploit code.

Affected packages and fixed versions:
- rlespinasse/github-slug-action (GitHub Actions): affected all versions; fixed in 1.1.1
- rlespinasse/github-slug-action (GitHub Actions): affected from 2.0.0; fixed in 2.1.1

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/GHSA-7f32-hm4h-w77q/ (Markdown: https://insights.sbomify.com/GHSA-7f32-hm4h-w77q/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-7f32-hm4h-w77q

---
From sbomify Insights: https://insights.sbomify.com/GHSA-7f32-hm4h-w77q/
Summaries are generated and may contain mistakes; the official description above is the record.
