CVE-2021-21249
JSON

9.6critical

Post-Auth Unsafe Yaml deserialization

Severity
9.6critical CVSS:3.1 by GitHub_M
Exploit likelihood
3.06% (higher than 87% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M

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

Affected

Product or packageVersionsReported by
theonedev onedev< 4.0.3CVE List
onedev_project onedevbefore 4.0.3NVD

All scores

GitHub_M9.6critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N
NVD8.8high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
NVD6.5medium CVSS:2.0AV:N/AC:L/Au:S/C:P/I:P/A:P

Classification

What each source says

CVE List

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

NVD (es)

OneDev es una plataforma devops todo en uno.&#xa0;En OneDev versiones anteriores a 4.0.3, Se presenta un problema relacionado con el análisis de YAML que puede conllevar a una ejecución de código remota posterior a la autenticación.&#xa0;Para analizar y procesar archivos YAML, OneDev usa SnakeYaml que por defecto (cuando no usa "SafeConstructor") permite la instanciación de clases arbitrarias.&#xa0;Podemos aprovechar eso para ejecutar código arbitrario creando instancias de clases como "javax.script.ScriptEngineManager" y usando "URLClassLoader" para cargar el proveedor del motor de script, resultando en la instanciación de una clase controlada por el usuario.&#xa0;Para obtener un ejemplo completo, consulte la GHSA referenciada.&#xa0;Este problema fue abordado en la versión 4.0.3, al permitir que determinadas clases conocidas sean deserializadas

References

Sources

SourceRecordLicence
CVE ListCVE-2021-21249 changed 2024-08-03CVE Terms of Use
NVDCVE-2021-21249 changed 2026-06-17Public domain