Repository navigation
fix(ingestion): validate PowerBI .pbit archive members before extracting - #37859
Conversation
get_datamodel_schema_files_from_pbit() called extractall() on .pbit files pulled from a shared bucket or folder without checking member names. CPython's extractall rewrites ".." and absolute names, so nothing lands outside the target today, but the crafted entry is silently relocated rather than rejected, and the download step in the same file already validates paths explicitly. Extract member by member and skip, with a warning, any entry whose resolved path leaves the extract directory. Also handle each .pbit on its own, so one corrupt file no longer discards the schemas of all the others.
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
…pping all schemas Opening a ZIP reads only its central directory, so damaged compressed data fails later, during extraction, with zlib.error, EOFError, RuntimeError or NotImplementedError. The per-file handler caught only BadZipFile and OSError, so those errors reached the outer handler and returned None for every archive. Catch any extraction failure per file, and add a test with damaged deflate data next to a good archive.
…king the schema reader
Code Review ✅ Approved 🟡 Medium risk 1 closed / 1 findingsPer-member .pbit path validation and per-file error handling change ingestion; rejected or damaged archives could leave their schemas unavailable. Hardens PowerBI ✅ 1 closed✅ Quality: Escape assertion checks wrong path, never detects the traversal
VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
…ing (#37859) * fix(ingestion): validate PowerBI .pbit archive members before extracting get_datamodel_schema_files_from_pbit() called extractall() on .pbit files pulled from a shared bucket or folder without checking member names. CPython's extractall rewrites ".." and absolute names, so nothing lands outside the target today, but the crafted entry is silently relocated rather than rejected, and the download step in the same file already validates paths explicitly. Extract member by member and skip, with a warning, any entry whose resolved path leaves the extract directory. Also handle each .pbit on its own, so one corrupt file no longer discards the schemas of all the others. * test(ingestion): assert the .pbit escape paths a traversal would actually reach * fix(ingestion): skip a .pbit that fails mid-extraction instead of dropping all schemas Opening a ZIP reads only its central directory, so damaged compressed data fails later, during extraction, with zlib.error, EOFError, RuntimeError or NotImplementedError. The per-file handler caught only BadZipFile and OSError, so those errors reached the outer handler and returned None for every archive. Catch any extraction failure per file, and add a test with damaged deflate data next to a good archive. * style(ingestion): use lazy %-style logging in the .pbit extraction warnings * test(ingestion): assert the good .pbit's parsed schema instead of mocking the schema reader (cherry picked from commit def1e9e)
….pbit Zip Slip fix (#37748, #37858, #37859) (#37861) * fix(ingestion): floor oauthlib, filelock and dnspython for Dependabot alerts (#37748) oauthlib >= 4.0.1 fixes GHSA-3jp2-3mrg-2vxc (device-code grant issues a token for any device_code). filelock >= 4.2.1 fixes GHSA-v4x8-3wr5-3wq8 (ReadWriteLock follows planted symlinks) and dnspython >= 2.9.0 fixes GHSA-45c3-73f7-pv4m (name decompression CPU DoS); both fixes need Python 3.11, so the floors carry a python_version marker and the 3.10 fork keeps the vulnerable releases. The images pip-install openmetadata-ingestion from PyPI rather than from uv.lock, so the floors go in setup.py where they reach both. The in-tree Airflow constraints pin oauthlib 3.3.1 and filelock 3.32.6; bump them, and snowflake-connector-python to 4.8.1 because 4.7.x caps filelock < 4. (cherry picked from commit 8a95e0c) * fix(ingestion): raise dnspython, tornado and OpenTelemetry floors for CVEs (#37858) dnspython >= 2.9.2 fixes CVE-2026-128089, which the 2.9.0 floor from opentelemetry-exporter-otlp 1.45.2 brings opentelemetry-api 1.45.2 for CVE-2026-126360. The dnspython and tornado fixes need Python 3.11, so the existing python_version markers stay and the 3.10 fork keeps the old releases. The in-tree Airflow constraints pin dnspython 2.9.0, tornado 6.5.9 and the OpenTelemetry family at 1.45.1 / 0.66b1; bump them to match, and regenerate uv.lock for just these packages. (cherry picked from commit b7a53e0) * fix(ingestion): validate PowerBI .pbit archive members before extracting (#37859) * fix(ingestion): validate PowerBI .pbit archive members before extracting get_datamodel_schema_files_from_pbit() called extractall() on .pbit files pulled from a shared bucket or folder without checking member names. CPython's extractall rewrites ".." and absolute names, so nothing lands outside the target today, but the crafted entry is silently relocated rather than rejected, and the download step in the same file already validates paths explicitly. Extract member by member and skip, with a warning, any entry whose resolved path leaves the extract directory. Also handle each .pbit on its own, so one corrupt file no longer discards the schemas of all the others. * test(ingestion): assert the .pbit escape paths a traversal would actually reach * fix(ingestion): skip a .pbit that fails mid-extraction instead of dropping all schemas Opening a ZIP reads only its central directory, so damaged compressed data fails later, during extraction, with zlib.error, EOFError, RuntimeError or NotImplementedError. The per-file handler caught only BadZipFile and OSError, so those errors reached the outer handler and returned None for every archive. Catch any extraction failure per file, and add a test with damaged deflate data next to a good archive. * style(ingestion): use lazy %-style logging in the .pbit extraction warnings * test(ingestion): assert the good .pbit's parsed schema instead of mocking the schema reader (cherry picked from commit def1e9e) --------- Co-authored-by: Mayur Singal <[email protected]>
Describe your changes:
Fixes #
From the nightly security review, which reported Zip Slip in PowerBI
.pbitextraction.get_datamodel_schema_files_from_pbit()calledextractall()on.pbitfiles from a shared bucket or folder without checking member names.extractallalready rewrites..and absolute names, so nothing escapes today. Even so, the crafted entry was silently relocated instead of rejected, and the download step in the same file already validates paths explicitly..pbitis now handled on its own, so one corrupt file no longer turns the whole result intoNone.Tests: added
test_file_client_zip_slip.py. Two of its tests fail on the old code, and all 53 PowerBI file-client tests pass.Type of change:
🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge; the previous test concern is fixed and no new issues were found.Summary
The PR checks archive member paths before extracting PowerBI
.pbitfiles and catches extraction errors per archive..pbitentries that leave their folder..pbitno longer stops other files from providing schemas.Reviews (4) · Last reviewed commit: "test(ingestion): assert the good .pbit's..." · Reviewed by Greptile