CVE-2023-34231: Github.com/snowflakedb/gosnowflake Snowflake Golang Driver Vulnerable To Vulnerability

HIGH
Advisory Identifier: GHSA-fwv2-65wh-2w8c
CVSS 7.3
CWE-77
Published
Advisory Summary

CVE-2023-34231 is a HIGH (CVSS 7.3) snowflake golang driver vulnerable to vulnerability (CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection')) affecting Github.com/snowflakedb/gosnowflake libraries in the Go ecosystem. The issue involves snowflake golang driver vulnerable to command injection. Remediation is available by upgrading affected packages to version 1.6.19.

CVE-2023-34231 at a Glance

CVE Identifier CVE-2023-34231
GHSA Identifier GHSA-fwv2-65wh-2w8c
Severity HIGH
CVSS v3.1 Base Score 7.3
CWE Classification CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection')
Affected Product Github.com/snowflakedb/gosnowflake
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 7.3

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

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

How to Fix CVE-2023-34231

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

How to Check if You Are Affected

To determine whether your application is affected by CVE-2023-34231, inspect your project dependencies for Github.com/snowflakedb/gosnowflake:

inspect dependencies for github.com/snowflakedb/gosnowflake

Analyze the terminal output to locate any version of Github.com/snowflakedb/gosnowflake in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.6.19), 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-77: Improper Neutralization of Special Elements used in a Command ('Command Injection'), where the product constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component. In Github.com/snowflakedb/gosnowflake, 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

### Issue Snowflake was informed via our bug bounty program of a command injection vulnerability in the Snowflake Golang driver via SSO browser URL authentication. ### Impacted driver package: gosnowflake ### Impacted version range: before [Version 1.6.19](https://community.snowflake.com/s/article/Go-Snowflake-Driver-Release-Notes) ### Attack Scenario In order to exploit the potential for command injection, an attacker would need to be successful in (1) establishing a malicious resource and (2) redirecting users to utilize the resource. The attacker could set up a malicious, publicly accessible server which responds to the SSO URL with an attack payload. If the attacker then tricked a user into visiting the maliciously crafted connection URL, the user’s local machine would render the malicious payload, leading to a remote code execution. This attack scenario can be mitigated through URL whitelisting as well as common anti-phishing resources. ### Solution On March 21, 2023, Snowflake merged a patch that fixed a command injection vulnerability in the Snowflake Golang driver via SSO browser URL authentication. The vulnerability affected the Snowflake Golang driver before Version 1.6.19. We strongly recommend users upgrade to Version 1.6.19 as soon as possible via the following resources: [Go Snowflake Driver](https://docs.snowflake.com/en/developer-guide/golang/go-driver) ### Additional Information If you discover a security vulnerability in one of our products or websites, please report the issue to HackerOne. For more information, please see our [Vulnerability Disclosure Policy](https://hackerone.com/snowflake?type=team).

CVE-2023-34231 Affected Github.com/snowflakedb/gosnowflake Versions

1 component(s)
Fixed Versions:
1.6.19
Product / Package Ecosystem Affected Versions Fixed Version
github.com/snowflakedb/gosnowflake
Go
< 1.6.19
1.6.19

References

Frequently Asked Questions

What is CVE-2023-34231?
CVE-2023-34231 is a security vulnerability in Github.com/snowflakedb/gosnowflake involving Snowflake Golang Driver vulnerable to Command Injection under CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection').
Which Github.com/snowflakedb/gosnowflake versions are affected?
Affected versions include releases prior to 1.6.19 across affected packages: github.com/snowflakedb/gosnowflake.
What version fixes CVE-2023-34231?
Upgrading to 1.6.19 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/snowflakedb/gosnowflake affected?
Yes, github.com/snowflakedb/gosnowflake is affected in releases prior to 1.6.19. Upgrade your dependency to 1.6.19 or later.
What is the CVSS score of CVE-2023-34231?
CVE-2023-34231 has a CVSS v3.1 base score of 7.3 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:N.
What CWE is associated with CVE-2023-34231?
CVE-2023-34231 is classified under CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection') (The product constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component.).
How can I check Go dependencies for CVE-2023-34231?
Run the dependency tree command: 'inspect dependencies for github.com/snowflakedb/gosnowflake'. 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-fwv2-65wh-2w8c",
  "modified" : "2023-06-09T22:53:25Z",
  "published" : "2023-06-09T22:53:25Z",
  "aliases" : [ "CVE-2023-34231" ],
  "summary" : "Snowflake Golang Driver vulnerable to Command Injection",
  "details" : "### Issue\nSnowflake was informed via our bug bounty program of a command injection vulnerability in the Snowflake Golang driver via SSO browser URL authentication.\n\n### Impacted driver package: \ngosnowflake\n\n### Impacted version range: \nbefore [Version 1.6.19](https://community.snowflake.com/s/article/Go-Snowflake-Driver-Release-Notes)\n\n### Attack Scenario\nIn order to exploit the potential for command injection, an attacker would need to be successful in (1) establishing a malicious resource and (2) redirecting users to utilize the resource. The attacker could set up a malicious, publicly accessible server which responds to the SSO URL with an attack payload. If the attacker then tricked a user into visiting the maliciously crafted connection URL, the user’s local machine would render the malicious payload, leading to a remote code execution. \n\nThis attack scenario can be mitigated through URL whitelisting as well as common anti-phishing resources.  \n\n### Solution\nOn March 21, 2023, Snowflake merged a patch that fixed a command injection vulnerability in the Snowflake Golang driver via SSO browser URL authentication. The vulnerability affected the Snowflake Golang driver before Version 1.6.19. We strongly recommend users upgrade to Version 1.6.19 as soon as possible via the following resources: [Go Snowflake Driver](https://docs.snowflake.com/en/developer-guide/golang/go-driver)\n\n### Additional Information\nIf you discover a security vulnerability in one of our products or websites, please report the issue to HackerOne. For more information, please see our [Vulnerability Disclosure Policy](https://hackerone.com/snowflake?type=team).",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/snowflakedb/gosnowflake"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.6.19"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/snowflakedb/gosnowflake/security/advisories/GHSA-fwv2-65wh-2w8c"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-34231"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/snowflakedb/gosnowflake/pull/757"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/snowflakedb/gosnowflake/commit/e11a2a555f1b9f7adc1f01fb7b5e7f38fbbb2a1c"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/snowflakedb/gosnowflake"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-77" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-06-09T22:53:25Z",
    "nvd_published_at" : "2023-06-08T20:15:09Z"
  }
}