Skip to content

Upgrade vulnerable dependencies and require Python 3.10+ - #672

Open
Aasav Badera (aasavbadera) wants to merge 4 commits into
masterfrom
aasavbadera/python-sdk-package-security-upgrades
Open

Aasav Badera (aasavbadera) wants to merge 4 commits into
masterfrom
aasavbadera/python-sdk-package-security-upgrades

Conversation

@aasavbadera

@aasavbadera Aasav Badera (aasavbadera) commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Changed

  • Breaking: require Python 3.10 or newer. Patched aiohttp, requests, urllib3, OpenTelemetry, and pytest releases no longer support Python 3.9. Update workspace/package metadata, classifiers, CI, release automation, and documentation together.
  • Refresh the lockfile with patched dependencies, keeping the OpenTelemetry SDK and Azure Monitor exporter aligned:
Dependency Updated version
aiohttp 3.14.5
cryptography 50.0.2
opentelemetry-api / opentelemetry-sdk 1.45.2
pytest 9.2.0
requests 2.34.2
urllib3 2.8.0
azure-monitor-opentelemetry-exporter 1.0.0b59

Fixed

  • Raise the published requests and optional aiohttp minimums to patched releases.
  • Align standalone quick-start requirements with the workspace, replacing the vulnerable tqdm~=4.64.0 range with tqdm~=4.67.1 and updating the OpenTelemetry requirements.
  • Use aiohttp's ClientTimeout while preserving existing default and per-request timeout values.
  • Supply aiohttp's new stream-writer argument through a shared test-only response fixture because the released aioresponses version does not yet support it. Keep urllib3's existing socket-option behavior with narrowly scoped annotations for its nested ClassVar/Final typing issue.

Validation

  • Python 3.10 and 3.13: 292 passed, 26 skipped on each, excluding service-backed E2E suites.
  • Ruff formatting and lint checks passed.
  • basedpyright --level error passed.
  • uv build --all-packages produced both SDK wheels and source distributions; built package metadata requires Python 3.10.
  • uv pip check passed in both environments.
  • Verified updated locked versions against the affected advisory ranges and checked quick-start tracing initialization.

Service-backed E2E tests were not run locally.

Replaces #671 with the same validated changes, now proposed from a branch in Azure/azure-kusto-python rather than a fork.

Review follow-up (7b8702e)

  • Require urllib3>=2.8.0 in published data SDK dependencies, rather than relying only on the workspace lockfile.
  • Require azure-kusto-data>=7.0.0 from ingest so an ingest-only upgrade cannot retain the older dependency bounds. Prepare coordinated SDK/workspace version 7.0.0 for the existing breaking Python baseline change; 6.0.5 is already published. Align standalone quick-start with the patched 7.x SDKs.
  • Regenerate the lockfile with all 68 registry package entries unchanged.
  • Validation: 95 focused Python 3.10 tests passed; Ruff format/lint and basedpyright passed; both SDK wheels and source distributions built with the required bounds; installed compatibility and ingest-wheel installation dry-run passed; resolver checks explicitly rejected old urllib3 and data SDK combinations.

Cryptography review follow-up (b0f47c4)

  • Enforce cryptography>=50.0.2 in published data dependencies; ingest inherits the patched minimum through azure-kusto-data>=7.0.0.
  • Regenerate lock metadata with all 68 registry package entries unchanged.
  • Validation: 26 focused authentication/token-provider/ingest tests passed, 10 optional tests skipped; both SDK wheels/source distributions rebuilt; metadata and resolver checks enforce the minimum; wheel installation dry-runs and installed compatibility passed; Ruff format/lint and basedpyright passed.

Refresh targeted dependency versions, align quick-start requirements, and preserve HTTP client behavior with updated dependency APIs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 6c5b6723-4f79-4478-872c-95f1d12e2653

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Published dependency bounds still permit vulnerable urllib3 versions, and ingest upgrades can retain an older data package, leaving clients exposed despite the patched workspace lockfile.

2 open issues
What changed in this PR

This PR moves the Kusto Python SDK workspace to Python 3.10+ and updates dependencies to address security advisories, with matching changes to packaging, automation, documentation, and async compatibility.

Changes:

  • Raise Python requirements across SDK packages, tooling, CI, and release automation.
  • Refresh dependency versions and align standalone quick-start requirements.
  • Adopt aiohttp’s ClientTimeout and update response mocks and timeout tests.
File Description
README.md Document the Python 3.10 minimum.
quick-start/​requirements.txt Update tracing dependencies and tqdm.
quick-start/​README.md Update Python prerequisites.
quick-start/​pyproject.toml Align Python and tracing dependency requirements.
pyproject.toml Update workspace Python, pytest, and analysis settings.
CONTRIBUTING.md Document the revised CI matrix and concurrency.
conftest.py Add a shared aiohttp response compatibility fixture.
CHANGELOG.md Record the breaking Python minimum and security updates.
azure-kusto-ingest/​tests/​test_e2e_retry.py Use the compatible async response fixture.
azure-kusto-ingest/​pyproject.toml Require Python 3.10 and remove the 3.9 classifier.
azure-kusto-data/​tests/​aio/​test_kusto_client.py Adapt response mocks and verify timeout values.
azure-kusto-data/​pyproject.toml Raise Python, Requests, and optional aiohttp minimums.
azure-kusto-data/​azure/​kusto/​data/​client.py Add targeted typing suppressions without changing socket behavior.
azure-kusto-data/​azure/​kusto/​data/​aio/​client.py Pass request timeouts through ClientTimeout.
.github/​workflows/​release.yml Build releases with Python 3.10.
.azuredevops/​build.yml Remove Python 3.9 jobs and move documentation generation to 3.10.

Review effort: Max

Comment thread azure-kusto-data/pyproject.toml Resolved
Comment thread azure-kusto-ingest/pyproject.toml Resolved
Require urllib3>=2.8.0 in data and azure-kusto-data>=7.0.0 in ingest.
Prepare coordinated 7.0.0 versions for the existing breaking Python change
and align standalone quick-start SDK bounds. Regenerate uv.lock without
changing registry package versions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 6c5b6723-4f79-4478-872c-95f1d12e2653

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Published SDK upgrades can retain vulnerable cryptography versions because package dependencies do not enforce a patched minimum and the workspace lockfile does not constrain wheel installations.

1 open issue
2 resolved since last review

Review effort: Max

Comment thread azure-kusto-data/pyproject.toml Resolved
Require cryptography>=50.0.2 in the published data package so data and
ingest upgrades cannot retain vulnerable transitive versions. Regenerate
lock metadata without changing registry package versions and document
the enforced published minimum.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 6c5b6723-4f79-4478-872c-95f1d12e2653

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The published dependencies still permit vulnerable certifi versions, potentially exposing Kusto bearer tokens to HTTPS interception.

1 open issue
1 previously missed issue

In code that hasn't changed since last review

High severity Set a secure minimum certifi version in published dependencies

azure-kusto-data/​pyproject.toml:14

Even Requests 2.34.2 allows certifi>=2023.5.7, so upgrading the published SDK can retain a vulnerable CA bundle despite the patched workspace lockfile. With a version before 2026.10.18, an on-path attacker holding a compromised intermediate key can intercept HTTPS traffic, including Kusto bearer tokens (GHSA-6q48-6c7w-9gw2). Add certifi>=2026.10.19 to the published data dependencies and regenerate the lock metadata; ingest will inherit the floor through data.

1 resolved since last review

Review effort: Max

Comment thread README.md Resolved
Update minimum requirements for Windows and macOS.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Human assessment is needed because an unpublished dependency-extra finding indicates that installing azure-kusto-ingest[aio] may retain a vulnerable aiohttp version or omit it entirely.

No open issues 🎉

1 resolved since last review

Review effort: Max

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants