Skip to content
RCE Advisory Intermediate

GHSL-2020-230: Command injection in aws/aws-sam-cli worflow

The GitHub Actions workflow for checking pull request titles used the untrusted PR title directly in a shell command, allowing command injection. An attacker could run arbitrary commands in the CI runner, but the limited token and lack of secrets meant the impact was mostly CI denial of service or running code in the runner context.

jarlob Follow

Originally disclosed on GitHub Security Lab

The ‘prtitle.yml’ GitHub workflow is vulnerable to arbitrary command injection.

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 directly interpolated the untrusted pull request title into a shell command without sanitisation, allowing shell metacharacters to break out and execute arbitrary commands.

Impact

An attacker could inject commands into the CI runner, but because pull_request workflows have a limited token and no access to secrets, the impact was limited to CI denial of service or running code in the runner context.

What the attacker needed

Attacker can open a pull request; workflow triggers on pull_request

The fix

The issue was resolved by the maintainers, likely by avoiding direct interpolation of the PR title into the shell command.

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.

A GitHub Actions workflow is an automated script that runs when something happens on GitHub, like a new pull request. This workflow took the title of the pull request and put it straight into a shell command without cleaning it, so someone could put special characters in the title to run their own commands on the runner. The runner is a temporary computer that runs the workflow, and it had limited permissions, so the damage was limited.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

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

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.