GHSA-6c87-g9pw-78fx: Github.com/edgelesssys/contrast Contrast's Imagepuller RegistryFor Uses Unanchored Vulnerability

LOW
CVSS 3.7
CWE-1289
Published
Advisory Summary

GHSA-6c87-g9pw-78fx is a LOW (CVSS 3.7) contrast's imagepuller registryfor uses unanchored vulnerability (CWE-1289: Improper Validation of Unsafe Equivalence in Input) affecting Github.com/edgelesssys/contrast libraries in the Go ecosystem. The issue involves contrast's imagepuller registryfor uses unanchored suffix matching, leaking auth credentials and trusted ca configuration to sibling-domain registries. Remediation is available by upgrading affected packages to version 1.21.0.

GHSA-6c87-g9pw-78fx at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-6c87-g9pw-78fx
Severity LOW
CVSS v3.1 Base Score 3.7
CWE Classification CWE-1289: Improper Validation of Unsafe Equivalence in Input
Affected Product Github.com/edgelesssys/contrast
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 3.7

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity None (I:N)
Availability None (A:N)

How to Fix GHSA-6c87-g9pw-78fx

To remediate this vulnerability, upgrade all affected Github.com/edgelesssys/contrast dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/edgelesssys/contrast fixed: 1.21.0
Upgrade github.com/edgelesssys/contrast to 1.21.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/edgelesssys/contrast

How to Check if You Are Affected

To determine whether your application is affected by GHSA-6c87-g9pw-78fx, inspect your project dependencies for Github.com/edgelesssys/contrast:

inspect dependencies for github.com/edgelesssys/contrast

Analyze the terminal output to locate any version of Github.com/edgelesssys/contrast in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.21.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & RFC 5280 Specification

Under RFC 5280 specifications for X.509 certificates, the Name Constraints extension defines a namespace within which all subsequent subject names in a certification path must be located. Constraints apply to various name forms including directory names, IP addresses, rfc822Name (email addresses), and uniformResourceIdentifier (URI) entries. Specifically, during certificate path validation, affected versions of Github.com/edgelesssys/contrast failed to properly normalize or enforce boundary checks when domain names contained trailing dot (.) characters. Because domain names with a trailing dot signify fully qualified domain names (FQDNs), this omission allowed non-conforming certificates to be improperly validated as compliant with the defined name constraints.

Source Advisory Statement

# Summary `Config.registryFor` selected a per-registry credential / CA / mirror block by checking `strings.HasSuffix(name, fqdn)` after stripping a single trailing dot.  The match has no boundary between the configured FQDN and any preceding characters in the request hostname. A registry configured as `[registries."ghcr.io."]` is therefore also applied to any image pulled from a host whose name happens to end in the literal byte sequence `ghcr.io`,  including attacker-registered domains such as `evilghcr.io.`  The imagepuller would then send the configured `Authorization` header (basic auth, registry token, or identity token), trust the configured custom CA bundle, follow the configured mirror, or honour `insecure-skip-verify`, on requests to that hostname. # Prerequisites For this to be applicable, an image or layer must be pulled from a "sibling" domain ending in one of the FQDNs configured in the imagepuller config. This may occur due to malicious intent or coincidentally. # Impact - Authentication header leaks to the sibling registry. - If `insecure-skip-verify` is set on an FQDN, TLS will also not be verified for the sibling registry. - Mirrors configured for an FQDN will also be used with the sibling registry. ## Not impacted Image integrity is **not** impacted. Image bytes remain pinned by digest in the policy and are validated after the pull. This advisory does not allow code substitution. # Workaround - If possible, configure explicit subdomains in the imagepuller config. A configuration for `[registries.".example.registry"]` is unaffected, only `[registries."example.registry"]` is potentially affected. - Audit images and layers configured in the deployment for the existence of sibling domains. # Patches After this patch, registry matches are determined by exact label equality instead of suffix matching. Each `.`-separated part of the FQDN must be an exact match with the corresponding label in the image reference. # Severity - `AV:N` because the leak is over the network to a registry under the attacker's control.  - `AC:H` because exploitation requires the operator to have configured a registry FQDN without a leading `.` AND the attacker to control a sibling-suffix domain that the deployment will pull from. - `PR:N` for the eventual recipient.  - `S:U` because impact stays in the imagepuller.  - `C:L` for credential leak (no integrity / availability impact).

GHSA-6c87-g9pw-78fx Affected Github.com/edgelesssys/contrast Versions

1 component(s)
Fixed Versions:
1.21.0
Product / Package Ecosystem Affected Versions Fixed Version
github.com/edgelesssys/contrast
Go
< 1.21.0
1.21.0

References

Frequently Asked Questions

What is GHSA-6c87-g9pw-78fx?
GHSA-6c87-g9pw-78fx is a security vulnerability in Github.com/edgelesssys/contrast involving Contrast's Imagepuller registryFor uses unanchored suffix matching, leaking auth credentials and trusted CA configuration to sibling-domain registries under CWE-1289: Improper Validation of Unsafe Equivalence in Input.
Which Github.com/edgelesssys/contrast versions are affected?
Affected versions include releases prior to 1.21.0 across affected packages: github.com/edgelesssys/contrast.
What version fixes GHSA-6c87-g9pw-78fx?
Upgrading to 1.21.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/edgelesssys/contrast affected?
Yes, github.com/edgelesssys/contrast is affected in releases prior to 1.21.0. Upgrade your dependency to 1.21.0 or later.
What is the CVSS score of GHSA-6c87-g9pw-78fx?
GHSA-6c87-g9pw-78fx has a CVSS v3.1 base score of 3.7 (LOW) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N.
What CWE is associated with GHSA-6c87-g9pw-78fx?
GHSA-6c87-g9pw-78fx is classified under CWE-1289: Improper Validation of Unsafe Equivalence in Input (The product receives an input value that is used as a resource identifier or other type of reference, but it does not validate or incorrectly validates that the input is equivalent to a potentially-unsafe value.).
How can I check Go dependencies for GHSA-6c87-g9pw-78fx?
Run the dependency tree command: 'inspect dependencies for github.com/edgelesssys/contrast'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-6c87-g9pw-78fx",
  "modified" : "2026-07-01T18:43:56Z",
  "published" : "2026-07-01T18:43:55Z",
  "aliases" : [ ],
  "summary" : "Contrast's Imagepuller registryFor uses unanchored suffix matching, leaking auth credentials and trusted CA configuration to sibling-domain registries",
  "details" : "# Summary\n\n`Config.registryFor` selected a per-registry credential / CA / mirror block by checking `strings.HasSuffix(name, fqdn)` after stripping a single trailing dot. \nThe match has no boundary between the configured FQDN and any preceding characters in the request hostname.\nA registry configured as `[registries.\"ghcr.io.\"]` is therefore also applied to any image pulled from a host whose name happens to end in the literal byte sequence `ghcr.io`, \nincluding attacker-registered domains such as `evilghcr.io.` \nThe imagepuller would then send the configured `Authorization` header (basic auth, registry token, or identity token), trust the configured custom CA bundle,\nfollow the configured mirror, or honour `insecure-skip-verify`, on requests to that hostname.\n\n# Prerequisites\n\nFor this to be applicable, an image or layer must be pulled from a \"sibling\" domain ending in one of the FQDNs configured in the imagepuller config.\nThis may occur due to malicious intent or coincidentally.\n\n# Impact\n\n- Authentication header leaks to the sibling registry.\n- If `insecure-skip-verify` is set on an FQDN, TLS will also not be verified for the sibling registry.\n- Mirrors configured for an FQDN will also be used with the sibling registry.\n\n## Not impacted\n\nImage integrity is **not** impacted. Image bytes remain pinned by digest in the policy and are validated after the pull.\nThis advisory does not allow code substitution.\n\n# Workaround\n\n- If possible, configure explicit subdomains in the imagepuller config. A configuration for `[registries.\".example.registry\"]` is unaffected, only `[registries.\"example.registry\"]` is potentially affected.\n- Audit images and layers configured in the deployment for the existence of sibling domains.\n\n# Patches\n\nAfter this patch, registry matches are determined by exact label equality instead of suffix matching.\nEach `.`-separated part of the FQDN must be an exact match with the corresponding label in the image reference.\n\n# Severity\n\n- `AV:N` because the leak is over the network to a registry under the attacker's control. \n- `AC:H` because exploitation requires the operator to have configured a registry FQDN without a leading `.` AND the attacker to control a sibling-suffix domain that the deployment will pull from.\n- `PR:N` for the eventual recipient. \n- `S:U` because impact stays in the imagepuller. \n- `C:L` for credential leak (no integrity / availability impact).",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/edgelesssys/contrast"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.21.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.20.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/edgelesssys/contrast/security/advisories/GHSA-6c87-g9pw-78fx"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/edgelesssys/contrast/commit/10826b1d82613025767fb094e8aa51a7dcfbd2a1"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/edgelesssys/contrast"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/edgelesssys/contrast/releases/tag/v1.21.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1289" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-01T18:43:55Z",
    "nvd_published_at" : null
  }
}