CVE-2021-21251
JSON

7.7high

ZipSlip Arbitrary File Upload

Severity
7.7high CVSS:3.1 by GitHub_M
Exploit likelihood
11.3% (higher than 96% 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 a critical "zip slip" vulnerability. This issue may lead to arbitrary file write. The KubernetesResource REST endpoint untars user controlled data from the request body using TarUtils. TarUtils is a custom library method leveraging Apache Commons Compress. During the untar process, there are no checks in place to prevent an untarred file from traversing the file system and overriding an existing file. For a successful exploitation, the attacker requires a valid __JobToken__ which may not be possible to get without using any of the other reported vulnerabilities. But this should be considered a vulnerability in `io.onedev.commons.utils.TarUtils` since it lives in a different artifact and can affect other projects using it. This issue was addressed in 4.0.3 by validating paths in tar archive to only allow them to be in specified folder when extracted.

Affected

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

All scores

GitHub_M7.7high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/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 a critical "zip slip" vulnerability. This issue may lead to arbitrary file write. The KubernetesResource REST endpoint untars user controlled data from the request body using TarUtils. TarUtils is a custom library method leveraging Apache Commons Compress. During the untar process, there are no checks in place to prevent an untarred file from traversing the file system and overriding an existing file. For a successful exploitation, the attacker requires a valid __JobToken__ which may not be possible to get without using any of the other reported vulnerabilities. But this should be considered a vulnerability in `io.onedev.commons.utils.TarUtils` since it lives in a different artifact and can affect other projects using it. This issue was addressed in 4.0.3 by validating paths in tar archive to only allow them to be in specified folder when extracted.

NVD (es)

OneDev es una plataforma devops todo en uno.&#xa0;En OneDev versiones anteriores a 4.0.3, se presenta una vulnerabilidad crítica de "zip slip".&#xa0;Este problema puede conllevar a una escritura de archivo arbitraria.&#xa0;El endpoint REST KubernetesResource deshace los datos controlados por el usuario desde el cuerpo de la petición usando TarUtils.&#xa0;TarUtils es un método de biblioteca personalizado que aprovecha Apache Commons Compress.&#xa0;Durante el proceso untar, no existen comprobaciones para impedir que un archivo sin clasificar atraviese el sistema de archivos y anular un archivo existente.&#xa0;Para una explotación con éxito, el atacante requiere un __JobToken__ válido que puede que no sea posible obtener sin usar ninguna de las otras vulnerabilidades reportadas.&#xa0;Pero esto debería considerarse una vulnerabilidad en "io.onedev.commons.utils.TarUtils" ya que vive en un artefacto diferente y puede afectar a otros proyectos que lo usen.&#xa0;Este problema es corregido en la versión 4.0

References

Sources

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