Monitor vulnerabilities like this one.
Sign up free to get alerted when software you use is affected.
7.3
dbt-common's commonprefix() doesn't protect against path traversal
CVE-2026-29790
GHSA-w75w-9qv4-j5xj
GHSA-w75w-9qv4-j5xj
Summary
### Impact
_What kind of vulnerability is it? Who is impacted?_
A path traversal vulnerability exists in dbt-common's `safe_extract()` function used when extracting tarball archives. The function uses `os.path.commonprefix()` to validate that extracted files remain within the intended destination d...
What to do
- Update dbt-common to version 1.34.2.
- Update dbt-common to version 1.37.3.
Affected software
| Vendor | Product | Affected versions | Fix available |
|---|---|---|---|
| – | dbt-common | <= 1.34.2 | 1.34.2 |
| – | dbt-common | > 1.35.0 , <= 1.37.3 | 1.37.3 |
Original title
dbt-common's commonprefix() doesn't protect against path traversal
Original description
### Impact
_What kind of vulnerability is it? Who is impacted?_
A path traversal vulnerability exists in dbt-common's `safe_extract()` function used when extracting tarball archives. The function uses `os.path.commonprefix()` to validate that extracted files remain within the intended destination directory. However, `commonprefix()` compares paths character-by-character rather than by path components, allowing a malicious tarball to write files to sibling directories with matching name prefixes.
For example, when extracting to `/tmp/packages`, a crafted tarball could write files to `/tmp/packagesevil/` by exploiting the character-based prefix matching.
This vulnerability affects users who:
- Install dbt packages from untrusted sources
- Process tarball archives through dbt-common's extraction utilities
The practical risk is limited because:
- Exploitation requires a malicious tarball to be processed
- File writes are restricted to sibling directories with matching prefixes (not arbitrary paths)
- Packages from trusted sources (dbt Hub) are not affected
This is similar to CVE-2026-1703 in pip, which had a CVSS score of 3.9 (Low).
### Patches
_Has the problem been patched? What versions should users upgrade to?_
Fixed in `dbt-common` version 1.37.3 & 1.34.2, and patched for dbt-core 1.11.7 and 1.10.20 releases.
The fix replaces `os.path.commonprefix()` with `os.path.commonpath()`, which correctly compares paths by their components rather than characters.
### Workarounds
_Is there a way for users to fix or remediate the vulnerability without upgrading?_
- Only install dbt packages from trusted sources (official dbt Hub, verified git repositories)
- Avoid installing packages from untrusted URLs or unverified third parties
- Review package contents before installation when sourcing from external locations
### Resources
_Are there any links users can visit to find out more?_
1. CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'): https://cwe.mitre.org/data/definitions/22.html
2. CVE-2026-1703 (similar vulnerability in pip): https://nvd.nist.gov/vuln/detail/CVE-2026-1703
3. pip fix PR #13777: https://github.com/pypa/pip/pull/13777
4. Python documentation on `commonpath` vs `commonprefix`: https://docs.python.org/3/library/os.path.html#os.path.commonpath
_What kind of vulnerability is it? Who is impacted?_
A path traversal vulnerability exists in dbt-common's `safe_extract()` function used when extracting tarball archives. The function uses `os.path.commonprefix()` to validate that extracted files remain within the intended destination directory. However, `commonprefix()` compares paths character-by-character rather than by path components, allowing a malicious tarball to write files to sibling directories with matching name prefixes.
For example, when extracting to `/tmp/packages`, a crafted tarball could write files to `/tmp/packagesevil/` by exploiting the character-based prefix matching.
This vulnerability affects users who:
- Install dbt packages from untrusted sources
- Process tarball archives through dbt-common's extraction utilities
The practical risk is limited because:
- Exploitation requires a malicious tarball to be processed
- File writes are restricted to sibling directories with matching prefixes (not arbitrary paths)
- Packages from trusted sources (dbt Hub) are not affected
This is similar to CVE-2026-1703 in pip, which had a CVSS score of 3.9 (Low).
### Patches
_Has the problem been patched? What versions should users upgrade to?_
Fixed in `dbt-common` version 1.37.3 & 1.34.2, and patched for dbt-core 1.11.7 and 1.10.20 releases.
The fix replaces `os.path.commonprefix()` with `os.path.commonpath()`, which correctly compares paths by their components rather than characters.
### Workarounds
_Is there a way for users to fix or remediate the vulnerability without upgrading?_
- Only install dbt packages from trusted sources (official dbt Hub, verified git repositories)
- Avoid installing packages from untrusted URLs or unverified third parties
- Review package contents before installation when sourcing from external locations
### Resources
_Are there any links users can visit to find out more?_
1. CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'): https://cwe.mitre.org/data/definitions/22.html
2. CVE-2026-1703 (similar vulnerability in pip): https://nvd.nist.gov/vuln/detail/CVE-2026-1703
3. pip fix PR #13777: https://github.com/pypa/pip/pull/13777
4. Python documentation on `commonpath` vs `commonprefix`: https://docs.python.org/3/library/os.path.html#os.path.commonpath
nvd CVSS4.0
2.0
Vulnerability type
CWE-22
Path Traversal
- https://github.com/dbt-labs/dbt-common/commit/e547954a48bac9394ef6eb98432e429dce...
- https://github.com/dbt-labs/dbt-common/security/advisories/GHSA-w75w-9qv4-j5xj
- https://github.com/pypa/pip/pull/13777
- https://docs.python.org/3/library/os.path.html#os.path.commonpath
- https://github.com/advisories/GHSA-6vgw-5pg2-w6jp
- https://github.com/advisories/GHSA-w75w-9qv4-j5xj
- https://nvd.nist.gov/vuln/detail/CVE-2026-29790
- https://github.com/dbt-labs/dbt-common Product
Published: 5 Mar 2026 · Updated: 12 Mar 2026 · First seen: 6 Mar 2026