{"id":"CVE-2021-21249","published":"2021-01-15T20:10:31Z","modified":"2024-08-03T18:09:15Z","title":"Post-Auth Unsafe Yaml deserialization","vendor":"theonedev","product":"onedev","tier":"tail","description":{"text":"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","provenance":"source","from":"CVE.org"},"cvss":{"score":9.6,"severity":"CRITICAL","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.03059,"percentile":0.87554,"provenance":"source"},"cwes":[{"id":"CWE-74","name":"Improper Neutralization of Special Elements in Output Used by a Downstream Component"}],"references":[{"url":"https://github.com/theonedev/onedev/security/advisories/GHSA-7xhq-m2q9-6hpm","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/theonedev/onedev/commit/d6fc4212b1ac1e9bbe3ce444e95f9af1e3ab8b66","tags":["x_refsource_MISC"]}],"priority":{"score":24.2,"factors":[{"name":"EPSS percentile","points":17.51},{"name":"CVSS severity","points":6.72}]},"vendorSlug":"theonedev","affectedVersions":[{"vendor":"theonedev","product":"onedev","versions":["< 4.0.3"]}],"euvd":{"id":"EUVD-2021-8632","exploited":false,"provenance":"source"}}