Bug 13308

Summary: [CVE 21] runc 1.0.2 CVEs found
Product: [ROSA-based products] ROSA Fresh Reporter: Yury <y.tumanov>
Component: System (kernel, glibc, systemd, bash, PAM...)Assignee: ROSA Linux Bugs <bugs>
Status: VERIFIED FIXED QA Contact: ROSA Linux Bugs <bugs>
Severity: normal    
Priority: Normal CC: a.proklov, m.novosyolov, pastordidi, s.matveev, survolog, v.potapov, y.tumanov
Version: AllFlags: v.potapov: qa_verified+
y.tumanov: secteam_verified+
a.proklov: published+
Target Milestone: ---   
Hardware: All   
OS: Linux   
URL: CVE-2021-43784, CVE-2022-24769, CVE-2022-29162, CVE-2023-25809, CVE-2023-27561, CVE-2023-28642,
Whiteboard:
Platform: 2021.1 ROSA Vulnerability identifier:
RPM Package: ISO-related:
Bad POT generating: Upstream:
Attachments: run1.png
rr1.png

Description Yury 2023-05-03 18:02:26 MSK
Please patch CVEs for package runc version 1.0.2
  
INFO (CVEs are): runc 1.0.2
 cves found
CVE-2021-43784
Desc: runc is a CLI tool for spawning and running containers on Linux according to the OCI specification. In runc, netlink is used internally as a serialization system for specifying the relevant container configuration to the `C` portion of the code (responsible for the based namespace setup of containers). In all versions of runc prior to 1.0.3, the encoder did not handle the possibility of an integer overflow in the 16-bit length field for the byte array attribute type, meaning that a large enough malicious byte array attribute could result in the length overflowing and the attribute contents being parsed as netlink messages for container configuration. This vulnerability requires the attacker to have some control over the configuration of the container and would allow the attacker to bypass the namespace restrictions of the container by simply adding their own netlink payload which disables all namespaces. The main users impacted are those who allow untrusted images with untrusted configurations to run on their machines (such as with shared cloud infrastructure). runc version 1.0.3 contains a fix for this bug. As a workaround, one may try disallowing untrusted namespace paths from your container. It should be noted that untrusted namespace paths would allow the attacker to disable namespace protections entirely even in the absence of this bug.
Link: https://nvd.nist.gov/vuln/detail/CVE-2021-43784
Severity: MEDIUM
CVE-2022-24769
Desc: Moby is an open-source project created by Docker to enable and accelerate software containerization. A bug was found in Moby (Docker Engine) prior to version 20.10.14 where containers were incorrectly started with non-empty inheritable Linux process capabilities, creating an atypical Linux environment and enabling programs with inheritable file capabilities to elevate those capabilities to the permitted set during `execve(2)`. Normally, when executable programs have specified permitted file capabilities, otherwise unprivileged users and processes can execute those programs and gain the specified file capabilities up to the bounding set. Due to this bug, containers which included executable programs with inheritable file capabilities allowed otherwise unprivileged users and processes to additionally gain these inheritable file capabilities up to the container's bounding set. Containers which use Linux users and groups to perform privilege separation inside the container are most directly impacted. This bug did not affect the container security sandbox as the inheritable set never contained more capabilities than were included in the container's bounding set. This bug has been fixed in Moby (Docker Engine) 20.10.14. Running containers should be stopped, deleted, and recreated for the inheritable capabilities to be reset. This fix changes Moby (Docker Engine) behavior such that containers are started with a more typical Linux environment. As a workaround, the entry point of a container can be modified to use a utility like `capsh(1)` to drop inheritable capabilities prior to the primary process starting.
Link: https://nvd.nist.gov/vuln/detail/CVE-2022-24769
Severity: MEDIUM
CVE-2022-29162
Desc: runc is a CLI tool for spawning and running containers on Linux according to the OCI specification. A bug was found in runc prior to version 1.1.2 where `runc exec --cap` created processes with non-empty inheritable Linux process capabilities, creating an atypical Linux environment and enabling programs with inheritable file capabilities to elevate those capabilities to the permitted set during execve(2). This bug did not affect the container security sandbox as the inheritable set never contained more capabilities than were included in the container's bounding set. This bug has been fixed in runc 1.1.2. This fix changes `runc exec --cap` behavior such that the additional capabilities granted to the process being executed (as specified via `--cap` arguments) do not include inheritable capabilities. In addition, `runc spec` is changed to not set any inheritable capabilities in the created example OCI spec (`config.json`) file.
Link: https://nvd.nist.gov/vuln/detail/CVE-2022-29162
Severity: HIGH
CVE-2023-25809
Desc: runc is a CLI tool for spawning and running containers according to the OCI specification. In affected versions it was found that rootless runc makes `/sys/fs/cgroup` writable in following conditons: 1. when runc is executed inside the user namespace, and the `config.json` does not specify the cgroup namespace to be unshared (e.g.., `(docker|podman|nerdctl) run --cgroupns=host`, with Rootless Docker/Podman/nerdctl) or 2. when runc is executed outside the user namespace, and `/sys` is mounted with `rbind, ro` (e.g., `runc spec --rootless`; this condition is very rare). A container may gain the write access to user-owned cgroup hierarchy `/sys/fs/cgroup/user.slice/...` on the host . Other users's cgroup hierarchies are not affected. Users are advised to upgrade to version 1.1.5. Users unable to upgrade may unshare the cgroup namespace (`(docker|podman|nerdctl) run --cgroupns=private)`. This is the default behavior of Docker/Podman/nerdctl on cgroup v2 hosts. or add `/sys/fs/cgroup` to `maskedPaths`.
Link: https://nvd.nist.gov/vuln/detail/CVE-2023-25809
Severity: MEDIUM
CVE-2023-27561
Desc: runc through 1.1.4 has Incorrect Access Control leading to Escalation of Privileges, related to libcontainer/rootfs_linux.go. To exploit this, an attacker must be able to spawn two containers with custom volume-mount configurations, and be able to run custom images. NOTE: this issue exists because of a CVE-2019-19921 regression.
Link: https://nvd.nist.gov/vuln/detail/CVE-2023-27561
Severity: HIGH
CVE-2023-28642
Desc: runc is a CLI tool for spawning and running containers according to the OCI specification. It was found that AppArmor can be bypassed when `/proc` inside the container is symlinked with a specific mount configuration. This issue has been fixed in runc version 1.1.5, by prohibiting symlinked `/proc`. See PR #3785 for details. users are advised to upgrade. Users unable to upgrade should avoid using an untrusted container image.
Link: https://nvd.nist.gov/vuln/detail/CVE-2023-28642
Severity: HIGH
Comment 1 Mikhail Novosyolov 2023-05-22 12:19:40 MSK
Полезно обновить runc, containerd, docker, podman
Comment 2 Aleksandr Proklov 2023-05-26 16:03:11 MSK
update runc	1.1.7-1

https://abf.io/build_lists/4445664
https://abf.io/build_lists/4445665
https://abf.io/build_lists/4445666
------------------------------------
update containerd	1.7.1-1

https://abf.io/build_lists/4445693
https://abf.io/build_lists/4445694
https://abf.io/build_lists/4445695

----------------------------------
Comment 4 Dmitry Postnikov 2023-05-26 18:49:36 MSK
dnf --refresh install runc
Выдает, что хочет поставить crun из Main

dnf --refresh install runc-1.1.7
Только так ставится.

containerd тянет crun, хотя по dnf repoquery --whatrequires runc показывает, что containerd должен его тянуть.

Это нормально?
Comment 5 Aleksandr Proklov 2023-05-27 03:58:58 MSK
Я незнаю насколько это нормально. Может Михаил исправит если нужно.

crun обновил из платформы 2023.1

crun	1.8.3-1

https://abf.io/build_lists/4446105
https://abf.io/build_lists/4446106
https://abf.io/build_lists/4446107
https://abf.io/build_lists/4446108
https://abf.io/build_lists/4446109
Comment 6 Dmitry Postnikov 2023-06-02 15:25:58 MSK
Created attachment 5907 [details]
run1.png

Пишу утстановку runc , пытается ставить crun.
Что-то тут не то.
Comment 7 Vladimir Potapov 2023-06-02 15:28:04 MSK
(In reply to Dmitry Postnikov from comment #6)
> Created attachment 5907 [details]
> run1.png
> 
> Пишу утстановку runc , пытается ставить crun.
> Что-то тут не то.
https://abf.io/import/crun/blob/rosa2023.1/crun.spec#lc-27
Comment 9 Dmitry Postnikov 2023-06-05 18:24:56 MSK
(In reply to Aleksandr from comment #2)
> update runc	1.1.7-1
> 
> https://abf.io/build_lists/4445664
> https://abf.io/build_lists/4445665
> https://abf.io/build_lists/4445666
> ------------------------------------
> update containerd	1.7.1-1
> 
> https://abf.io/build_lists/4445693
> https://abf.io/build_lists/4445694
> https://abf.io/build_lists/4445695
> 
> ----------------------------------

(In reply to Aleksandr from comment #3)
> docker	24.0.2-1
> 
> https://abf.io/build_lists/4445712
> https://abf.io/build_lists/4445713
> https://abf.io/build_lists/4445714
> 
> -----------------------------------
> 
> podman 4.5.0-1
> 
> https://abf.io/build_lists/4445717
> https://abf.io/build_lists/4445718
> https://abf.io/build_lists/4445719
> https://abf.io/build_lists/4445720

(In reply to Aleksandr from comment #8)
> crun	1.8.3-2
> 
> убрал Provides: runc
> 
> https://abf.io/build_lists/4471428
> https://abf.io/build_lists/4471429
> https://abf.io/build_lists/4471430
> https://abf.io/build_lists/4471431
> https://abf.io/build_lists/4471432

***************************
The update sent to testings
Comment 10 Vladimir Potapov 2023-06-06 10:31:07 MSK
(In reply to Aleksandr from comment #8)
> crun	1.8.3-2
> 
> убрал Provides: runc
> 
> https://abf.io/build_lists/4471428
> https://abf.io/build_lists/4471429
> https://abf.io/build_lists/4471430
> https://abf.io/build_lists/4471431
> https://abf.io/build_lists/4471432

еще конфликт бы добавить, иначе при установке двух сразу ошибка. Сурволог поймал при обновлении.
Comment 12 Dmitry Postnikov 2023-06-09 10:06:06 MSK
Ничего не изменилось. Так же ошибка при установке runc и crun вместе.
Comment 13 Vladimir Potapov 2023-06-09 10:13:10 MSK
(In reply to Dmitry Postnikov from comment #12)
> Ничего не изменилось. Так же ошибка при установке runc и crun вместе.
а при ошибке они из тестингов или из майна тянутся?
Comment 14 Dmitry Postnikov 2023-06-09 10:30:58 MSK
Created attachment 5913 [details]
rr1.png

А вот так выдается ошибка.
Comment 15 Grigorev Andrey 2023-06-10 17:45:39 MSK
Всё корректно. Между crun и runc стоит конфликт. У этих пакетов есть файл по одному и тому же пути. У одного это симлинк.
Очевидно, так было и раньше, но конфликт вписан не был.
Я проверял обновление поверх установленного podman.
Поведение раньше: обновление ломалось на упомянутом файле.
Поведение теперь: обновление проходит успешно.
Comment 16 Vladimir Potapov 2023-06-13 12:14:58 MSK
*************************************
The update sent ot testings
Comment 18 Yury 2023-07-04 17:33:34 MSK
Secteam approved