Vulnerabilities in pkg:npm/@opentelemetry/instrumentation-mysql2

PACKAGE
Advisory Identifier: GHSA-qqmp-wf37-98f9
Advisory Summary

CVE-2026-104872 is a MODERATE (CVSS 5.8) multiple @opentelemetry/instrumentation-* packages expose database vulnerability (CWE-532: Insertion of Sensitive Information into Log File) affecting @opentelemetry/instrumentation cassandra driver libraries in the npm ecosystem. The issue involves multiple @opentelemetry/instrumentation-* packages expose database username via unconditional db.user span attribute. Remediation is available by upgrading affected packages to version 0.66.0, 0.40.0, 0.46.0, 0.67.0, 0.65.0, 0.73.0.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/@opentelemetry/instrumentation-mysql2

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/@opentelemetry/instrumentation-mysql2. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-qqmp-wf37-98f9 CVE-2026-104872 MODERATE Multiple @opentelemetry/instrumentation-* packages expose database username via unconditional db.user span attribute

CVE-2026-104872 at a Glance

CVE Identifier CVE-2026-104872
GHSA Identifier GHSA-qqmp-wf37-98f9
Severity MODERATE
CVSS v3.1 Base Score 5.8
CWE Classification CWE-532: Insertion of Sensitive Information into Log File
Affected Product @opentelemetry/instrumentation cassandra driver
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 5.8

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

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

How to Fix CVE-2026-104872

To remediate this vulnerability, upgrade all affected @opentelemetry/instrumentation cassandra driver dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@opentelemetry/instrumentation-cassandra-driver fixed: 0.66.0
npm install @opentelemetry/instrumentation-cassandra-driver@0.66.0
@opentelemetry/instrumentation-tedious fixed: 0.40.0
npm install @opentelemetry/instrumentation-tedious@0.40.0
@opentelemetry/instrumentation-oracledb fixed: 0.46.0
npm install @opentelemetry/instrumentation-oracledb@0.46.0
@opentelemetry/instrumentation-mongoose fixed: 0.67.0
npm install @opentelemetry/instrumentation-mongoose@0.67.0
@opentelemetry/instrumentation-mysql fixed: 0.67.0
npm install @opentelemetry/instrumentation-mysql@0.67.0
@opentelemetry/instrumentation-knex fixed: 0.65.0
npm install @opentelemetry/instrumentation-knex@0.65.0
@opentelemetry/instrumentation-mysql2 fixed: 0.67.0
npm install @opentelemetry/instrumentation-mysql2@0.67.0
@opentelemetry/instrumentation-pg fixed: 0.73.0
npm install @opentelemetry/instrumentation-pg@0.73.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @opentelemetry/instrumentation-cassandra-driver

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-104872, inspect your project dependencies using npm:

npm ls @opentelemetry/instrumentation-cassandra-driver

Analyze the terminal output to locate any version of @opentelemetry/instrumentation cassandra driver in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.66.0), your application is affected.

