GHSA-f6mm-5fc7-3g3c: Github.com/goreleaser/goreleaser Goreleaser Shows Environment By Default Vulnerability

MODERATE
CVSS 6.2
CWE-532
Published
Advisory Summary

GHSA-f6mm-5fc7-3g3c is a MODERATE (CVSS 6.2) goreleaser shows environment by default vulnerability (CWE-532: Insertion of Sensitive Information into Log File) affecting Github.com/goreleaser/goreleaser libraries in the Go ecosystem. The issue involves goreleaser shows environment by default. Remediation is available by upgrading affected packages to version 1.26.1.

GHSA-f6mm-5fc7-3g3c at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-f6mm-5fc7-3g3c
Severity MODERATE
CVSS v3.1 Base Score 6.2
CWE Classification CWE-532: Insertion of Sensitive Information into Log File
Affected Product Github.com/goreleaser/goreleaser
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 6.2

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

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

How to Fix GHSA-f6mm-5fc7-3g3c

To remediate this vulnerability, upgrade all affected Github.com/goreleaser/goreleaser 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/goreleaser/goreleaser fixed: 1.26.1
Upgrade github.com/goreleaser/goreleaser to 1.26.1
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/goreleaser/goreleaser

How to Check if You Are Affected

To determine whether your application is affected by GHSA-f6mm-5fc7-3g3c, inspect your project dependencies for Github.com/goreleaser/goreleaser:

inspect dependencies for github.com/goreleaser/goreleaser

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

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-532: Insertion of Sensitive Information into Log File, where the product writes sensitive information to a log file. In Github.com/goreleaser/goreleaser, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary Since #4787 the log output is printed on the INFO level, while previously it was logged on DEBUG. This means if the `go build` output is non-empty, goreleaser leaks the environment. ### PoC * Create a Go project with dependencies, do not pull them yet (or run goreleaser later in a container, or delete `$GOPATH/pkg`). * Make sure to have secrets set in the environment * Make sure to not have `go mod tidy` in a before hook * Run `goreleaser release --clean` * Go prints lots of `go: downloading ...` lines, which triggers the "if output not empty, log it" line, which includes the environment. ### Impact Credentials and tokens are leaked.

GHSA-f6mm-5fc7-3g3c Affected Github.com/goreleaser/goreleaser Versions

1 component(s)
Fixed Versions:
1.26.1
Product / Package Ecosystem Affected Versions Fixed Version
github.com/goreleaser/goreleaser
Go
≥ 1.26.0
< 1.26.1
All 1 versions
1.26.0
1.26.1

References

Frequently Asked Questions

What is GHSA-f6mm-5fc7-3g3c?
GHSA-f6mm-5fc7-3g3c is a security vulnerability in Github.com/goreleaser/goreleaser involving goreleaser shows environment by default under CWE-532: Insertion of Sensitive Information into Log File.
Which Github.com/goreleaser/goreleaser versions are affected?
Affected versions include releases prior to 1.26.1 across affected packages: github.com/goreleaser/goreleaser.
What version fixes GHSA-f6mm-5fc7-3g3c?
Upgrading to 1.26.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/goreleaser/goreleaser affected?
Yes, github.com/goreleaser/goreleaser is affected in releases prior to 1.26.1. Upgrade your dependency to 1.26.1 or later.
What is the CVSS score of GHSA-f6mm-5fc7-3g3c?
GHSA-f6mm-5fc7-3g3c has a CVSS v3.1 base score of 6.2 (MODERATE) with vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with GHSA-f6mm-5fc7-3g3c?
GHSA-f6mm-5fc7-3g3c is classified under CWE-532: Insertion of Sensitive Information into Log File (The product writes sensitive information to a log file.).
How can I check Go dependencies for GHSA-f6mm-5fc7-3g3c?
Run the dependency tree command: 'inspect dependencies for github.com/goreleaser/goreleaser'. 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-f6mm-5fc7-3g3c",
  "modified" : "2024-05-15T17:17:10Z",
  "published" : "2024-05-15T17:17:10Z",
  "aliases" : [ ],
  "summary" : "goreleaser shows environment by default",
  "details" : "### Summary\nSince #4787 the log output is printed on the INFO level, while previously it was logged on DEBUG. This means if the `go build` output is non-empty, goreleaser leaks the environment.\n\n### PoC\n* Create a Go project with dependencies, do not pull them yet (or run goreleaser later in a container, or delete `$GOPATH/pkg`).\n* Make sure to have secrets set in the environment\n* Make sure to not have `go mod tidy` in a before hook\n* Run `goreleaser release --clean`\n* Go prints lots of `go: downloading ...` lines, which triggers the \"if output not empty, log it\" line, which includes the environment.\n\n### Impact\nCredentials and tokens are leaked.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/goreleaser/goreleaser"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.26.0"
      }, {
        "fixed" : "1.26.1"
      } ]
    } ],
    "versions" : [ "1.26.0" ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/goreleaser/goreleaser/security/advisories/GHSA-f6mm-5fc7-3g3c"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/goreleaser/goreleaser/pull/4787"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/goreleaser/goreleaser/commit/22f734e41f7a5111a031a3a4eb714c1b6aa6456b"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/goreleaser/goreleaser"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-532" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-05-15T17:17:10Z",
    "nvd_published_at" : null
  }
}