CVE-2021-21249 Post-Auth Unsafe Yaml deserialization

Critical 9.6 Published Updated

Authenticated attackers can achieve remote code execution in OneDev via unsafe YAML deserialization using SnakeYaml.

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-21249?

CVE-2021-21249 is a critical unsafe deserialization 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 an issue involving YAML parsing which can lead to post-auth remote code execution. In order to parse and process YAML files, OneDev uses SnakeYaml which by default (when not using `SafeConstructor`) allows the instantiation of arbitrary classes. We can leverage that to run arbitrary code by instantiating classes such as `javax.script.ScriptEngineManager` and using `URLClassLoader` to load the script engine provider, resulting in the instantiation of a user controlled class. For a full example refer to the referenced GHSA. This issue was addressed in 4.0.3 by only allowing certain known classes to be deserialized

Weakness: CWE-502, CWE-74

Which versions are affected by CVE-2021-21249?

It affects 1 product.

Products include Onedev Project Onedev.

How do I fix CVE-2021-21249?

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

Upgrade, and only deserialise data from trusted sources or with an allow-list of types. More about Unsafe deserialization.

Is CVE-2021-21249 being exploited?

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

Sources

Also known as GHSA-7xhq-m2q9-6hpm.

Is CVE-2021-21249 in your software?

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

Check your SBOMs for free