Skip to content

fix(ingestion): patch Snyk high/critical findings in deps and code - #28231

Merged
Khairajani merged 13 commits into
mainfrom
fix/ingestion-snyk-high-critical-vulns
May 25, 2026
Merged

Khairajani merged 13 commits into
mainfrom
fix/ingestion-snyk-high-critical-vulns

Conversation

@Khairajani

@Khairajani Khairajani commented May 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Closes the high/critical findings from the Snyk ingestion-side scans that are actually fixable:

  • 9 mlflow-skinny CVEs (3 critical, 6 high) via a Python pin bump
  • 1 jaraco.context high via pin bump + pkg_resources migration
  • Both airflow-apis python/XSS Snyk Code findings
  • 1 SAS connector python/SSLVerificationBypass Snyk Code finding
  • 4 SDK example python/HardcodedNonCryptoSecret findings via .snyk exclude

Combined: 17 unique ingestion findings drop on main (18 on 1.13, which has one extra mlflow Access Control Bypass).

Changes (8 files)

ingestion/setup.py — Python dep bumps

  • mlflow-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).
  • Drop the setuptools<81,>=78.1.1 upper cap. No longer required at the setup.py layer once pkg_resources callsites are gone. ingestion/Dockerfile keeps its own setuptools<81 pin 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 migration

Both 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") + PackageNotFoundError

importlib.metadata is stdlib since 3.8 (our floor). Behavior identical. This unblocks the jaraco.context bump — setuptools<81 vendors jaraco.context==5.3.0, so any pkg_resources walk in our code risked a ContextualVersionConflict once the user pin moved to 6.1.

ingestion/tests/integration/sources/mlmodels/mlflow/conftest.py — MySQL trigger workaround

  • Test mlflow image: mlflow~=3.6.0 → mlflow>=3.10.0,<3.11
  • Pass --log-bin-trust-function-creators=1 to the testcontainer's mysqld. mlflow 3.8.1+ creates a prevent_secrets_aad_mutation trigger at backend init; with binary logging on (mysql:8 default) the non-SUPER mlflow user 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 verification

The SAS Viya client previously hard-coded verify=False on both the auth-token request and the long-lived TrackedREST client config. Default-secure to verify=True; allow operators to opt out via OM_SAS_VERIFY_SSL=false for dev deployments with self-signed certs.

openmetadata-airflow-apis/.../api/response.py + tests/.../test_airflow_ops.py — XSS closure

ApiResponse.standard_response now uses flask.jsonify + make_response. Functionally identical wire payload (still Content-Type: application/json), but Snyk Code recognises jsonify as a safe JSON sink — closes python/XSS at trigger.py:68 and deploy.py:78. Integration test gets an explicit Flask app_context push/pop since jsonify needs one.

.snyk — exclude SDK example placeholders

