[FIX] Upgrade snowflake-connector-python to 4.x to unblock cryptography 48.0.0 (CVE fixes)#2018
Conversation
…hy 48.0.0 (CVE fixes) snowflake-connector-python ~=3.14.0 pinned cffi<2.0.0, which conflicted with cryptography 46.0.1+ requiring cffi>=2.0.0. This capped cryptography at 46.0.0 in every module pulling unstract-connectors (backend, workers, connectors, root), leaving them on a version below the CVE fixes in 46.0.5/46.0.6/46.0.7 (CVE-2026-26007, CVE-2026-34073, CVE-2026-39892). snowflake 4.x drops the cffi dependency entirely and itself requires cryptography>=46.0.5, so bumping it lifts the cap. Re-locked all modules to cryptography 48.0.0 / cffi 2.0.0, eliminating version divergence. Fixes #2016
WalkthroughBumps ChangesDependency Upgrades
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
| Filename | Overview |
|---|---|
| unstract/connectors/pyproject.toml | Upgrades snowflake-connector-python from ~=3.14.0 to ~=4.6.0, which drops the cffi<2.0.0 cap and enables cryptography 48.0.0 across the codebase. |
| backend/pyproject.toml | Raises cryptography floor from >=41.0.7 to >=48.0.0, aligning with platform-service and pulling in three CVE fixes (CVE-2026-26007, CVE-2026-34073, CVE-2026-39892). |
| unstract/flags/pyproject.toml | Lowers protobuf minimum from >=6.33.5 to >=4.25.0 — change is undocumented in the PR; the root workspace lock resolves to 4.25.9, which is below the previous floor. |
| unstract/connectors/uv.lock | Locks snowflake-connector-python to 4.6.0, cryptography to 48.0.0, and cffi to 2.0.0 — consistent with pyproject.toml changes. |
| backend/uv.lock | Re-locks cryptography to 48.0.0 and cffi to 2.0.0, consistent with the raised floor in pyproject.toml. |
| uv.lock | Root workspace lock updated to cryptography 48.0.0 and cffi 2.0.0 uniformly across all member packages. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["snowflake-connector-python 3.14.x\ncffi < 2.0.0 (hard cap)"] -->|"blocks"| B["cryptography capped at 46.0.0\n(CVE-2026-26007, CVE-2026-34073, CVE-2026-39892 unpatched)"]
C["snowflake-connector-python 4.6.0\nno cffi dependency"] -->|"unblocks"| D["cryptography 48.0.0\ncffi 2.0.0\n(all three CVEs patched)"]
D --> E["backend\ncryptography floor ≥48.0.0"]
D --> F["unstract/connectors\ncryptography 48.0.0 locked"]
D --> G["all 10 modules\nuniform 48.0.0"]
H["unstract/flags/pyproject.toml\nprotobuf ≥6.33.5 → ≥4.25.0\n⚠️ undocumented change"] -.->|"root workspace resolves\nto 4.25.9"| G
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
unstract/flags/pyproject.toml:8
**Unexplained protobuf floor downgrade**
The minimum `protobuf` version was lowered from `>=6.33.5` to `>=4.25.0`, but this change is not mentioned anywhere in the PR description. The previous floor of `6.33.5` presumably existed for a reason (it was set deliberately). Dropping it to `4.25.0` allows protobuf versions that pre-date `6.x` fixes to satisfy the constraint. The flags-package lock file still resolves to `6.33.5` in isolation, but any downstream environment that resolves this package against the root workspace (which locks to `4.25.9`) will now install the older version without a version-floor guard. Please clarify whether this change was intentional or a side-effect of the locking run.
Reviews (3): Last reviewed commit: "Fix protobuf conflict blocking lock reso..." | Re-trigger Greptile
jaseemjaskp
left a comment
There was a problem hiding this comment.
Automated dependency-correctness review (PR is lock-file + version-bump only; no application code changed, so the code/type/test/comment review agents have no in-scope surface). Verified: (1) cryptography is uniformly 48.0.0, cffi 2.0.0, snowflake 4.6.0, pyOpenSSL 26.2.0 across all 9 changed locks; (2) no other repo module pins a vulnerable cryptography — every uv.lock that has cryptography is at 48.0.0 (platform-service already was), and the 6 locks without it genuinely have no cryptography dep; (3) snowflake 4.6.0 drops cffi from its dep tree (confirmed in the lock) and the connector code uses only the stable DB-API surface (connect/cursor/execute/commit/errors.ProgrammingError.msg/.errno); (4) pandas 2.1.4 (<2.2.0) and numpy 1.26.4 (<2.0.0) satisfy existing constraints; (5) backend's only direct cryptography use is Fernet/InvalidToken (stable in 48.0.0). Two minor notes inline. Note: the 2026 CVE IDs are past my knowledge cutoff and were not independently verified — but the remediation logic (48.0.0 > 46.0.7 supersedes all three fixes) is sound regardless.
unstract-flags pinned protobuf>=6.33.5 (over-aggressive dependabot bump in #2017), which conflicts with google-cloud-bigquery==3.11.4 (caps protobuf<5) in every module pulling both flags and connectors (root, backend, workers), making uv lock unsatisfiable. The flipt gRPC stubs use the protobuf 4.x+ _builder API and egg-info declares protobuf>=4.25.0, so revert the floor to >=4.25.0 (no code requires protobuf>=5.26). Avoids forcing protobuf 6, which would otherwise downgrade opentelemetry 1.34->1.11. Also raise backend cryptography floor >=46.0.7 -> >=48.0.0 to genuinely align with platform-service, and re-lock all stale modules.
|
Unstract test resultsPer-group results
Critical paths
|



What
Upgrades
snowflake-connector-python~=3.14.0→~=4.6.0and re-locks every module to cryptography48.0.0/ cffi2.0.0, eliminating cryptography version divergence across the repo and clearing three CVEs in the modules that were stuck below the fix.Fixes #2016 (follow-up to the review on the merged #2011).
Why
snowflake-connector-python ~=3.14.0pinscffi>=1.9,<2.0.0, whilecryptography 46.0.1+requirescffi>=2.0.0. These are mutually exclusive, so every module pullingunstract-connectors(→ snowflake) —backend,workers,unstract/connectors, and the root project — was hard-capped at cryptography46.0.0, the only46.xstill compatible withcffi 1.x. That left them below the security fixes shipped in:46.0.546.0.646.0.7Attempting to set
backend/pyproject.tomltocryptography>=46.0.7made the project unresolvable (uv lockfailed) because of the snowflakecffipin.How
unstract/connectors/pyproject.toml:snowflake-connector-python[pandas]~=3.14.0→~=4.6.0. Snowflake 4.x drops thecffidependency entirely and itself requirescryptography>=46.0.5, so the cap is lifted.backend/pyproject.toml: cryptography floor>=41.0.7→>=48.0.0(genuinely aligns withplatform-service, which is already>=48.0.0).unstract/flags/pyproject.toml:protobuffloor>=6.33.5→>=4.25.0. See "protobuf conflict" below.48.0.0(latest secure release, supersedes 46.0.7) withcffi 2.0.0everywhere; snowflake4.6.0in the snowflake-bound modules.protobuf conflict (surfaced after merging
main)Merging
mainpulled in #2017 (a dependabot bump), which had raisedunstract-flags' floor toprotobuf>=6.33.5. That conflicts withgoogle-cloud-bigquery==3.11.4(capsprotobuf<5, viaunstract-connectors), makinguv lockunsatisfiable in every module pulling both packages (root,backend,workers) — this is what made theUpdate UV lock,build, andtestchecks fail.The
protobuf>=6.33.5floor was over-aggressive: the flipt gRPC stubs (flipt_simple_pb2.py) use the protobuf-4.x+_builderAPI, the package'segg-infodeclaresprotobuf>=4.25.0, and no code in the repo requiresprotobuf>=5.26(noruntime_versionchecks). Reverting the floor to>=4.25.0resolves the conflict with zero resolved-package-version changes — it avoids forcingprotobuf 6, which would otherwise have required bumpinggoogle-cloud-bigquery/google-cloud-secret-managerand downgradedopentelemetry 1.34 → 1.11.Can this PR break any existing features. If yes, please list possible items. If no, please explain why. (PS: Admins do not merge the PR without this section filled)
Low risk, but it is a two-major-version snowflake jump and a cryptography major bump, so worth a smoke test:
connect(user, password, account, database, schema, warehouse, role),cursor(),execute(),commit(),errors.ProgrammingError.msg/.errno). All verified present/unchanged in 4.6.0 andSnowflakeDBimports cleanly. The live integration test needs real credentials, so a manual smoke test against a real Snowflake account is recommended before merge.Fernet/InvalidToken(adapter credential encryption); verified an encrypt/decrypt +InvalidTokenroundtrip on 48.0.0. 48.0.0 drops Python 3.8 support (all modules pin>=3.12,<3.13, so unaffected).pandasextra (pandas<3.0.0,>=1.0.0) is compatible with the existingnumpy<2.0.0, pandas<2.2.0constraint; all modules passuv lock --check.protobuf 4.25.x(connectors-bound modules) andprotobuf 6.33.5(flags standalone), andopentelemetrystays at1.34.Database Migrations
None.
Env Config
None.
Relevant Docs
Related Issues or PRs
Dependencies Versions
snowflake-connector-python3.14.x→4.6.0cryptography→48.0.0(was46.0.0/45.0.7/41.0.7in lagging modules)cffi→2.0.0(was1.17.1)pyOpenSSL→26.2.0(transitive)Notes on Testing
uv lock --checkpasses for all 10 modules.snowflake 4.6.0API surface,SnowflakeDBimport, andFernetroundtrip on cryptography 48.0.0.Screenshots
Checklist
I have read and understood the Contribution Guidelines.