Vulnerabilities in pkg:pypi/opentelemetry-instrumentation

PACKAGE
Advisory Identifier: GHSA-5rv5-6h4r-h22v
Advisory Summary

CVE-2023-43810 is a HIGH (CVSS 7.5) denial of service vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Opentelemetry instrumentation libraries in the PyPI ecosystem. The issue involves opentelemetry-instrumentation denial of service vulnerability due to unbound cardinality metrics. Remediation is available by upgrading affected packages to version 0.41b0.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/opentelemetry-instrumentation

1 Known Advisory Record(s)

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

Advisory ID CVE / NVD Severity Summary
GHSA-5rv5-6h4r-h22v CVE-2023-43810 HIGH opentelemetry-instrumentation Denial of Service vulnerability due to unbound cardinality metrics

CVE-2023-43810 at a Glance

CVE Identifier CVE-2023-43810
GHSA Identifier GHSA-5rv5-6h4r-h22v
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product Opentelemetry instrumentation
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 7.5

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:U/C:N/I:N/A:H).

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

How to Fix CVE-2023-43810

To remediate this vulnerability, upgrade all affected Opentelemetry instrumentation 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 fixed: 0.41b0
pip install opentelemetry-instrumentation>=0.41b0
Verify Direct and Transitive Dependencies

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

pip show opentelemetry-instrumentation

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2023-43810, inspect your installed packages using pip:

pip show opentelemetry-instrumentation

Analyze the terminal output to locate any version of Opentelemetry instrumentation in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.41b0), your application is affected.

Note: The pip show opentelemetry-instrumentation command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In Opentelemetry instrumentation, 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 Autoinstrumentation out of the box adds the label `http_method` that has unbound cardinality. It leads to the server's potential memory exhaustion when many malicious requests are sent. ### Details HTTP method for requests can be easily set by an attacker to be random and long. ### PoC Send many requests with long randomly generated HTTP methods and observe how memory consumption increases during it. The app can be like [this example from the official docs](https://opentelemetry-python-contrib.readthedocs.io/en/latest/instrumentation/flask/flask.html#id1). ### Impact In order to be affected program has to be instrumented for HTTP handlers and does not filter any unknown HTTP methods on the level of CDN, LB, previous middleware, etc. ### Proposed solution For convenience and safe usage of this library, it should by default mark with the label `UNKNOWN` non-standard HTTP methods to show that such requests were made (and this way does not increase cardinality). In case someone wants to stay with the current behavior, library API should allow it. The mechanism with environment variables can be reused - introduce the variable `OTEL_INSTRUMENTATION_HTTP_CAPTURE_ALL_METHODS` that will allow enabling current behavior when someone really wants it.

CVE-2023-43810 Affected Opentelemetry instrumentation Versions

1 component(s)
Fixed Versions:
0.41b0
Product / Package Ecosystem Affected Versions Fixed Version
opentelemetry-instrumentation
PyPI
< 0.41b0
0.41b0

References

Frequently Asked Questions

What is CVE-2023-43810?
CVE-2023-43810 is a security vulnerability in Opentelemetry instrumentation involving opentelemetry-instrumentation Denial of Service vulnerability due to unbound cardinality metrics under CWE-400: Uncontrolled Resource Consumption.
Which Opentelemetry instrumentation versions are affected?
Affected versions include releases prior to 0.41b0 across affected packages: opentelemetry-instrumentation.
What version fixes CVE-2023-43810?
Upgrading to 0.41b0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is opentelemetry-instrumentation affected?
Yes, opentelemetry-instrumentation is affected in releases prior to 0.41b0. Upgrade your dependency to 0.41b0 or later.
What is the CVSS score of CVE-2023-43810?
CVE-2023-43810 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2023-43810?
CVE-2023-43810 is classified under CWE-400: Uncontrolled Resource Consumption (The product does not properly control the allocation and maintenance of a limited resource.).
How can I check PyPI dependencies for CVE-2023-43810?
Run the dependency tree command: 'pip show opentelemetry-instrumentation'. 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-5rv5-6h4r-h22v",
  "modified" : "2023-10-03T18:15:32Z",
  "published" : "2023-10-02T23:29:42Z",
  "aliases" : [ "CVE-2023-43810" ],
  "summary" : "opentelemetry-instrumentation Denial of Service vulnerability due to unbound cardinality metrics",
  "details" : "### Summary\nAutoinstrumentation out of the box adds the label `http_method` that has unbound cardinality. It leads to the server's potential memory exhaustion when many malicious requests are sent.\n\n### Details\nHTTP method for requests can be easily set by an attacker to be random and long.\n\n### PoC\nSend many requests with long randomly generated HTTP methods and observe how memory consumption increases during it. The app can be like [this example from the official docs](https://opentelemetry-python-contrib.readthedocs.io/en/latest/instrumentation/flask/flask.html#id1).\n\n### Impact\nIn order to be affected program has to be instrumented for HTTP handlers and does not filter any unknown HTTP methods on the level of CDN, LB, previous middleware, etc.\n\n### Proposed solution\nFor convenience and safe usage of this library, it should by default mark with the label `UNKNOWN` non-standard HTTP methods to show that such requests were made (and this way does not increase cardinality). In case someone wants to stay with the current behavior, library API should allow it. The mechanism with environment variables can be reused - introduce the variable `OTEL_INSTRUMENTATION_HTTP_CAPTURE_ALL_METHODS` that will allow enabling current behavior when someone really wants it. \n\n\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "opentelemetry-instrumentation"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.41b0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/open-telemetry/opentelemetry-python-contrib/security/advisories/GHSA-5rv5-6h4r-h22v"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-43810"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/open-telemetry/opentelemetry-python-contrib/commit/6007e0c013071e7f8b9612d3bc68aeb9d600d74e"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/open-telemetry/opentelemetry-python-contrib"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/open-telemetry/opentelemetry-python-contrib/releases/tag/v0.41b0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-400" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-10-02T23:29:42Z",
    "nvd_published_at" : "2023-10-06T14:15:12Z"
  }
}