Repository navigation
fix(ingestion): patch Snyk high/critical findings in deps and code - #28231
Conversation
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
| # jsonify pins Content-Type to application/json so callers that | ||
| # interpolate user-controlled values into the payload cannot have | ||
| # their response rendered as HTML. | ||
| return make_response(jsonify(response_obj), status) |
There was a problem hiding this comment.
This is a pre-existing CodeQL finding (not introduced by this PR) that flags potential information exposure through exceptions. The concern is that stack trace details from exceptions can flow into API responses and be returned to external users.
However, in the context of this codebase, this is largely a false positive or an acceptable risk for the following reasons:
-
This is an internal Airflow API — it's not a public-facing endpoint. It's used by the OpenMetadata backend to communicate with the Airflow plugin, typically in a trusted, private network environment.
-
The PR actually improves the situation — the change from raw
json.dumps()+Response()tojsonify()+make_response()is a defensive improvement (correct Content-Type pinning, proper JSON serialization). It doesn't introduce new exposure paths. -
The
errorfields in responses (e.g.,ApiResponse.error(status, error)) do pass error strings into the response body, but those strings originate from caught exceptions that callers explicitly pass in — so the exposure is intentional and controlled, not accidental.
If you want to fully address the CodeQL alert, you could sanitize exception messages before putting them in responses (e.g., strip tracebacks, use generic messages for 500 errors). But given this is an internal API, it's reasonable to dismiss the alert as a false positive.
77fde38 to
adb596a
Compare
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
3b9bea5 to
4770985
Compare
4770985 to
8cf47c4
Compare
🟡 Playwright Results — all passed (10 flaky)✅ 4247 passed · ❌ 0 failed · 🟡 10 flaky · ⏭️ 87 skipped
🟡 10 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
8cf47c4 to
910bc7d
Compare
|
The Python checkstyle failed. Please run You can install the pre-commit hooks with |
- mlflow-skinny ~=3.6.0 -> >=3.10.0,<3.11 closes 9 high/critical Snyk CVEs. The mlflow integration test now passes --log-bin-trust-function-creators=1 to the MySQL container so mlflow 3.8.1+'s prevent_secrets_aad_mutation trigger creation succeeds without SUPER privilege. - Drop the setuptools<81 cap and move jaraco.context to >=6.1.0 (closes CVE-2026-23949). pkg_resources usage in connections/headers.py and db2/utils.py is migrated to importlib.metadata so the cap is no longer required (pkg_resources is removed in setuptools 81+).
|
The Python checkstyle failed. Please run You can install the pre-commit hooks with |
Code Review ✅ Approved 3 resolved / 3 findingsPatches high/critical Snyk vulnerabilities by upgrading Airflow and updating SAS client security configurations. Resolved findings regarding XSS and SSL verification, with remaining dependency constraints documented. ✅ 3 resolved✅ Quality: SSL verify config read at import time, not per-instance
✅ Bug: cryptography>=46.0.5 may conflict with snowflake-connector-python~=3.18.0
✅ Quality: mlflow revert drops 9 CVE fixes mentioned in PR title/description
OptionsDisplay: compact → Showing less information. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
|
|



Summary
Closes the high/critical findings from the Snyk ingestion-side scans that are actually fixable:
pkg_resourcesmigrationpython/XSSSnyk Code findingspython/SSLVerificationBypassSnyk Code findingpython/HardcodedNonCryptoSecretfindings via.snykexcludeCombined: 17 unique ingestion findings drop on
main(18 on1.13, which has one extra mlflowAccess Control Bypass).Changes (8 files)
ingestion/setup.py— Python dep bumpsmlflow-skinny ~=3.6.0→>=3.10.0,<3.11. Closes 9 of 14 mlflow-skinny CVEs (3 critical, 6 high). Stays below 3.11 to keep search/registry surface stable.jaraco.context==6.0.1→>=6.1.0. Closes CVE-2026-23949 (directory traversal).setuptools<81,>=78.1.1upper cap. No longer required at thesetup.pylayer oncepkg_resourcescallsites are gone.ingestion/Dockerfilekeeps its ownsetuptools<81pin as belt-and-suspenders, so the published image's setuptools state is unchanged.ingestion/src/metadata/ingestion/connections/headers.py+.../source/database/db2/utils.py— pkg_resources migrationBoth OSS callsites migrated to
importlib.metadata:pkg_resources.require("openmetadata-ingestion")[0].version→importlib.metadata.version("openmetadata-ingestion")pkg_resources.get_distribution("ibm_db")+pkg_resources.DistributionNotFound→importlib.metadata.distribution("ibm_db")+PackageNotFoundErrorimportlib.metadatais stdlib since 3.8 (our floor). Behavior identical. This unblocks thejaraco.contextbump —setuptools<81vendorsjaraco.context==5.3.0, so anypkg_resourceswalk in our code risked aContextualVersionConflictonce the user pin moved to 6.1.ingestion/tests/integration/sources/mlmodels/mlflow/conftest.py— MySQL trigger workaroundmlflow~=3.6.0→mlflow>=3.10.0,<3.11--log-bin-trust-function-creators=1to the testcontainer'smysqld. mlflow 3.8.1+ creates aprevent_secrets_aad_mutationtrigger at backend init; with binary logging on (mysql:8 default) the non-SUPERmlflowuser can't create it. The flag is test-scoped only —ingestion/tests/isn't COPYed into the published image, the testcontainers MySQL is torn down at the end of the test, and production OpenMetadata never touches a customer's mlflow backend (we connect to mlflow's REST API as a client).ingestion/.../source/database/sas/client.py— SSL verificationThe SAS Viya client previously hard-coded
verify=Falseon both the auth-token request and the long-livedTrackedRESTclient config. Default-secure toverify=True; allow operators to opt out viaOM_SAS_VERIFY_SSL=falsefor dev deployments with self-signed certs.openmetadata-airflow-apis/.../api/response.py+tests/.../test_airflow_ops.py— XSS closureApiResponse.standard_responsenow usesflask.jsonify+make_response. Functionally identical wire payload (stillContent-Type: application/json), but Snyk Code recognisesjsonifyas a safe JSON sink — closespython/XSSattrigger.py:68anddeploy.py:78. Integration test gets an explicit Flaskapp_contextpush/pop sincejsonifyneeds one..snyk— exclude SDK example placeholdersAdded
ingestion/src/metadata/sdk/examples/**to the global exclude (mirrors the existingingestion/examples/**entry). The 4 flagged "secrets" are placeholder strings likejwt_token="your jwt token"in SDK demo files — not real credentials, intentional template values.Not addressed (blocked or no upstream fix)
Blocked on a
collate-data-diff/collate-sqlfluffrelease — these Collate-owned pip packages cap deps we'd need to bump. Tracked as separate workstream, not in this PR's scope:urllib3highs (fix=2.7.0) —collate-data-diff==0.11.10declaresurllib3<2. Needs acollate-data-diffrelease with that cap relaxed.pyOpenSSLcritical (fix=26.0.0) andcryptographyhigh SNYK-CRYPTOGRAPHY-15263096 (fix=46.0.5) —collate-data-diff[snowflake]capssnowflake-connector-python<4.0.0, which viacffi<2blockscryptography>=46.snowflake-connector-python>=4.5.0lifts both (declarescryptography>=46.0.5,pyOpenSSL>=24.0.0with no upper).clickhigh (fix=8.3.3) —collate-sqlfluff==3.5.2declaresclick<=8.3.0. Needs acollate-sqlfluffrelease.Upstream-unfixed:
Missing Authentication for Critical Function(CVE-2026-0545) andUse of Default Credentials(CVE-2026-2635) —fixedIn: []upstream, server-side hardening concerns. Not version-fixable.Sensitive Info Exposure(fix=3.11.0rc0) andTemp File Insecure Permissions(fix=3.11.0rc1) — need mlflow 3.11+; deferred to keep<3.11surface stable.python/XSSfindings inpresidio_utils.py— false positives (factory functions registered viaclass_register, not HTTP handlers; returnEntityRecognizerinstances, never HTML). Recommend marking in Snyk UI.Test plan
pip install --dry-run -e ingestion/[all]resolves cleanly — picksmlflow-skinny-3.10.1,jaraco.context-6.1.2, no conflicts.pip install --dry-run -e OpenMetadata/ingestion -e ingestion-extension/[all](Collate companion path) resolves cleanly with the new pins.pkg_resourcescallsites remain iningestion/src/.make py_format_checkpasses (ruff lint + format).airflow-apis-tests+py-run-build-testsgreen on latest push.log_bin_trust_function_creators=1.main(18 on1.13).Companion Collate PR
https://github.com/open-metadata/openmetadata-collate/pull/4140 — closes 9
python/XSSfindings in thecollate-local-webserverroutes.