Note: The npm ls @opentelemetry/instrumentation-cassandra-driver command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

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 @opentelemetry/instrumentation cassandra driver, 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 Multiple `@opentelemetry/instrumentation-*` packages recorded the database connection username as the `db.user` span attribute on every instrumented database operation. This attribute was emitted unconditionally — it was not gated by `enhancedDatabaseReporting` or any other opt-in flag, and it was the **default** behaviour for all users of the affected packages until the patched releases shipped on 2026-07-23. The attribute is forwarded to every configured observability backend (Jaeger, Zipkin, Datadog, OTLP collectors, etc.). Depending on the database account naming convention in use, the exported value may reveal: - Internal service account names that disclose architecture topology. - Role-encoded usernames (e.g. `admin_readwrite`, `app_readonly_prod`) useful for privilege inference. - Database account naming patterns useful for credential enumeration. Affected packages (all are vulnerable from the first published version through the version listed below): | Package | Vulnerable range | Patched version | |---------|-----------------|-----------------| | `@opentelemetry/instrumentation-cassandra-driver` | `< 0.66.0` | `0.66.0` | | `@opentelemetry/instrumentation-knex` | `< 0.65.0` | `0.65.0` | | `@opentelemetry/instrumentation-mongoose` | `< 0.67.0` | `0.67.0` | | `@opentelemetry/instrumentation-mysql` | `< 0.67.0` | `0.67.0` | | `@opentelemetry/instrumentation-mysql2` | `< 0.67.0` | `0.67.0` | | `@opentelemetry/instrumentation-oracledb` | `< 0.46.0` | `0.46.0` | | `@opentelemetry/instrumentation-pg` | `< 0.73.0` | `0.73.0` | | `@opentelemetry/instrumentation-tedious` | `< 0.40.0` | `0.40.0` | ### Patches Fixed in the coordinated release on 2026-07-23 via [feat!: only emit stable http, network and database attributes (#3585)](https://github.com/open-telemetry/opentelemetry-js-contrib/pull/3585). Upgrade to the patched version listed in the table above for each instrumentation package in use. ### Workarounds No configuration-level workaround exists in the affected versions: the `db.user` attribute cannot be suppressed without patching. As a partial mitigation, a custom `SpanProcessor` can be used to strip `db.user` from spans before they leave the process: ```ts // Example: drop db.user in a custom SpanProcessor class StripDbUserProcessor implements SpanProcessor { onStart(span: Span) { span.setAttribute('db.user', null); } onEnd() {} shutdown() { return Promise.resolve(); } forceFlush() { return Promise.resolve(); } } ``` Users who control the downstream collector can also filter the attribute at the collector pipeline level.

CVE-2026-104872 Affected @opentelemetry/instrumentation cassandra driver Versions

8 component(s)
Fixed Versions:
0.66.00.40.00.46.00.67.00.65.00.73.0
Product / Package Ecosystem Affected Versions Fixed Version
@opentelemetry/instrumentation-cassandra-driver
npm
< 0.66.0
0.66.0
@opentelemetry/instrumentation-tedious
npm
< 0.40.0
0.40.0
@opentelemetry/instrumentation-oracledb
npm
< 0.46.0
0.46.0
@opentelemetry/instrumentation-mongoose
npm
< 0.67.0
0.67.0
@opentelemetry/instrumentation-mysql
npm
< 0.67.0
0.67.0
@opentelemetry/instrumentation-knex
npm
< 0.65.0
0.65.0
@opentelemetry/instrumentation-mysql2
npm
< 0.67.0
0.67.0
@opentelemetry/instrumentation-pg
npm
< 0.73.0
0.73.0

References

Frequently Asked Questions

