Expand file tree
The check-spelling GitHub Actions workflow used the Pull Request submitter's own advice.md configuration file when posting a comment, and that file could be a symbolic link to a system file holding the workflow's environment variables. An attacker could submit a Pull Request that made the workflow post the short-lived GITHUB_TOKEN in a comment, then use that token to merge pull requests, delete comments, publish releases and move tags on the target repository.
Published on github.com
History
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The workflow trusted configuration files from the untrusted Pull Request branch and read them without resolving or rejecting symbolic links, so a link to a system file was followed and its contents were published.
Impact
An attacker could obtain a token with read and write access to the target repository and use it to merge pull requests, delete comments, publish releases and move tags, though the token is short-lived and racing its invalidation for more than one action is unreliable.
What the attacker needed
A repository using the workflow; attacker can open a pull request; victim need not click anything
The fix
The workflow was updated to version v0.0.19, which users should adopt on every open branch, and the advisory also suggests renaming the workflow file on unused branches and disabling the workflow.
How it was found
- Install the check-spelling workflow into a repository and fork it as a second user.
- Create a branch, add a file containing a spelling mistake, push it and open a Pull Request.
- Replace the advice file in the branch with a symbolic link to the process environment file and push the commit.
- The workflow re-runs and posts a comment containing the environment, including the token.
- Poll the comments to retrieve the token before it is invalidated, then use it against the repository API.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
A workflow is an automated script that a code hosting site runs when something happens, such as someone proposing a change. That script is given a temporary password (a token) so it can act on the project's behalf. Here the script read a settings file supplied by the person proposing the change, and that file was really a shortcut pointing at the machine's list of environment variables, so the script printed the password into a public comment.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.