Bug 2069368 (CVE-2022-24778)

Summary: CVE-2022-24778 imgcrypt: Unauthorized access to encryted container image on a shared system due to missing check in CheckAuthorization() code path
Product: [Other] Security Response Reporter: Pedro Sampaio <psampaio>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: unspecifiedCC: adam.kaplan, agarcial, amuller, anpicker, aos-bugs, bbennett, bmontgom, bthurber, dymurray, eglynn, eparis, erooth, go-sig, gparvin, jburrell, jerzhang, jhadvig, jjoyce, jmatthew, jokerman, jramanat, lhh, maszulik, mburns, mfojtik, njean, nstielau, pahickey, pbhattac, rhos-maint, spandura, spasquie, sponnaga, spower, stcannon, vkumar, whayutin, zebob.m
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: imgcrypt 1.1.4 Doc Type: If docs needed, set a value
Doc Text:
A flaw was found in the imgcrypt library when checking the keys of an authorized user to access an encrypted image on systems where layers are not available and cannot run on the host architecture. This flaw allows an attacker to run an image without providing the previously decrypted keys.
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-06-09 04:51:25 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2070932, 2069369, 2069502, 2069508, 2069509, 2069510, 2069511, 2069512, 2069513, 2069514, 2069515, 2069516, 2069517, 2069518, 2069519, 2069520, 2069521, 2069522, 2069523, 2069524, 2070933, 2070934, 2070935, 2070937, 2070938, 2070939    
Bug Blocks: 2069372    

Description Pedro Sampaio 2022-03-28 19:23:23 UTC
The imgcrypt library provides API exensions for containerd to support encrypted container images and implements the ctd-decoder command line tool for use by containerd to decrypt encrypted container images. The imgcrypt function `CheckAuthorization` is supposed to check whether the current user is authorized to access an encrypted image and prevent the user from running an image that another user previously decrypted on the same system. In versions prior to 1.1.4, a failure occurs when an image with a ManifestList is used and the architecture of the local host is not the first one in the ManifestList. Only the first architecture in the list was tested, which may not have its layers available locally since it could not be run on the host architecture. Therefore, the verdict on unavailable layers was that the image could be run anticipating that image run failure would occur later due to the layers not being available. However, this verdict to allow the image to run enabled other architectures in the ManifestList to run an image without providing keys if that image had previously been decrypted. A patch has been applied to imgcrypt 1.1.4. Workarounds may include usage of different namespaces for each remote user.

https://github.com/containerd/imgcrypt/releases/tag/v1.1.4
https://github.com/containerd/imgcrypt/security/advisories/GHSA-8v99-48m9-c8pm
https://github.com/containerd/imgcrypt/issues/69
https://github.com/containerd/imgcrypt/commit/6fdd9818a4d8142107b7ecd767d839c9707700d9

Comment 1 Pedro Sampaio 2022-03-28 19:23:41 UTC
Created golang-github-containerd-imgcrypt tracking bugs for this issue:

Affects: fedora-all [bug 2069369]

Comment 7 errata-xmlrpc 2022-04-20 23:46:42 UTC
This issue has been addressed in the following products:

  Red Hat Advanced Cluster Management for Kubernetes 2.4 for RHEL 8

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

Comment 8 errata-xmlrpc 2022-06-09 02:06:44 UTC
This issue has been addressed in the following products:

  Red Hat Advanced Cluster Management for Kubernetes 2.5 for RHEL 8

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

Comment 9 Product Security DevOps Team 2022-06-09 04:51:21 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-24778

Comment 12 errata-xmlrpc 2022-12-06 14:02:13 UTC
This issue has been addressed in the following products:

  RHACS-3.73-RHEL-8

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