Added ingestion/src/metadata/sdk/examples/** to the global exclude (mirrors the existing ingestion/examples/** entry). The 4 flagged "secrets" are placeholder strings like jwt_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-sqlfluff release — these Collate-owned pip packages cap deps we'd need to bump. Tracked as separate workstream, not in this PR's scope:

  • 4 urllib3 highs (fix=2.7.0) — collate-data-diff==0.11.10 declares urllib3<2. Needs a collate-data-diff release with that cap relaxed.
  • pyOpenSSL critical (fix=26.0.0) and cryptography high SNYK-CRYPTOGRAPHY-15263096 (fix=46.0.5) — collate-data-diff[snowflake] caps snowflake-connector-python<4.0.0, which via cffi<2 blocks cryptography>=46. snowflake-connector-python>=4.5.0 lifts both (declares cryptography>=46.0.5, pyOpenSSL>=24.0.0 with no upper).
  • click high (fix=8.3.3) — collate-sqlfluff==3.5.2 declares click<=8.3.0. Needs a collate-sqlfluff release.

Upstream-unfixed:

  • mlflow-skinny Missing Authentication for Critical Function (CVE-2026-0545) and Use of Default Credentials (CVE-2026-2635) — fixedIn: [] upstream, server-side hardening concerns. Not version-fixable.
  • mlflow-skinny Sensitive Info Exposure (fix=3.11.0rc0) and Temp File Insecure Permissions (fix=3.11.0rc1) — need mlflow 3.11+; deferred to keep <3.11 surface stable.
  • 6 python/XSS findings in presidio_utils.py — false positives (factory functions registered via class_register, not HTTP handlers; return EntityRecognizer instances, never HTML). Recommend marking in Snyk UI.
  • 24 of 25 OS-level Debian-12 CVEs in the ingestion Docker base have no Debian-12 fix available. Out of scope; needs a base-image bump.

Test plan

  • pip install --dry-run -e ingestion/[all] resolves cleanly — picks mlflow-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.
  • No pkg_resources callsites remain in ingestion/src/.
  • make py_format_check passes (ruff lint + format).
  • CI: airflow-apis-tests + py-run-build-tests green on latest push.
  • CI: mlflow MySQL integration test passes with mlflow 3.10.x + log_bin_trust_function_creators=1.
  • Snyk rescan confirms 17 unique findings drop on main (18 on 1.13).

Companion Collate PR

https://github.com/open-metadata/openmetadata-collate/pull/4140 — closes 9 python/XSS findings in the collate-local-webserver routes.

@Khairajani
Khairajani requested a review from a team as a code owner May 18, 2026 14:47
@github-actions

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

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)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gitar-bot is this an issue ?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. 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.

  2. The PR actually improves the situation — the change from raw json.dumps() + Response() to jsonify() + make_response() is a defensive improvement (correct Content-Type pinning, proper JSON serialization). It doesn't introduce new exposure paths.

  3. The error fields 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.

@Khairajani
Khairajani force-pushed the fix/ingestion-snyk-high-critical-vulns branch from 77fde38 to adb596a Compare May 18, 2026 15:11
@github-actions

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@github-actions

github-actions Bot commented May 18, 2026 •

Copy link
Copy Markdown
Contributor

🟡 Playwright Results — all passed (10 flaky)

✅ 4247 passed · ❌ 0 failed · 🟡 10 flaky · ⏭️ 87 skipped

Shard Passed Failed Flaky Skipped
✅ Shard 1 299 0 0 4
🟡 Shard 2 804 0 1 8
🟡 Shard 3 794 0 2 8
🟡 Shard 4 841 0 4 12
🟡 Shard 5 718 0 1 47
🟡 Shard 6 791 0 2 8
🟡 10 flaky test(s) (passed on retry)
  • Features/Glossary/GlossaryWorkflow.spec.ts › should display correct status badge color and icon (shard 2, 1 retry)
  • Features/Table.spec.ts › Table pagination with sorting should works (shard 3, 1 retry)
  • Features/UserProfileOnlineStatus.spec.ts › Should show online status badge on user profile for active users (shard 3, 1 retry)
  • Flow/PersonaDeletionUserProfile.spec.ts › User profile loads correctly before and after persona deletion (shard 4, 1 retry)
  • Flow/PersonaFlow.spec.ts › Set default persona for team should work properly (shard 4, 1 retry)
  • Pages/CustomProperties.spec.ts › Time (shard 4, 1 retry)
  • Pages/DataContracts.spec.ts › Create Data Contract and validate for File (shard 4, 1 retry)
  • Pages/ExplorePageRightPanel_KnowledgeCenter.spec.ts › Should remove user owner for knowledgeCenter (shard 5, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify lineage schema filter selection (shard 6, 1 retry)
  • Pages/ODCSImportExport.spec.ts › Multi-object ODCS contract - object selector shows all schema objects (shard 6, 1 retry)

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

@Khairajani
Khairajani force-pushed the fix/ingestion-snyk-high-critical-vulns branch from 8cf47c4 to 910bc7d Compare May 18, 2026 20:19
@github-actions

Copy link
Copy Markdown
Contributor

The Python checkstyle failed.

Please run make py_format and py_format_check in the root of your repository and commit the changes to this PR.
You can also use pre-commit to automate the Python code formatting.

You can install the pre-commit hooks with make install_test precommit_install.

Akash Verma and others added 3 commits May 21, 2026 22:22
- 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+).
@github-actions

Copy link
Copy Markdown
Contributor

The Python checkstyle failed.

Please run make py_format and py_format_check in the root of your repository and commit the changes to this PR.
You can also use pre-commit to automate the Python code formatting.

You can install the pre-commit hooks with make install_test precommit_install.

@gitar-bot

gitar-bot Bot commented May 25, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 3 resolved / 3 findings

Patches 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

📄 ingestion/src/metadata/ingestion/source/database/sas/client.py:33 📄 ingestion/src/metadata/ingestion/source/database/sas/client.py:50 📄 ingestion/src/metadata/ingestion/source/database/sas/client.py:178
_VERIFY_SSL is evaluated once at module import time (line 33). If the process hosts multiple SAS connections with different TLS requirements (e.g., one self-signed, one CA-signed), they cannot be configured independently. More importantly, since SASConnection lacks a verifySSL schema field, the env-var approach is reasonable for now but ideally should be promoted to a proper connection-model field (like other connectors use) so it's configurable per service in the UI.

This is non-blocking since it's already an improvement over the previous hard-coded verify=False.

✅ Bug: cryptography>=46.0.5 may conflict with snowflake-connector-python~=3.18.0

📄 ingestion/setup.py:147 📄 ingestion/setup.py:181
The PR description explicitly lists cryptography>=46.0.5 under "Not addressed (blocked)" because snowflake-connector-python<4.0.0 (via cffi<2) prevents cryptography>=46. However, this commit bumps cryptography to >=46.0.5 while snowflake-connector-python~=3.18.0 remains in base_requirements (line 181). If the blocker described in the PR description is still accurate, this will cause a dependency resolution failure at install time.

Please verify:

  1. That pip install --dry-run actually resolves cleanly with both constraints present (snowflake-connector-python recent patch releases may have relaxed the cffi cap).
  2. Update the PR description's "Not addressed" section to remove cryptography if it is in fact fixable now, to avoid confusion for future readers.
✅ Quality: mlflow revert drops 9 CVE fixes mentioned in PR title/description

📄 ingestion/setup.py:327
The delta reverts the mlflow-skinny bump back to ~=3.6.0, which re-opens the 9 high/critical CVEs that the PR description claims to close. The PR title says "patch Snyk high/critical vulnerabilities" and the summary table lists mlflow as a key change. The description and commit message should be updated to reflect that this fix was reverted due to the MySQL SUPER-privilege regression, so the final state of the PR is clear to reviewers and the Snyk dashboard operators.

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@sonarqubecloud

Copy link
Copy Markdown

@sonarqubecloud

Copy link
Copy Markdown

This branch was previously deployed

1 inactive deployment
test — 541609ec Deployed May 25, 2026 by Khairajani via playwright-ci-postgresql (5, 6) #48412
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants