CVE-2024-23840: Github.com/goreleaser/goreleaser `goreleaser Release --debug` Shows Secrets Vulnerability

MODERATE
Advisory Identifier: GHSA-h3q2-8whx-c29h
CVSS 5.5
CWE-532
Published
Advisory Summary

CVE-2024-23840 is a MODERATE (CVSS 5.5) `goreleaser release --debug` shows secrets vulnerability (CWE-532: Insertion of Sensitive Information into Log File) affecting Github.com/goreleaser/goreleaser libraries in the Go ecosystem. The issue involves `goreleaser release --debug` shows secrets. Remediation is available by upgrading affected packages to version 1.24.0.

CVE-2024-23840 at a Glance

CVE Identifier CVE-2024-23840
GHSA Identifier GHSA-h3q2-8whx-c29h
Severity MODERATE
CVSS v3.1 Base Score 5.5
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: 5.5

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

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

How to Fix CVE-2024-23840

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.24.0
Upgrade github.com/goreleaser/goreleaser to 1.24.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/goreleaser/goreleaser

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-23840, 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.24.0), 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 Hello 👋 `goreleaser release --debug` log shows secret values used in the in the custom publisher. How to reproduce the issue: - Define a custom publisher as the one below. Make sure to provide a custom script to the `cmd` field and to provide a secret to `env` ``` #.goreleaser.yml publishers: - name: my-publisher # IDs of the artifacts we want to sign ids: - linux_archives - linux_package cmd: "./build/package/linux_notarize.sh" env: - VERSION={{ .Version }} - SECRET_1={{.Env.SECRET_1}} - SECRET_2={{.Env.SECRET_2}} ``` - run `goreleaser release --debug` You should see your secret value in the gorelease log. The log shows also the `GITHUB_TOKEN` Example: ``` running cmd= .... SECRET_1=secret_value ```

CVE-2024-23840 Affected Github.com/goreleaser/goreleaser Versions

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

References

Frequently Asked Questions

What is CVE-2024-23840?
CVE-2024-23840 is a security vulnerability in Github.com/goreleaser/goreleaser involving `goreleaser release --debug` shows secrets 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.24.0 across affected packages: github.com/goreleaser/goreleaser.
What version fixes CVE-2024-23840?
Upgrading to 1.24.0 (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.24.0. Upgrade your dependency to 1.24.0 or later.
What is the CVSS score of CVE-2024-23840?
CVE-2024-23840 has a CVSS v3.1 base score of 5.5 (MODERATE) with vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2024-23840?
CVE-2024-23840 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 CVE-2024-23840?
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-h3q2-8whx-c29h",
  "modified" : "2024-03-04T18:45:24Z",
  "published" : "2024-01-30T20:57:52Z",
  "aliases" : [ "CVE-2024-23840" ],
  "summary" : "`goreleaser release --debug` shows secrets",
  "details" : "### Summary\nHello 👋 \n\n`goreleaser release --debug` log shows secret values used in the in the custom publisher.\n\n\nHow to reproduce the issue:\n\n- Define a custom publisher as the one below. Make sure to provide a custom script to the `cmd` field and to provide a secret to `env` \n\n```\n#.goreleaser.yml \npublishers:\n  - name: my-publisher\n  # IDs of the artifacts we want to sign\n    ids:\n      - linux_archives\n      - linux_package\n    cmd: \"./build/package/linux_notarize.sh\"\n    env:\n      - VERSION={{ .Version }}\n      - SECRET_1={{.Env.SECRET_1}}\n      - SECRET_2={{.Env.SECRET_2}}\n```\n\n- run `goreleaser release --debug`\n\nYou should see your secret value in the gorelease log. The log shows also the `GITHUB_TOKEN`\n\nExample:\n\n```\nrunning                                        cmd= ....\nSECRET_1=secret_value\n```\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:L/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.23.0"
      }, {
        "fixed" : "1.24.0"
      } ]
    } ],
    "versions" : [ "1.23.0" ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/goreleaser/goreleaser/security/advisories/GHSA-h3q2-8whx-c29h"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-23840"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/goreleaser/goreleaser/commit/d5b6a533ca1dc3366983d5d31ee2d2b6232b83c0"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/goreleaser/goreleaser"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-532" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-01-30T20:57:52Z",
    "nvd_published_at" : "2024-01-30T17:15:11Z"
  }
}