CVE-2023-31128 NextCloud Cookbook's pull-checks.yml workflow is vulnerable to OS Command Injection

High 8.1 Published Updated

Attackers can execute arbitrary commands in the repository's CI/CD pipeline via untrusted input in the pull-checks workflow.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
Not needed
Fix
None listed

What is CVE-2023-31128?

CVE-2023-31128 is a high-severity command injection vulnerability in nextcloud cookbook, published on 26 May 2023. Any signed-in user can exploit it over the network, with no action from the victim.

Official description

NextCloud Cookbook is a recipe library app. Prior to commit a46d9855 on the `master` branch and commit 489bb744 on the `main-0.9.x` branch, the `pull-checks.yml` workflow is vulnerable to command injection attacks because of using an untrusted `github.head_ref` field. The `github.head_ref` value is an attacker-controlled value. Assigning the value to `zzz";echo${IFS}"hello";#` can lead to command injection. Since the permission is not restricted, the attacker has a write-access to the repository. This issue is fixed in commit a46d9855 on the `master` branch and commit 489bb744 on the `main-0.9.x` branch. There is no risk for the user of the app within the NextCloud server. This only affects the main repository and possible forks of it. Those who have forked the NextCloud Cookbook repository should make sure their forks are on the latest version to prevent code injection attacks and similar.

Weakness: CWE-78

Which versions are affected by CVE-2023-31128?

It affects 1 product.

Products include Nextcloud Cookbook.

How do I fix CVE-2023-31128?

No fix has been published for CVE-2023-31128 yet. Limit exposure of the affected software until one is available.

Upgrade, and pass arguments to programs as a list instead of through a shell. More about Command injection.

Is CVE-2023-31128 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2023-31128 exists.

Sources

Also known as GHSA-c5pc-mf2f-xq8h.

Is CVE-2023-31128 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free