# CVE-2021-32724: check-spelling workflow vulnerable to GITHUB_TOKEN leakage via symlink attack

> Attackers can leak GITHUB_TOKEN via symlink attacks in check-spelling workflows, enabling repository write access and secret theft.

- **Severity:** Critical 9.9 (`CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H`)
- **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:** 9 Sep 2021
- **Updated:** 3 Aug 2024
- **Also known as:** GHSA-g86g-chm8-7r2p

## What is CVE-2021-32724?

CVE-2021-32724 is a critical vulnerability in check-spelling, published on 9 Sep 2021. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

check-spelling is a github action which provides CI spell checking. In affected versions and for a repository with the [check-spelling action](https://github.com/marketplace/actions/check-spelling) enabled that triggers on `pull_request_target` (or `schedule`), an attacker can send a crafted Pull Request that causes a `GITHUB_TOKEN` to be exposed. With the `GITHUB_TOKEN`, it's possible to push commits to the repository bypassing standard approval processes. Commits to the repository could then steal any/all secrets available to the repository. As a workaround users may can either: [Disable the workflow](https://docs.github.com/en/actions/managing-workflow-runs/disabling-and-enabling-a-workflow) until you've fixed all branches or Set repository to [Allow specific actions](https://docs.github.com/en/github/administering-a-repository/managing-repository-settings/disabling-or-limiting-github-actions-for-a-repository#allowing-specific-actions-to-run). check-spelling isn't a verified creator and it certainly won't be anytime soon. You could then explicitly add other actions that your repository uses. Set repository [Workflow permissions](https://docs.github.com/en/github/administering-a-repository/managing-repository-settings/disabling-or-limiting-github-actions-for-a-repository#setting-the-permissions-of-the-github_token-for-your-repository) to `Read repository contents permission`. Workflows using `check-spelling/check-spelling@main` will get the fix automatically. Workflows using a pinned sha or tagged version will need to change the affected workflows for all repository branches to the latest version. Users can verify who and which Pull Requests have been running the action by looking up the spelling.yml action in the Actions tab of their repositories, e.g., https://github.com/check-spelling/check-spelling/actions/workflows/spelling.yml - you can filter PRs by adding ?query=event%3Apull_request_target, e.g., https://github.com/check-spelling/check-spelling/actions/workflows/spelling.yml?query=event%3Apull_request_target.

Weakness: CWE-532 (Insertion of Sensitive Information into Log File)

## Which versions are affected by CVE-2021-32724?

1 open source package ship an affected version, including check-spelling/check-spelling. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `check-spelling/check-spelling` | GitHub Actions | All versions | 0.0.19 |

Products: Check-Spelling Check-Spelling.

## How do I fix CVE-2021-32724?

Upgrade check-spelling/check-spelling to 0.0.19 or later.

## Is CVE-2021-32724 being exploited?

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

Public exploit code:

- https://github.com/MaximeSchlegel/CVE-2021-32724-Target (github_poc): https://github.com/MaximeSchlegel/CVE-2021-32724-Target

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2021-32724 and fix it if it is affected.

What it is: CVE-2021-32724 is a critical vulnerability in check-spelling, published on 9 Sep 2021. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2021-32724 in the wild and no public exploit code.

Affected packages and fixed versions:
- check-spelling/check-spelling (GitHub Actions): affected all versions; fixed in 0.0.19

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

## Sources

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

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