Skip to content
Advisory Intermediate

GHSL-2020-331: Unauthorized repository modification or secrets exfiltration in a GitHub workflow of appsmith

A GitHub workflow triggered by pull requests from forks checked out and ran the fork's code while holding a read/write token and secrets for the base repository. An attacker could therefore push changes to the base repository or exfiltrate its secrets.

jarlob Follow

Originally disclosed on GitHub Security Lab

The client.yml GitHub workflow is vulnerable to unauthorized modification of the base repository and secret exfiltration.

jarlob, on GitHub Security Lab

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 report has not been written yet. The Original tab links to the source.

How it worked

Root cause

The workflow used pull_request_target, which grants a write token and secrets, and then explicitly checked out and executed the untrusted fork's code.

Impact

The vulnerability allows for unauthorized modification of the base repository and secrets exfiltration.

What the attacker needed

Pull request from a fork; changes under app/client

The fix

A partial fix was applied and the maintainers later reported the issue was mitigated, though the text does not describe the change.

How it was found

  1. A pull request from a fork changes files under the client directory, triggering the workflow.
  2. The workflow checks out the merged pull request commit.
  3. It installs dependencies and runs the unit tests from that untrusted code.
  4. The attacker's code runs with the base repository's token and secrets.

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 report has not been written yet. The Original tab links to the source.

GitHub Actions are automated jobs that run when something happens in a repository, such as a pull request. A special trigger called pull_request_target gives the job powerful permissions and secrets so it can comment on pull requests, but it is meant to run only trusted code. Here the job also downloaded and ran the code from the pull request itself, so a stranger's code got those powers.

More by jarlob

View all

192 more disclosed reports, best first.

More from GitHub Security Lab

View all

The newest disclosed reports for this program.

Similar reports

Same bug class and techniques, clearest first.