CVE-2023-45825: Github.com/ydb platform/ydb go sdk/v3 Ydb-go-sdk Token Vulnerability

MODERATE
Advisory Identifier: GHSA-q24m-6h38-5xj8
CVSS 5.5
CWE-532
Published
Advisory Summary

CVE-2023-45825 is a MODERATE (CVSS 5.5) ydb-go-sdk token vulnerability (CWE-532: Insertion of Sensitive Information into Log File) affecting Github.com/ydb platform/ydb go sdk/v3 libraries in the Go ecosystem. The issue involves ydb-go-sdk token in custom credentials object can leak through logs. Remediation is available by upgrading affected packages to version 3.53.3.

CVE-2023-45825 at a Glance

CVE Identifier CVE-2023-45825
GHSA Identifier GHSA-q24m-6h38-5xj8
Severity MODERATE
CVSS v3.1 Base Score 5.5
CWE Classification CWE-532: Insertion of Sensitive Information into Log File
Affected Product Github.com/ydb platform/ydb go sdk/v3
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-2023-45825

To remediate this vulnerability, upgrade all affected Github.com/ydb platform/ydb go sdk/v3 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/ydb-platform/ydb-go-sdk/v3 fixed: 3.53.3
Upgrade github.com/ydb-platform/ydb-go-sdk/v3 to 3.53.3
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/ydb-platform/ydb-go-sdk/v3

How to Check if You Are Affected

To determine whether your application is affected by CVE-2023-45825, inspect your project dependencies for Github.com/ydb platform/ydb go sdk/v3:

inspect dependencies for github.com/ydb-platform/ydb-go-sdk/v3

Analyze the terminal output to locate any version of Github.com/ydb platform/ydb go sdk/v3 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.53.3), 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/ydb platform/ydb go sdk/v3, 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

### Impact Since [ydb-go-sdk/v3.48.6](https://github.com/ydb-platform/ydb-go-sdk/blob/v3.48.6/internal/balancer/balancer.go#L71) if you use a custom credentials object (implementation of interface [Credentials](https://github.com/ydb-platform/ydb-go-sdk/blob/master/credentials/credentials.go#L10)) it may leak into logs. This happens because this object could be serialized into an error message using `fmt.Errorf("something went wrong (credentials: %q)", credentials)` during connection to the YDB server. Printf func use placeholder `%q` for string representation of argument with quotes. If an argument implements interface `fmt.Stringer`, it will used through `String()` func. In other cases used fallback - serialization with reflection. If such logging occurred, a malicious user with access to logs could read sensitive information (i.e. credentials) information and use it to get access to the database. Who is impacted: applications with custom credentials object with an explicit token field. A leak could have occurred if all of these conditions were met simultaneously: 1) The credentials object does not implement the `fmt.Stringer` interface (does not have a `String()` method) - potentially these are custom credentials. Official credentials have a `String()` method. 2) There was an error connecting to YDB during driver creation via `ydb.Open(...)`. 3) Some logging system was configured (`ydb-go-sdk` does not log such errors by default). 4) The connection error was logged into a system that a malicious user had access to. ### Patches `ydb-go-sdk` contains this problem in versions from v3.48.6 to v3.53.2. The fix for this problem has been released in version v3.53.3 ([PR](https://github.com/ydb-platform/ydb-go-sdk/pull/859)). ### Workarounds Implement the `fmt.Stringer` interface in your custom credentials type with explicit stringify of object state.

CVE-2023-45825 Affected Github.com/ydb platform/ydb go sdk/v3 Versions

1 component(s)
Fixed Versions:
3.53.3
Product / Package Ecosystem Affected Versions Fixed Version
github.com/ydb-platform/ydb-go-sdk/v3
Go
≥ 3.48.6
< 3.53.3
3.53.3

References

Frequently Asked Questions

What is CVE-2023-45825?
CVE-2023-45825 is a security vulnerability in Github.com/ydb platform/ydb go sdk/v3 involving ydb-go-sdk token in custom credentials object can leak through logs under CWE-532: Insertion of Sensitive Information into Log File.
Which Github.com/ydb platform/ydb go sdk/v3 versions are affected?
Affected versions include releases prior to 3.53.3 across affected packages: github.com/ydb-platform/ydb-go-sdk/v3.
What version fixes CVE-2023-45825?
Upgrading to 3.53.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/ydb-platform/ydb-go-sdk/v3 affected?
Yes, github.com/ydb-platform/ydb-go-sdk/v3 is affected in releases prior to 3.53.3. Upgrade your dependency to 3.53.3 or later.
What is the CVSS score of CVE-2023-45825?
CVE-2023-45825 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-2023-45825?
CVE-2023-45825 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-2023-45825?
Run the dependency tree command: 'inspect dependencies for github.com/ydb-platform/ydb-go-sdk/v3'. 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-q24m-6h38-5xj8",
  "modified" : "2023-10-24T22:48:40Z",
  "published" : "2023-10-19T17:10:00Z",
  "aliases" : [ "CVE-2023-45825" ],
  "summary" : "ydb-go-sdk token in custom credentials object can leak through logs",
  "details" : "### Impact\nSince [ydb-go-sdk/v3.48.6](https://github.com/ydb-platform/ydb-go-sdk/blob/v3.48.6/internal/balancer/balancer.go#L71) if you use a custom credentials object (implementation of interface [Credentials](https://github.com/ydb-platform/ydb-go-sdk/blob/master/credentials/credentials.go#L10)) it may leak into logs. This happens because this object could be serialized into an error message using `fmt.Errorf(\"something went wrong (credentials: %q)\", credentials)` during connection to the YDB server. Printf func use placeholder `%q` for string representation of argument with quotes. If an argument implements interface `fmt.Stringer`, it will used through `String()` func. In other cases used fallback - serialization with reflection.\n\nIf such logging occurred, a  malicious user with access to logs could read sensitive information (i.e. credentials) information and use it to get access to the database.\n\nWho is impacted: applications with custom credentials object with an explicit token field.\n\nA leak could have occurred if all of these conditions were met simultaneously:\n1) The credentials object does not implement the `fmt.Stringer` interface (does not have a `String()` method) - potentially these are custom credentials. Official credentials have a `String()` method.\n2) There was an error connecting to YDB during driver creation via `ydb.Open(...)`.\n3) Some logging system was configured (`ydb-go-sdk` does not log such errors by default).\n4) The connection error was logged into a system that a malicious user had access to.\n\n### Patches\n`ydb-go-sdk` contains this problem in versions from v3.48.6 to v3.53.2. The fix for this problem has been released in version v3.53.3 ([PR](https://github.com/ydb-platform/ydb-go-sdk/pull/859)).\n\n### Workarounds\nImplement the `fmt.Stringer` interface in your custom credentials type with explicit stringify of object state.",
  "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/ydb-platform/ydb-go-sdk/v3"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.48.6"
      }, {
        "fixed" : "3.53.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/ydb-platform/ydb-go-sdk/security/advisories/GHSA-q24m-6h38-5xj8"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-45825"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ydb-platform/ydb-go-sdk/pull/859"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ydb-platform/ydb-go-sdk/commit/a0d92057c4e1bbdc5e85ae8d649edb0232b8fd4c"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ydb-platform/ydb-go-sdk"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ydb-platform/ydb-go-sdk/blob/master/credentials/credentials.go#L10"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ydb-platform/ydb-go-sdk/blob/v3.48.6/internal/balancer/balancer.go#L71"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-532" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-10-19T17:10:00Z",
    "nvd_published_at" : "2023-10-19T19:15:16Z"
  }
}