René's URL Explorer Experiment


Title: CHORE: add mock TDS FedAuth regression test + CI install for deferred access-token UAF (#594/#596) by saurabh500 · Pull Request #652 · microsoft/mssql-python · GitHub

Open Graph Title: CHORE: add mock TDS FedAuth regression test + CI install for deferred access-token UAF (#594/#596) by saurabh500 · Pull Request #652 · microsoft/mssql-python

X Title: CHORE: add mock TDS FedAuth regression test + CI install for deferred access-token UAF (#594/#596) by saurabh500 · Pull Request #652 · microsoft/mssql-python

Description: Work Item / Issue Reference GitHub Issue: #594 (fixed by #596) Summary Adds tests/test_024_mock_tds_fedauth.py, an integration test that uses the mssql-mock-tds in-process TDS server to guard the deferred connect-attribute use-after-free fixed in #596 (issue #594), and wires the mock server install into the PR-validation pipeline so the test actually runs (instead of skipping) on every test leg. Why SQL_COPT_SS_ACCESS_TOKEN (1256) is a deferred ODBC connect attribute: the MS ODBC driver stashes the caller's pointer at SQLSetConnectAttr time and only dereferences it later, during SQLDriverConnect, to build the FedAuth Login7 packet. PR #568 briefly copied the value into a stack-local buffer that was freed before that deferred read — a use-after-free that variously produced SIGBUS, a server reset, or "Authentication token is missing in the federated authentication message." PR #596 fixed it by storing the value in Connection-owned member buffers. This regression is invisible to ordinary unit tests because it only manifests once a real driver actually transmits the token to a server. The mock TDS server gives us exactly that: it records the access token it received in the Login7 FedAuth feature. What the test does For each case it sets attrs_before={SQL_COPT_SS_ACCESS_TOKEN: token_struct}, lets the real ODBC driver transmit the token to the mock server, and asserts the server captured the exact token. If the deferred buffer is ever corrupted again, the captured token won't match (or won't arrive) and the test fails. test_access_token_round_trips_to_server — direct guard: exact byte-for-byte round-trip. test_unique_access_token_transmitted_exactly — random unguessable token rules out any cached/constant fallback. test_distinct_tokens_on_sequential_connects — two sequential connects with different tokens, exercising the per-attribute owned buffers from #596. CI integration Adds a reusable install step (eng/pipelines/steps/install-mock-tds.yml, backed by install-mock-tds.{sh,ps1} and pinned via eng/versions/mssql-mock-tds.version), mirroring the existing install-mssql-py-core pattern. It installs mssql-mock-tds + cryptography from the public mssql-rs_Public feed and is referenced from every test leg (Windows, macOS, and all Linux containers incl. Alpine/musl and ARM64). The scripts are best-effort: if a compatible wheel is ever missing or the sandbox feed is unavailable, they emit a pipeline warning and exit 0, so the leg stays green and the test simply skips there. Notes Opt-in / skips cleanly when mssql-mock-tds or cryptography aren't installed, so it won't break CI legs that don't install the mock. The mock package currently lives on the mssql-rs_Public sandbox feed (from draft microsoft/mssql-rs#80): pip install --index-url https://pkgs.dev.azure.com/sqlclientdrivers/public/_packaging/mssql-rs_Public/pypi/simple/ mssql-mock-tds Generates a throwaway TLS identity in a temp dir (the mock requires TLS for FedAuth) — no certs/artifacts land in the repo. The driver's connect still times out (the mock doesn't complete the full handshake); that is expected and intentionally not asserted on — only the captured token matters, and it has already been transmitted by then. A short login timeout keeps the tests fast (~13s total). Validation Built the ddbc_bindings extension locally from this branch's source and ran the suite: 3 passed. NoteDraft pending the mssql-mock-tds package being published to a stable feed (currently sandbox-only via microsoft/mssql-rs#80). Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

Open Graph Description: Work Item / Issue Reference GitHub Issue: #594 (fixed by #596) Summary Adds tests/test_024_mock_tds_fedauth.py, an integration test that uses the mssql-mock-tds in-process TDS server to guard th...

X Description: Work Item / Issue Reference GitHub Issue: #594 (fixed by #596) Summary Adds tests/test_024_mock_tds_fedauth.py, an integration test that uses the mssql-mock-tds in-process TDS server to guard th...

Opengraph URL: https://github.com/microsoft/mssql-python/pull/652

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/commits/:range(.:format)
route-controllerpull_requests
route-actioncommits
fetch-noncev2:8c9ab702-64a5-1ba3-10bb-39b34a39d41d
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id9898:1EFF29:2079BAB:2BE5725:6A655881
html-safe-nonce6ba3c5fe403958b578777c994e247f859d1c294c8dbe14ebcddb99316b19ceea
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5ODk4OjFFRkYyOToyMDc5QkFCOjJCRTU3MjU6NkE2NTU4ODEiLCJ2aXNpdG9yX2lkIjoiMjY2NDg2MDU1MTMzNzA0MDAwMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac316ba64a3a9b0770a8360802e120ec89c48c303cd79f94068fede6ced05b60a9
hovercard-subject-tagpull_request:3960566134
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/commits
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/microsoft/mssql-python/pull/652/commits/af9a5fce6c45fb15ae0fab2417cf95e9d85a8d42
twitter:imagehttps://avatars.githubusercontent.com/u/1623701?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/1623701?s=400&v=4
og:image:altWork Item / Issue Reference GitHub Issue: #594 (fixed by #596) Summary Adds tests/test_024_mock_tds_fedauth.py, an integration test that uses the mssql-mock-tds in-process TDS server to guard th...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None52c76df668885aaff23b50bdca1fa1ea44ac9c1553e888ebc70ff1e4daa4625b
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/microsoft/mssql-python git https://github.com/microsoft/mssql-python.git
octolytics-dimension-user_id6154722
octolytics-dimension-user_loginmicrosoft
octolytics-dimension-repository_id921684538
octolytics-dimension-repository_nwomicrosoft/mssql-python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id921684538
octolytics-dimension-repository_network_root_nwomicrosoft/mssql-python
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release309153364422b3c499922d1a2a6404910a58ed8e
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/microsoft/mssql-python/pull/652/commits/af9a5fce6c45fb15ae0fab2417cf95e9d85a8d42#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fmssql-python%2Fpull%2F652%2Fcommits%2Faf9a5fce6c45fb15ae0fab2417cf95e9d85a8d42
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
Code QualityEnforce quality at mergehttps://github.com/features/code-quality
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fmssql-python%2Fpull%2F652%2Fcommits%2Faf9a5fce6c45fb15ae0fab2417cf95e9d85a8d42
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Fcommits&source=header-repo&source_repo=microsoft%2Fmssql-python
Reloadhttps://github.com/microsoft/mssql-python/pull/652/commits/af9a5fce6c45fb15ae0fab2417cf95e9d85a8d42
Reloadhttps://github.com/microsoft/mssql-python/pull/652/commits/af9a5fce6c45fb15ae0fab2417cf95e9d85a8d42
Reloadhttps://github.com/microsoft/mssql-python/pull/652/commits/af9a5fce6c45fb15ae0fab2417cf95e9d85a8d42
Please reload this pagehttps://github.com/microsoft/mssql-python/pull/652/commits/af9a5fce6c45fb15ae0fab2417cf95e9d85a8d42
microsoft https://github.com/microsoft
mssql-pythonhttps://github.com/microsoft/mssql-python
Notifications https://github.com/login?return_to=%2Fmicrosoft%2Fmssql-python
Fork 51 https://github.com/login?return_to=%2Fmicrosoft%2Fmssql-python
Star 451 https://github.com/login?return_to=%2Fmicrosoft%2Fmssql-python
Code https://github.com/microsoft/mssql-python
Issues 42 https://github.com/microsoft/mssql-python/issues
Pull requests 28 https://github.com/microsoft/mssql-python/pulls
Discussions https://github.com/microsoft/mssql-python/discussions
Actions https://github.com/microsoft/mssql-python/actions
Projects https://github.com/microsoft/mssql-python/projects
Models https://github.com/microsoft/mssql-python/models
Wiki https://github.com/microsoft/mssql-python/wiki
Security and quality 0 https://github.com/microsoft/mssql-python/security
Insights https://github.com/microsoft/mssql-python/pulse
Code https://github.com/microsoft/mssql-python
Issues https://github.com/microsoft/mssql-python/issues
Pull requests https://github.com/microsoft/mssql-python/pulls
Discussions https://github.com/microsoft/mssql-python/discussions
Actions https://github.com/microsoft/mssql-python/actions
Projects https://github.com/microsoft/mssql-python/projects
Models https://github.com/microsoft/mssql-python/models
Wiki https://github.com/microsoft/mssql-python/wiki
Security and quality https://github.com/microsoft/mssql-python/security
Insights https://github.com/microsoft/mssql-python/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fmicrosoft%2Fmssql-python%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fmicrosoft%2Fmssql-python%2Fissues%2Fnew%2Fchoose
saurabh500https://github.com/saurabh500
mainhttps://github.com/microsoft/mssql-python/tree/main
dev/saurabh/mock-tds-fedauth-testhttps://github.com/microsoft/mssql-python/tree/dev/saurabh/mock-tds-fedauth-test
Conversation 4 https://github.com/microsoft/mssql-python/pull/652
Commits 14 https://github.com/microsoft/mssql-python/pull/652/commits
Checks 29 https://github.com/microsoft/mssql-python/pull/652/checks
Files changed https://github.com/microsoft/mssql-python/pull/652/files
Please reload this pagehttps://github.com/microsoft/mssql-python/pull/652/commits/af9a5fce6c45fb15ae0fab2417cf95e9d85a8d42
CHORE: add mock TDS FedAuth regression test + CI install for deferred access-token UAF (#594/#596) https://github.com/microsoft/mssql-python/pull/652/commits/af9a5fce6c45fb15ae0fab2417cf95e9d85a8d42#top
Show all changes 14 commits https://github.com/microsoft/mssql-python/pull/652/files
153eff7 test: add mock TDS FedAuth regression test for deferred access-token … saurabh500 Jun 30, 2026 https://github.com/microsoft/mssql-python/pull/652/commits/153eff7210d676d238f2f8aeb8f17c0c2ea3544d
331a83f ci: install mssql-mock-tds in PR validation pipeline so the mock TDS … saurabh500 Jun 30, 2026 https://github.com/microsoft/mssql-python/pull/652/commits/331a83fe566c72de18cfef0545dd0e855ed672aa
3e5da91 ci: bump mssql-mock-tds to 0.1.0.dev20260630158879 (adds musllinux/Al… saurabh500 Jun 30, 2026 https://github.com/microsoft/mssql-python/pull/652/commits/3e5da9196ce5ae768c3e4dbc1b3a6cdfdbf85982
7fbdf1a style: apply black formatting to test_024_mock_tds_fedauth.py saurabh500 Jun 30, 2026 https://github.com/microsoft/mssql-python/pull/652/commits/7fbdf1a2864d7828caa9c3e9613c1aff9193fde0
dfa8685 FIX: emit PEM identity on non-Windows so mock TDS TLS loads on macOS saurabh500 Jun 30, 2026 https://github.com/microsoft/mssql-python/pull/652/commits/dfa8685007ad6c67e1d9c0cbbd7fa5828c58ddfd
3d601c5 FIX: drop non-deterministic last-token assertion in sequential-connec… saurabh500 Jun 30, 2026 https://github.com/microsoft/mssql-python/pull/652/commits/3d601c53d959e14bfd389e6a8e5ab8c0ba70161e
63c77f6 FIX: bump mock-tds to 0.1.0.dev20260701159015 and disable pooling in … saurabh500 Jul 2, 2026 https://github.com/microsoft/mssql-python/pull/652/commits/63c77f6b0d043633d01561b64a2541a6e8d29a0e
af9a5fc FIX: bump mock-tds to 0.1.0.dev20260702159138 saurabh500 Jul 2, 2026 https://github.com/microsoft/mssql-python/pull/652/commits/af9a5fce6c45fb15ae0fab2417cf95e9d85a8d42
ce139c8 test: make sequential-token test pooling-safe with two mock servers saurabh500 Jul 2, 2026 https://github.com/microsoft/mssql-python/pull/652/commits/ce139c808f72150aa5c9adf1921bf4db1b8914f7
1ef930e ci: install mssql-mock-tds via requirements file instead of wrapper s… saurabh500 Jul 2, 2026 https://github.com/microsoft/mssql-python/pull/652/commits/1ef930e4f32d7725faa6bbb0630c716229eda163
4095df7 Merge branch 'main' into dev/saurabh/mock-tds-fedauth-test saurabh500 Jul 2, 2026 https://github.com/microsoft/mssql-python/pull/652/commits/4095df7030d8d39904a67ee85e19331cb85ed5e6
389041b test: skip mock-TDS FedAuth tests on macOS (SecureTransport TLS interop) saurabh500 Jul 6, 2026 https://github.com/microsoft/mssql-python/pull/652/commits/389041bade6f157ab95643efc72c5d30798d4780
8cc7594 Merge branch 'main' into dev/saurabh/mock-tds-fedauth-test saurabh500 Jul 6, 2026 https://github.com/microsoft/mssql-python/pull/652/commits/8cc7594ceefce2f76f52887c43f452b06aa24487
bbbe7c2 ci: rename mock-tds install to a general 'install test dependencies' … saurabh500 Jul 6, 2026 https://github.com/microsoft/mssql-python/pull/652/commits/bbbe7c24e6240da37f7cf448b1b955ed275cfad8
Clear filters https://github.com/microsoft/mssql-python/pull/652/commits/af9a5fce6c45fb15ae0fab2417cf95e9d85a8d42
Please reload this pagehttps://github.com/microsoft/mssql-python/pull/652/commits/af9a5fce6c45fb15ae0fab2417cf95e9d85a8d42
Please reload this pagehttps://github.com/microsoft/mssql-python/pull/652/commits/af9a5fce6c45fb15ae0fab2417cf95e9d85a8d42
Prev https://github.com/microsoft/mssql-python/pull/652/commits/63c77f6b0d043633d01561b64a2541a6e8d29a0e
Next https://github.com/microsoft/mssql-python/pull/652/commits/ce139c808f72150aa5c9adf1921bf4db1b8914f7
Please reload this pagehttps://github.com/microsoft/mssql-python/pull/652/commits/af9a5fce6c45fb15ae0fab2417cf95e9d85a8d42
https://github.com/saurabh500
https://github.com/apps/github-copilot-cli
saurabh500https://github.com/microsoft/mssql-python/commits?author=saurabh500
Copilothttps://github.com/microsoft/mssql-python/commits?author=Copilot
eng/versions/mssql-mock-tds.versionhttps://github.com/microsoft/mssql-python/pull/652/commits/af9a5fce6c45fb15ae0fab2417cf95e9d85a8d42#diff-9cf25704eaad1482e552d31ef7004262babc9b49a644213ae2bb802721f7bbbf
View file https://github.com/microsoft/mssql-python/blob/af9a5fce6c45fb15ae0fab2417cf95e9d85a8d42/eng/versions/mssql-mock-tds.version
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/microsoft/mssql-python/pull/652/commits/{{ revealButtonHref }}
Please reload this pagehttps://github.com/microsoft/mssql-python/pull/652/commits/af9a5fce6c45fb15ae0fab2417cf95e9d85a8d42
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.