GHSA-6GXW-85Q2-Q646

Vulnerability from github – Published: 2025-11-25 14:18 – Updated: 2025-11-27 08:42
VLAI?
Summary
Grype has a credential disclosure vulnerability in its JSON output
Details

A credential disclosure vulnerability was found in Grype, affecting versions v0.68.0 through v0.104.0. If registry credentials are defined and the output of grype is written using the --file or --output json=<file> option, the registry credentials will be included unsanitized in the output file.

Impact

In Grype versions v0.68.0 through v0.104.0, when registry authentication is configured, those credentials can be incorrectly included in the output of a Grype scan (regardless of whether those credentials are actively being used for the current scan). Users that do not have registry authentication configured are not affected by this issue.

Registry credentials can be set via the Grype configuration file (e.g. registry.auth[].username, registry.auth[].password, registry.auth[].token) or environment variables (e.g., GRYPE_REGISTRY_AUTH_USERNAME, GRYPE_REGISTRY_AUTH_PASSWORD, GRYPE_REGISTRY_AUTH_TOKEN).

In order for the authentication details to be improperly included, the Grype file output format must be set to json with output target set to a file. For example --output json=file.json or --output json --file file.json. When these conditions are met, the configured credentials are not sanitized as they should be in the resulting JSON output file.

The authentication details could also be leaked via a malformed Grype Template. A Grype Template that includes the Descriptor.Registry.Auth fields would also include the unsanitized registry credentials. There are no known templates that include these fields.

Patches

The patch has been released in v0.104.1.

Workaround

Users running affected versions of grype can work around this vulnerability by redirecting stdout to a file instead of using the --file or --output options.

For example, replacing the command:

# using `--output json=path` (or `--file`) leaks credentials
grype --output json=test.json alpine:latest

with

# no use of `--output json=path` or `--file`. Output is sanitized...
grype --output json alpine:latest > test.json

...results in the same test.json output, but the credentials will be properly sanitized.

Resources

Patch pull request: https://github.com/anchore/grype/pull/3068

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "Go",
        "name": "github.com/anchore/grype"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0.68.0"
            },
            {
              "fixed": "0.104.1"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2025-65965"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-212"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2025-11-25T14:18:46Z",
    "nvd_published_at": "2025-11-25T20:16:00Z",
    "severity": "HIGH"
  },
  "details": "A credential disclosure vulnerability was found in Grype, affecting versions `v0.68.0` through `v0.104.0`. If registry credentials are defined and the output of grype is written using the `--file` or `--output json=\u003cfile\u003e` option, the registry credentials will be included unsanitized in the output file.\n\n## Impact\n\nIn Grype versions `v0.68.0` through `v0.104.0`, when registry authentication is configured, those credentials can be incorrectly included in the output of a Grype scan (regardless of whether those credentials are actively being used for the current scan). Users that do not have registry authentication configured are not affected by this issue.\n\nRegistry credentials can be set via the Grype configuration file (e.g. `registry.auth[].username`, `registry.auth[].password`, `registry.auth[].token`) or environment variables (e.g., `GRYPE_REGISTRY_AUTH_USERNAME`, `GRYPE_REGISTRY_AUTH_PASSWORD`, `GRYPE_REGISTRY_AUTH_TOKEN`).\n\nIn order for the authentication details to be improperly included, the Grype file output format must be set to `json` with output target set to a file. For example `--output json=file.json` or `--output json --file file.json`. When these conditions are met, the configured credentials are not sanitized as they should be in the resulting JSON output file.\n\nThe authentication details could also be leaked via a malformed Grype Template. A Grype Template that includes the `Descriptor.Registry.Auth` fields would also include the unsanitized registry credentials. There are no known templates that include these fields.\n\n## Patches\nThe patch has been released in `v0.104.1`.\n\n## Workaround\nUsers running affected versions of grype can work around this vulnerability by redirecting stdout to a file instead of using the `--file` or `--output` options.\n\nFor example, replacing the command:\n\n```\n# using `--output json=path` (or `--file`) leaks credentials\ngrype --output json=test.json alpine:latest\n```\n\nwith\n\n```\n# no use of `--output json=path` or `--file`. Output is sanitized...\ngrype --output json alpine:latest \u003e test.json\n```\n\n...results in the same `test.json` output, but the credentials will be properly sanitized.\n\n## Resources\nPatch pull request: https://github.com/anchore/grype/pull/3068",
  "id": "GHSA-6gxw-85q2-q646",
  "modified": "2025-11-27T08:42:37Z",
  "published": "2025-11-25T14:18:46Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/anchore/grype/security/advisories/GHSA-6gxw-85q2-q646"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2025-65965"
    },
    {
      "type": "WEB",
      "url": "https://github.com/anchore/grype/pull/3068"
    },
    {
      "type": "WEB",
      "url": "https://github.com/anchore/grype/commit/39f7fa17af2739cafe9b27176d4a68f7c05f21c1"
    },
    {
      "type": "WEB",
      "url": "https://github.com/anchore/grype/commit/c99f79de49a58dc16d7fd8f35160b169b87db9de"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/anchore/grype"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:H/SI:N/SA:N",
      "type": "CVSS_V4"
    }
  ],
  "summary": "Grype has a credential disclosure vulnerability in its JSON output"
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.


Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…