Bug 2066840 (CVE-2022-27651) - CVE-2022-27651 buildah: Default inheritable capabilities for linux container should be empty
Summary: CVE-2022-27651 buildah: Default inheritable capabilities for linux container ...
Keywords:
Status: CLOSED ERRATA
Alias: CVE-2022-27651
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 2067532 2067533 2067534 2067535 2067537 2067538 2067539 2067540 2067541 2067542 2067543 2067544 2067545 2067546 2067547 2067548 2067549 2067550 2067551 2067553 2067554 2067555 2067556 2067557 2067558 2067559 2067560 2070114 2070115
Blocks: 2064591 2070127
TreeView+ depends on / blocked
 
Reported: 2022-03-22 15:20 UTC by Pedro Sampaio
Modified: 2022-12-06 14:33 UTC (History)
21 users (show)

Fixed In Version: buildah 1.25.0
Doc Type: If docs needed, set a value
Doc Text:
A flaw was found in buildah, where containers were incorrectly started with non-empty default permissions. A bug was found in Moby (Docker Engine) where containers were incorrectly started with non-empty inheritable Linux process capabilities. This flaw allows an attacker with access to programs with inheritable file capabilities to elevate those capabilities to the permitted set when execve(2) runs.
Clone Of:
Environment:
Last Closed: 2022-12-06 14:33:46 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2022:2176 0 None None None 2022-05-11 01:09:29 UTC
Red Hat Product Errata RHBA-2022:4920 0 None None None 2022-06-06 21:58:29 UTC
Red Hat Product Errata RHSA-2022:1407 0 None None None 2022-04-19 15:35:57 UTC
Red Hat Product Errata RHSA-2022:1565 0 None None None 2022-04-26 17:33:43 UTC
Red Hat Product Errata RHSA-2022:1566 0 None None None 2022-04-26 17:34:03 UTC
Red Hat Product Errata RHSA-2022:1762 0 None None None 2022-05-10 13:18:10 UTC
Red Hat Product Errata RHSA-2022:4651 0 None None None 2022-05-18 13:57:10 UTC
Red Hat Product Errata RHSA-2022:4816 0 None None None 2022-05-31 12:15:03 UTC

Description Pedro Sampaio 2022-03-22 15:20:59 UTC
A bug was found in Moby (Docker Engine) 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.

Patches
This bug has been fixed in Moby (Docker Engine) 20.10.14. Users should update to this version as soon as possible. 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. Refer to capabilities(7) for a description of how capabilities work. Note that permitted file capabilities continue to allow for privileges to be raised up to the container's bounding set and that processes may add capabilities to their own inheritable set up to the container's bounding set per the rules described in the manual page. In all cases the container's bounding set provides an upper bound on the capabilities that can be assumed and provides for the container security sandbox.

Workarounds
The entrypoint of a container can be modified to use a utility like capsh(1) to drop inheritable capabilities prior to the primary process starting.

Comment 6 Avinash Hanwate 2022-03-30 12:39:19 UTC
Created buildah tracking bugs for this issue:

Affects: fedora-all [bug 2070114]

Comment 10 errata-xmlrpc 2022-04-19 15:35:54 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8.4 Extended Update Support

Via RHSA-2022:1407 https://access.redhat.com/errata/RHSA-2022:1407

Comment 11 errata-xmlrpc 2022-04-26 17:33:40 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2022:1565 https://access.redhat.com/errata/RHSA-2022:1565

Comment 12 errata-xmlrpc 2022-04-26 17:34:00 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2022:1566 https://access.redhat.com/errata/RHSA-2022:1566

Comment 15 errata-xmlrpc 2022-05-10 13:18:07 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2022:1762 https://access.redhat.com/errata/RHSA-2022:1762

Comment 16 errata-xmlrpc 2022-05-18 13:57:07 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8.2 Extended Update Support

Via RHSA-2022:4651 https://access.redhat.com/errata/RHSA-2022:4651

Comment 17 errata-xmlrpc 2022-05-31 12:15:00 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8.4 Extended Update Support

Via RHSA-2022:4816 https://access.redhat.com/errata/RHSA-2022:4816

Comment 18 Product Security DevOps Team 2022-12-06 14:33:43 UTC
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s):

https://access.redhat.com/security/cve/cve-2022-27651


Note You need to log in before you can comment on or make changes to this bug.