CVE-2024-36105: Dbt core Dbt Allows Binding To An Vulnerability

MODERATE
Advisory Identifier: GHSA-pmrx-695r-4349
CVSS 5.3
CWE-1327
Published
Advisory Summary

CVE-2024-36105 is a MODERATE (CVSS 5.3) dbt allows binding to an vulnerability (CWE-1327: Binding to an Unrestricted IP Address) affecting Dbt core libraries in the PyPI ecosystem. The issue involves dbt allows binding to an unrestricted ip address via socketsocket. Remediation is available by upgrading affected packages to version 1.6.15, 1.7.15, 1.8.1.

CVE-2024-36105 at a Glance

CVE Identifier CVE-2024-36105
GHSA Identifier GHSA-pmrx-695r-4349
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-1327: Binding to an Unrestricted IP Address
Affected Product Dbt core
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 5.3

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: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 Unchanged (S:U)
Confidentiality Low (C:L)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2024-36105

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

dbt-core fixed: 1.6.15
pip install dbt-core>=1.6.15
dbt-core fixed: 1.7.15
pip install dbt-core>=1.7.15
dbt-core fixed: 1.8.1
pip install dbt-core>=1.8.1
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 dbt-core

How to Check if You Are Affected

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

pip show dbt-core

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

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-1327: Binding to an Unrestricted IP Address, where the product assigns the address 0.0.0.0 for a database server, a cloud service/instance, or any computing resource that communicates remotely. In Dbt core, 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 Binding to `INADDR_ANY (0.0.0.0)` or `IN6ADDR_ANY (::)` exposes an application on all network interfaces, increasing the risk of unauthorized access. While doing some static analysis and code inspection, I found the following code binding a socket to `INADDR_ANY` by passing `""` as the address. This effectively binds to any network interface on the local system, not just localhost (127.0.0.1). ### Details As stated in the Python docs, a special form for address is accepted instead of a host address: `''` represents `INADDR_ANY`, equivalent to `"0.0.0.0"`. On systems with IPv6, '' represents `IN6ADDR_ANY`, which is equivalent to `"::"`. https://github.com/dbt-labs/dbt-core/blob/main/core/dbt/task/docs/serve.py#L23C38-L23C39 The text around this code also imply the intention is to host docs only on localhost. ### PoC To recreate, run the docs ServeTask.run() to stand up the HTTP server. Then run `netstat` to see what addresses this process is bound. ### Impact A user who serves docs on an unsecured public network, may unknowingly be hosting an unsecured (http) web site for any remote user/system to access on the same network. Further references: https://docs.python.org/3/library/socket.html#socket-families https://docs.securesauce.dev/rules/PY030 https://cwe.mitre.org/data/definitions/1327.html ### Patches The issue has has been mitigated in [dbt-core v1.6.15](https://github.com/dbt-labs/dbt-core/releases/tag/v1.6.15), [dbt-core v1.7.15](https://github.com/dbt-labs/dbt-core/releases/tag/v1.7.15), and [dbt-core v1.8.1](https://github.com/dbt-labs/dbt-core/releases/tag/v1.8.1) by binding to localhost explicitly by default in `dbt docs serve` (https://github.com/dbt-labs/dbt-core/issues/10209).

CVE-2024-36105 Affected Dbt core Versions

3 component(s)
Fixed Versions:
1.6.151.7.151.8.1
Product / Package Ecosystem Affected Versions Fixed Version
dbt-core
PyPI
< 1.6.15
1.6.15
dbt-core
PyPI
≥ 1.7.0
< 1.7.15
1.7.15
dbt-core
PyPI
≥ 1.8.0
< 1.8.1
All 1 versions
1.8.0
1.8.1

References

Frequently Asked Questions

