CVE-2021-21248 Post-Auth Arbitrary Code execution via Groovy script injection

Critical 9.6 Published Updated

Authenticated users can execute arbitrary code on the server by injecting Groovy code into build parameters.

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-2021-21248?

CVE-2021-21248 is a critical code injection vulnerability in theonedev onedev, published on 15 Jan 2021. Any signed-in user can exploit it over the network, with no action from the victim.

Official description

OneDev is an all-in-one devops platform. In OneDev before version 4.0.3, there is a critical vulnerability involving the build endpoint parameters. InputSpec is used to define parameters of a Build spec. It does so by using dynamically generated Groovy classes. A user able to control job parameters can run arbitrary code on OneDev's server by injecting arbitrary Groovy code. The ultimate result is in the injection of a static constructor that will run arbitrary code. For a full example refer to the referenced GHSA. This issue was addressed in 4.0.3 by escaping special characters such as quote from user input.

Weakness: CWE-94, CWE-74

Which versions are affected by CVE-2021-21248?

It affects 1 product.

Products include Onedev Project Onedev.

How do I fix CVE-2021-21248?

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

Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.

Is CVE-2021-21248 being exploited?

There is no known exploitation of CVE-2021-21248 in the wild and no public exploit code.

Sources

Also known as GHSA-gwp4-5498-hv5f.

Is CVE-2021-21248 in your software?

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

Check your SBOMs for free