CVE-2022-29810: Sensitive Information Insertion into Log File in Hashicorp go-getter

Summary

01/07/2022
Yes i
Moderate
5.5

CVE-2022-29810: Exposure of sensitive information via log file in github.com/hashicorp/go-getter. Affects github.com/hashicorp/go-getter versions < 1.5.11. Fixed in 1.5.11. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Hashicorp go-getter is a Go library that facilitates the retrieval of remote resources. It is commonly used for fetching dependencies and managing package versions in Go projects. The library provides a simple and efficient way to download files from various sources, including Git, Mercurial, and S3. However, versions prior to 1.5.11 suffer from a vulnerability that allows the insertion of sensitive information into the log file. This vulnerability can potentially expose SSH credentials to local users who have access to the log file.

Vulnerability Detail

The vulnerability in Hashicorp go-getter arises from the improper handling of SSH credentials. When performing certain operations, the library writes SSH credentials to its log file without proper protection. This means that any local user with read access to the log file can potentially obtain sensitive SSH credentials. The impact of this vulnerability depends on the context in which the library is used. If the log file is accessible to untrusted users, it can lead to unauthorized access to remote systems or compromise of sensitive data. The vulnerability has a CVSS score of 5.5, indicating a moderate severity level.

How To Fix

Minimum fixed version

1.5.11

This is the first release that contains the fix.

go get github.com/hashicorp/go-getter@v1.5.11

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, developers can manually modify the code to prevent the logging of SSH credentials. This can be achieved by modifying the logging configuration or implementing custom logging logic that excludes sensitive information. Here is an example of how to disable logging of SSH credentials in a Go application using the go-getter library:

import (
	"github.com/hashicorp/go-getter"
	"log"
)

func main() {
	// Disable logging of SSH credentials
	getter.Logger = log.New(ioutil.Discard, "", 0)

	// Rest of the application code
}

Conclusion

In conclusion, the Hashicorp go-getter library prior to version 1.5.11 is vulnerable to the insertion of sensitive information into the log file. This can expose SSH credentials to local users with access to the log file. To mitigate this vulnerability, it is recommended to upgrade to version 1.5.11 or later of the library. Developers can also implement a temporary workaround by disabling logging of SSH credentials. For further support and assistance in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for github.com/hashicorp/go-getter →

Share this vulnerability

FAQ

Hashicorp go-getter is a Go library that simplifies the retrieval of remote resources, such as dependencies and package versions, in Go projects.

The vulnerability allows local users with access to the log file to obtain sensitive SSH credentials, potentially leading to unauthorized access to remote systems or compromise of sensitive data.

The CVSS score of this vulnerability is 5.5, indicating a moderate severity level.

To fix this vulnerability, upgrade to version 1.5.11 or later of the Hashicorp go-getter library and ensure SSH credentials are not logged.

As a temporary workaround, developers can modify the code to disable logging of SSH credentials. Refer to the provided code example for more details.

Related vulnerabilities

Recent vulnerabilities recorded for github.com/hashicorp/go-getter.

How To Fix

Minimum fixed version

1.5.11

This is the first release that contains the fix.

go get github.com/hashicorp/go-getter@v1.5.11

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback