Miggo Logo

CVE-2024-40637: dbt has an implicit override for built-in materializations from installed packages

4.2

CVSS Score
3.1

Basic Information

EPSS Score
0.22892%
Published
7/17/2024
Updated
11/18/2024
KEV Status
No
Technology
TechnologyPython

Technical Details

CVSS Vector
CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:L/I:L/A:L
Package NameEcosystemVulnerable VersionsFirst Patched Version
dbt-corepip>= 1.6.0, < 1.6.141.6.14
dbt-corepip>= 1.7.0, < 1.7.141.7.14

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from how dbt resolves materialization macros. The find_materialization_macro_by_name function's logic in manifest.py was modified in the patch to add security checks. Pre-patch behavior: 1) It sorted macro candidates by specificity 2) Returned the last candidate (highest precedence) 3) Allowed package macros to override core materializations by default. The commit diff shows critical changes to this function including deprecation warnings and flag checks (require_explicit_package_overrides_for_builtin_materializations), confirming this was the injection point for unauthorized overrides.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

### Imp**t _W**t kin* o* vuln*r**ility is it? W*o is imp**t**?_ W**n * us*r inst*lls * [p**k***](*ttps://*o*s.**t**t.*om/*o*s/*uil*/p**k***s) in **t, it **s t** **ility to ov*rri** m**ros, m*t*ri*liz*tions, *n* ot**r *or* *ompon*nts o* **t. T*is is

Reasoning

T** vuln*r**ility st*ms *rom *ow **t r*solv*s m*t*ri*liz*tion m**ros. T** *in*_m*t*ri*liz*tion_m**ro_*y_n*m* *un*tion's lo*i* in m*ni**st.py w*s mo*i*i** in t** p*t** to *** s**urity ****ks. Pr*-p*t** ****vior: *) It sort** m**ro **n*i**t*s *y sp**i*