Skip to content
RCE Advisory Intermediate CVE-2023-26493

GHSL-2023-027: Command Injection in Cocos - CVE-2023-26493

The Cocos Engine GitHub Actions workflow `web-interface-check.yml` used untrusted input from a pull request branch name directly in a shell command, allowing an attacker to inject arbitrary commands. An attacker could take over the GitHub Runner, steal secrets such as `GITHUB_TOKEN`, and modify the repository.

jorgectf Follow

Originally disclosed on GitHub Security Lab

The web-interface-check.yml workflow is triggered on pullrequesttarget (i.e., when a Pull Request against the base repository is created or updated), which also covers the case when the Pull Request is originated from a fork. The workflow starts with full write GitHub repository token since the defaults aren’t altered.

jorgectf, 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

Impact

This issue may lead to stealing workflow secrets and modification of the repository.

What the attacker needed

GitHub account; Ability to fork the repository; Ability to create a pull request

The fix

The vulnerable workflow was deleted.

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, like a pull request. This workflow took the name of the branch from the pull request and put it directly into a command without checking it. Because the branch name can be controlled by anyone, an attacker could put special characters in the branch name to run their own commands on the server.

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 jorgectf

View all

34 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.