VYPR
High severityNVD Advisory· Published Mar 25, 2022· Updated Apr 22, 2025

Incorrect Authorization in imgcrypt

CVE-2022-24778

Description

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 used 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.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
github.com/containerd/imgcryptGo
< 1.1.41.1.4

Affected products

1

Patches

1
6fdd9818a4d8

images: Add list of Platforms to CheckAuthorization()

https://github.com/containerd/imgcryptStefan BergerMar 17, 2022via ghsa
1 file changed · +13 0
  • images/encryption/encryption.go+13 0 modified
    @@ -50,6 +50,13 @@ const (
     // LayerFilter allows to select Layers by certain criteria
     type LayerFilter func(desc ocispec.Descriptor) bool
     
    +// isLocalPlatform determines whether the given platform matches the local one
    +func isLocalPlatform(platform *ocispec.Platform) bool {
    +	matcher := platforms.NewMatcher(*platform)
    +
    +	return matcher.Match(platforms.DefaultSpec())
    +}
    +
     // IsEncryptedDiff returns true if mediaType is a known encrypted media type.
     func IsEncryptedDiff(ctx context.Context, mediaType string) bool {
     	switch mediaType {
    @@ -380,6 +387,9 @@ func cryptManifestList(ctx context.Context, cs content.Store, desc ocispec.Descr
     	var newManifests []ocispec.Descriptor
     	modified := false
     	for _, manifest := range index.Manifests {
    +		if cryptoOp == cryptoOpUnwrapOnly && !isLocalPlatform(manifest.Platform) {
    +			continue
    +		}
     		newManifest, m, err := cryptChildren(ctx, cs, manifest, cc, lf, cryptoOp, manifest.Platform)
     		if err != nil || cryptoOp == cryptoOpUnwrapOnly {
     			return ocispec.Descriptor{}, false, err
    @@ -389,6 +399,9 @@ func cryptManifestList(ctx context.Context, cs content.Store, desc ocispec.Descr
     		}
     		newManifests = append(newManifests, newManifest)
     	}
    +	if cryptoOp == cryptoOpUnwrapOnly {
    +		return ocispec.Descriptor{}, false, fmt.Errorf("No manifest found for local platform")
    +	}
     
     	if modified {
     		// we need to update the index
    

Vulnerability mechanics

Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

13

News mentions

0

No linked articles in our index yet.