Ecosyste.ms: Advisories
An open API service providing security vulnerability metadata for many open source software ecosystems.
Security Advisories: GSA_kwCzR0hTQS1wbXJ4LTY5NXItNDM0Oc4AA8jH
dbt allows Binding to an Unrestricted IP Address via socketsocket
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, dbt-core v1.7.15, and dbt-core v1.8.1 by binding to localhost explicitly by default in dbt docs serve
(https://github.com/dbt-labs/dbt-core/issues/10209).
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS1wbXJ4LTY5NXItNDM0Oc4AA8jH
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Moderate
Classification: General
Published: 6 months ago
Updated: 6 months ago
CVSS Score: 5.3
CVSS vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
EPSS Percentage: 0.00044
EPSS Percentile: 0.14503
Identifiers: GHSA-pmrx-695r-4349, CVE-2024-36105
References:
- https://github.com/dbt-labs/dbt-core/security/advisories/GHSA-pmrx-695r-4349
- https://nvd.nist.gov/vuln/detail/CVE-2024-36105
- https://github.com/dbt-labs/dbt-core/issues/10209
- https://github.com/dbt-labs/dbt-core/pull/10208
- https://github.com/dbt-labs/dbt-core/commit/0c08d7a19ad1740be3cb0b2e6d9d64f6537176f7
- https://cwe.mitre.org/data/definitions/1327.html
- https://docs.python.org/3/library/socket.html#socket-families
- https://docs.securesauce.dev/rules/PY030
- https://github.com/dbt-labs/dbt-core/blob/main/core/dbt/task/docs/serve.py#L23C38-L23C39
- https://github.com/dbt-labs/dbt-core/releases/tag/v1.6.15
- https://github.com/dbt-labs/dbt-core/releases/tag/v1.7.15
- https://github.com/dbt-labs/dbt-core/releases/tag/v1.8.1
- https://github.com/advisories/GHSA-pmrx-695r-4349
Blast Radius: 14.5
Affected Packages
pypi:dbt-core
Dependent packages: 139Dependent repositories: 553
Downloads: 20,208,689 last month
Affected Version Ranges: = 1.8.0, >= 1.7.0, < 1.7.15, < 1.6.15
Fixed in: 1.8.1, 1.7.15, 1.6.15
All affected versions: 0.13.0, 0.13.1, 0.14.0, 0.14.1, 0.14.2, 0.14.3, 0.14.4, 0.15.0, 0.15.1, 0.15.2, 0.15.3, 0.16.0, 0.16.1, 0.17.0, 0.17.1, 0.17.2, 0.18.0, 0.18.1, 0.18.2, 0.19.0, 0.19.1, 0.19.2, 0.20.0, 0.20.1, 0.20.2, 0.21.0, 0.21.1, 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.0.5, 1.0.6, 1.0.7, 1.0.8, 1.0.9, 1.1.0, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5, 1.2.0, 1.2.1, 1.2.2, 1.2.3, 1.2.4, 1.2.5, 1.2.6, 1.3.0, 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.3.6, 1.3.7, 1.4.0, 1.4.1, 1.4.2, 1.4.3, 1.4.4, 1.4.5, 1.4.6, 1.4.7, 1.4.8, 1.4.9, 1.5.0, 1.5.1, 1.5.2, 1.5.3, 1.5.4, 1.5.5, 1.5.6, 1.5.7, 1.5.8, 1.5.9, 1.5.10, 1.5.11, 1.6.0, 1.6.1, 1.6.2, 1.6.3, 1.6.4, 1.6.5, 1.6.6, 1.6.7, 1.6.8, 1.6.9, 1.6.10, 1.6.11, 1.6.12, 1.6.13, 1.6.14, 1.7.0, 1.7.1, 1.7.2, 1.7.3, 1.7.4, 1.7.5, 1.7.6, 1.7.7, 1.7.8, 1.7.9, 1.7.10, 1.7.11, 1.7.12, 1.7.13, 1.7.14, 1.8.0
All unaffected versions: 1.6.15, 1.6.16, 1.6.17, 1.6.18, 1.7.15, 1.7.16, 1.7.17, 1.7.18, 1.8.1, 1.8.2, 1.8.3, 1.8.4, 1.8.5, 1.8.6, 1.8.7, 1.8.8, 1.8.9