fix(image): don't reject remote images whose ArtifactType is just a config media type - #65
Merged
Bit-Doctor merged 1 commit intoJul 17, 2026
Conversation
…onfig media type
go-containerregistry sets Descriptor.ArtifactType to the manifest's config
media type whenever the manifest itself has no explicit `artifactType` field.
This is the case for essentially all plain, single-architecture image
manifests fetched directly (as opposed to a multi-arch manifest list/index,
which has no config field and so leaves ArtifactType empty).
The check added to reject non-image OCI artifacts (Helm charts, WASM
modules, etc.) in the remote image source didn't account for this, causing
single-arch images pulled via the remote fallback to fail with:
remote error: unsupported artifact type "application/vnd.docker.container.image.v1+json" for image "..."
Backported from upstream aquasecurity/trivy (fixed as of v0.72.0, alongside
a go-containerregistry bump that isn't needed here since IsConfig() is
already available in the go-containerregistry version this fork depends on).
Co-authored-by: Cursor <cursoragent@cursor.com>
diogocp
approved these changes
Jul 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Backports the fix from upstream aquasecurity/trivy (present as of v0.72.0, commit 3ea80c0) using the
IsConfig()helper already available in this fork's go-containerregistry version -- no dependency bump required.Single-architecture image manifests (i.e. a tag resolving directly to an image manifest rather than a multi-arch manifest list/index) have a
Configfield. When the manifest has no explicitartifactType, go-containerregistry falls back to settingDescriptor.ArtifactTypeto the config's media type (e.g.application/vnd.docker.container.image.v1+json).tryRemote's check for non-image OCI artifacts (Helm charts, WASM modules, etc.) didn't account for this, so plain single-arch images pulled via theremoteimage source fallback were incorrectly rejected with:This was hit by a datadog-security-cli customer scanning an ECR image directly (no local Docker/containerd/podman available), and reproduces for any single-arch image pulled via the remote fallback.
Test plan
regular image with explicit docker config media type) toTest_tryRemotehelm chart config media typerejection test still passes (no regression on the original intent of the check)Links
Made with Cursor