What is CVE-2026-104872?
CVE-2026-104872 is a security vulnerability in @opentelemetry/instrumentation cassandra driver involving Multiple @opentelemetry/instrumentation-* packages expose database username via unconditional db.user span attribute under CWE-532: Insertion of Sensitive Information into Log File.
Which @opentelemetry/instrumentation cassandra driver versions are affected?
Affected versions include releases prior to 0.66.0, 0.40.0, 0.46.0, 0.67.0, 0.65.0, 0.73.0 across affected packages: @opentelemetry/instrumentation-cassandra-driver, @opentelemetry/instrumentation-tedious, @opentelemetry/instrumentation-oracledb, @opentelemetry/instrumentation-mongoose, @opentelemetry/instrumentation-mysql, @opentelemetry/instrumentation-knex, @opentelemetry/instrumentation-mysql2, @opentelemetry/instrumentation-pg.
What version fixes CVE-2026-104872?
Upgrading to 0.66.0, 0.40.0, 0.46.0, 0.67.0, 0.65.0, 0.73.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @opentelemetry/instrumentation-cassandra-driver affected?
Yes, @opentelemetry/instrumentation-cassandra-driver is affected in releases prior to 0.66.0. Upgrade your dependency to 0.66.0 or later.
Is @opentelemetry/instrumentation-tedious affected?
Yes, @opentelemetry/instrumentation-tedious is affected in releases prior to 0.40.0. Upgrade your dependency to 0.40.0 or later.
What is the CVSS score of CVE-2026-104872?
CVE-2026-104872 has a CVSS v3.1 base score of 5.8 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:N.
What CWE is associated with CVE-2026-104872?
CVE-2026-104872 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 npm dependencies for CVE-2026-104872?
Run the dependency tree command: 'npm ls @opentelemetry/instrumentation-cassandra-driver'. 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-qqmp-wf37-98f9",
  "modified" : "2026-10-05T22:52:44Z",
  "published" : "2026-10-05T22:52:44Z",
  "aliases" : [ "CVE-2026-104872" ],
  "summary" : "Multiple @opentelemetry/instrumentation-* packages expose database username via unconditional db.user span attribute",
  "details" : "### Impact\n\nMultiple `@opentelemetry/instrumentation-*` packages recorded the database connection username as the `db.user`\nspan attribute on every instrumented database operation. This attribute was emitted unconditionally — it was\nnot gated by `enhancedDatabaseReporting` or any other opt-in flag, and it was the **default** behaviour for\nall users of the affected packages until the patched releases shipped on 2026-07-23.\n\nThe attribute is forwarded to every configured observability backend (Jaeger, Zipkin, Datadog, OTLP\ncollectors, etc.).  Depending on the database account naming convention in use, the exported value may\nreveal:\n\n- Internal service account names that disclose architecture topology.\n- Role-encoded usernames (e.g. `admin_readwrite`, `app_readonly_prod`) useful for privilege inference.\n- Database account naming patterns useful for credential enumeration.\n\nAffected packages (all are vulnerable from the first published version through the version listed below):\n\n| Package | Vulnerable range | Patched version |\n|---------|-----------------|-----------------|\n| `@opentelemetry/instrumentation-cassandra-driver` | `< 0.66.0` | `0.66.0` |\n| `@opentelemetry/instrumentation-knex`             | `< 0.65.0` | `0.65.0` |\n| `@opentelemetry/instrumentation-mongoose`         | `< 0.67.0` | `0.67.0` |\n| `@opentelemetry/instrumentation-mysql`            | `< 0.67.0` | `0.67.0` |\n| `@opentelemetry/instrumentation-mysql2`           | `< 0.67.0` | `0.67.0` |\n| `@opentelemetry/instrumentation-oracledb`         | `< 0.46.0` | `0.46.0` |\n| `@opentelemetry/instrumentation-pg`               | `< 0.73.0` | `0.73.0` |\n| `@opentelemetry/instrumentation-tedious`          | `< 0.40.0` | `0.40.0` |\n\n### Patches\n\nFixed in the coordinated release on 2026-07-23 via\n[feat!: only emit stable http, network and database attributes (#3585)](https://github.com/open-telemetry/opentelemetry-js-contrib/pull/3585).\n\nUpgrade to the patched version listed in the table above for each instrumentation package in use.\n\n### Workarounds\n\nNo configuration-level workaround exists in the affected versions: the `db.user` attribute cannot be\nsuppressed without patching. As a partial mitigation, a custom `SpanProcessor` can be used to strip `db.user` from spans before they leave the process:\n\n```ts\n// Example: drop db.user in a custom SpanProcessor\nclass StripDbUserProcessor implements SpanProcessor {\n  onStart(span: Span) {\n    span.setAttribute('db.user', null);\n  }\n  onEnd() {}\n  shutdown() { return Promise.resolve(); }\n  forceFlush() { return Promise.resolve(); }\n}\n```\n\nUsers who control the downstream collector can also filter the attribute at the collector pipeline level.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@opentelemetry/instrumentation-cassandra-driver"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.66.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@opentelemetry/instrumentation-tedious"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.40.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@opentelemetry/instrumentation-oracledb"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.46.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@opentelemetry/instrumentation-mongoose"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.67.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@opentelemetry/instrumentation-mysql"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.67.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@opentelemetry/instrumentation-knex"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.65.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@opentelemetry/instrumentation-mysql2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.67.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@opentelemetry/instrumentation-pg"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.73.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/open-telemetry/opentelemetry-js-contrib/security/advisories/GHSA-qqmp-wf37-98f9"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-104872"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/open-telemetry/opentelemetry-js-contrib/pull/3585"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/open-telemetry/opentelemetry-js-contrib/commit/27e172a9e0d549559056ccd58f27d13467454156"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/open-telemetry/opentelemetry-js-contrib/commit/5b7dd0e102e940d653e04b08b5a1b721a8271037"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/open-telemetry/opentelemetry-js-contrib"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-532" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-10-05T22:52:44Z",
    "nvd_published_at" : "2026-10-02T20:17:01Z"
  }
}