What is CVE-2024-36105?
CVE-2024-36105 is a security vulnerability in Dbt core involving dbt allows Binding to an Unrestricted IP Address via socketsocket under CWE-1327: Binding to an Unrestricted IP Address.
Which Dbt core versions are affected?
Affected versions include releases prior to 1.6.15, 1.7.15, 1.8.1 across affected packages: dbt-core.
What version fixes CVE-2024-36105?
Upgrading to 1.6.15, 1.7.15, 1.8.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is dbt-core affected?
Yes, dbt-core is affected in releases prior to 1.6.15, 1.7.15, 1.8.1. Upgrade your dependency to 1.6.15, 1.7.15, 1.8.1 or later.
What is the CVSS score of CVE-2024-36105?
CVE-2024-36105 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N.
What CWE is associated with CVE-2024-36105?
CVE-2024-36105 is classified under CWE-1327: Binding to an Unrestricted IP Address (The product assigns the address 0.0.0.0 for a database server, a cloud service/instance, or any computing resource that communicates remotely.).
How can I check PyPI dependencies for CVE-2024-36105?
Run the dependency tree command: 'pip show dbt-core'. 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-pmrx-695r-4349",
  "modified" : "2024-05-28T21:19:14Z",
  "published" : "2024-05-28T21:19:14Z",
  "aliases" : [ "CVE-2024-36105" ],
  "summary" : "dbt allows Binding to an Unrestricted IP Address via socketsocket",
  "details" : "### Summary\n\nBinding to `INADDR_ANY (0.0.0.0)` or `IN6ADDR_ANY (::)` exposes an application on all network interfaces, increasing the risk of unauthorized access.\n\nWhile doing some static analysis and code inspection, I found the following code binding a socket to `INADDR_ANY` by passing `\"\"` as the address. This effectively binds to any network interface on the local system, not just localhost (127.0.0.1). \n\n### Details\n\nAs stated in the Python docs, a special form for address is accepted instead of a host address: `''` represents `INADDR_ANY`, equivalent to `\"0.0.0.0\"`. On systems with IPv6, '' represents `IN6ADDR_ANY`, which is equivalent to `\"::\"`. \n\nhttps://github.com/dbt-labs/dbt-core/blob/main/core/dbt/task/docs/serve.py#L23C38-L23C39\n\nThe text around this code also imply the intention is to host docs only on localhost.\n\n### PoC\n\nTo recreate, run the docs ServeTask.run() to stand up the HTTP server.  Then run `netstat` to see what addresses this process is bound.\n\n### Impact\n\nA user who serves docs on an unsecured public network, may unknowingly be hosting an unsecured (http) web site for any remote user/system to access on the same network.\n\nFurther references:\nhttps://docs.python.org/3/library/socket.html#socket-families\nhttps://docs.securesauce.dev/rules/PY030\nhttps://cwe.mitre.org/data/definitions/1327.html\n\n### Patches\nThe issue has has been mitigated in [dbt-core v1.6.15](https://github.com/dbt-labs/dbt-core/releases/tag/v1.6.15), [dbt-core v1.7.15](https://github.com/dbt-labs/dbt-core/releases/tag/v1.7.15), and [dbt-core v1.8.1](https://github.com/dbt-labs/dbt-core/releases/tag/v1.8.1) by binding to localhost explicitly by default in `dbt docs serve` (https://github.com/dbt-labs/dbt-core/issues/10209).\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "dbt-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.6.15"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "dbt-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.7.0"
      }, {
        "fixed" : "1.7.15"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "dbt-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.8.0"
      }, {
        "fixed" : "1.8.1"
      } ]
    } ],
    "versions" : [ "1.8.0" ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/dbt-labs/dbt-core/security/advisories/GHSA-pmrx-695r-4349"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-36105"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/dbt-labs/dbt-core/issues/10209"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/dbt-labs/dbt-core/pull/10208"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/dbt-labs/dbt-core/commit/0c08d7a19ad1740be3cb0b2e6d9d64f6537176f7"
  }, {
    "type" : "WEB",
    "url" : "https://cwe.mitre.org/data/definitions/1327.html"
  }, {
    "type" : "WEB",
    "url" : "https://docs.python.org/3/library/socket.html#socket-families"
  }, {
    "type" : "WEB",
    "url" : "https://docs.securesauce.dev/rules/PY030"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/dbt-labs/dbt-core"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/dbt-labs/dbt-core/blob/main/core/dbt/task/docs/serve.py#L23C38-L23C39"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/dbt-labs/dbt-core/releases/tag/v1.6.15"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/dbt-labs/dbt-core/releases/tag/v1.7.15"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/dbt-labs/dbt-core/releases/tag/v1.8.1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1327" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-05-28T21:19:14Z",
    "nvd_published_at" : "2024-05-27T18:15:10Z"
  }
}