Repository navigation
Return safe plain-text OAuth callback errors - #1905
Open
Paul Lizer (paullizer) wants to merge 2 commits into
Open
Paul Lizer (paullizer) wants to merge 2 commits into
Paul Lizer (paullizer) wants to merge 2 commits into
Conversation
Return a stable plain-text HTTP 400 for provider errors in both registered callbacks, with safe server-side diagnostics. Preserve login, Teams, and independent Microsoft 365 flows with offline runtime regressions; repair the approved stale M365 test stub and finalize app version 0.261.423. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Add the assigned v0.261.423 Bug Fix release note and historical non-closing Refs #1903 reference, regenerate split release pages without dropping source history, and remove the redundant test settings wrapper reported by CodeQL. Keep production code and the application version unchanged from the original fix. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/getATokenand/getATokenApinow return an explicittext/plain; charset=utf-8HTTP 400 with the stable messageLogin failed. Please try signing in again.Provider text is not reflected;[AUTH_CALLBACK]diagnostics contain only a recognized error code, the callback path, and description-presence metadata.0.261.423version bump; the follow-up contains only an equivalent test-fixture simplification and assigned release/reference documentation.Linked issue
Refs #1903 — historical, non-closing reference to the Development integration baseline. No new issue was requested or created.
Release Notes & Latest Features
Is this visible to end users?
Is this admin-facing (Admin Settings, governance, deployment, config)?
Should this become a Latest Feature card?
Screenshot needed for the card?
Version bump
application/single_app/config.pyVERSIONthird segment bumped, or not needed because this is docs-onlydeployers/version.txtbumped, or not needed becausedeployers/was not changed0.261.422→0.261.423, using the assigned first version slot. Development was refreshed immediately before finalization and again before the original commit; it remained4dd6d80230fe60e3cbfe8544d1d52308a14a7387. The documentation/test-only follow-up does not change production code or bump the version again. Deployer files were not changed.Testing / validation
$env:PYTHONPATH = "$PWD\application\single_app;$PWD\functional_tests". The Cosmos network-guard plugin blocks external socket/DNS access before collection. No dependency installation or shared-host package changes were needed.74b2a23f382534c5a48969d22924758be5f3b284. Requested runtime selections were rerun after the equivalent test-only correction; route-policy, exact committed-diff guardrails, syntax, whitespace, and generator checks were reconfirmed on the final head. These are offline runtime fixtures, not live Azure/Graph, full-app bootstrap, or Azure Playwright browser validation. The fixed body and actual declared media type are verified at the Flask HTTP boundary; production security-header and bootstrap wiring are unchanged.python -m pytest -q -p test_support.cosmos_network_guard functional_tests\test_getatoken_missing_code_redirect.py functional_tests\test_m365_routes.py functional_tests\test_m365_connections.py functional_tests\test_m365_chat_connection_persistence.py functional_tests\test_oauth_error_responses.pypython .\scripts\check_swagger_routes.py .\application\single_app\route_frontend_authentication.py .\application\single_app\config.pypython .\functional_tests\route_tests\test_route_blueprint_policy_inventory.pypython .\functional_tests\route_tests\test_route_unauthenticated_policy_contract.pypython .\functional_tests\route_tests\test_route_policy_test_coverage.pypython .\scripts\check_broken_access_control.py --base-sha origin/Development --head-sha HEAD .\application\single_app\route_frontend_authentication.py .\application\single_app\config.pypython .\scripts\check_xss_sinks.py --base-sha origin/Development --head-sha HEAD .\application\single_app\route_frontend_authentication.py .\application\single_app\config.pypython -m pytest -q -p test_support.cosmos_network_guard functional_tests\test_docs_release_notes_integrity.py functional_tests\test_docs_app_surface_coverage.py functional_tests\test_docs_site_quality.py functional_tests\test_docs_latest_release_catalog_parity.py functional_tests\test_docs_published_references.py::test_release_generation_rejects_source_relative_reader_linkspython .\scripts\build_release_notes_pages.pypython .\scripts\build_release_notes_pages.py --checkpython .\scripts\build_latest_release_docs.py --checkpython -m py_compile .\application\single_app\route_frontend_authentication.py .\application\single_app\config.py .\functional_tests\test_oauth_error_responses.py .\functional_tests\test_m365_routes.pygit -c core.whitespace=blank-at-eol,blank-at-eof,space-before-tab,cr-at-eol diff --cached --checkgit -c core.whitespace=blank-at-eol,blank-at-eof,space-before-tab,cr-at-eol diff --check origin/Development...HEADgh run watch 42388538946 --repo microsoft/simplechat --interval 30 --exit-statusgh run watch 42388538920 --repo microsoft/simplechat --interval 30 --exit-statusBefore-change evidence:
python -m pytest -q -p test_support.cosmos_network_guard functional_tests\test_getatoken_missing_code_redirect.py functional_tests\test_m365_routes.py functional_tests\test_m365_connections.py functional_tests\test_m365_chat_connection_persistence.pyassert_group_role/get_user_groupsimports now required byfunctions_notifications.py. The approved test-only parity repair rejects group access, represents no memberships, asserts neither helper is called, and retains all subject/deduplication/fault assertions.python -m pytest -q -p test_support.cosmos_network_guard functional_tests\test_oauth_error_responses.py --tb=shorttext/htmlfor the five provider-error cases; the compatibility cases already passed.Fresh exact-head CodeQL evidence:
CodeQL Advanced run 42388538946 succeeded for head
74b2a23f382534c5a48969d22924758be5f3b284. Python job 128451004105 produced analysis 2118612303 onrefs/pull/1905/merge, merge SHAe6aca9976db7f7b8e741a5312466adf396209b1d, with analysis key.github/workflows/codeql.yml:analyzeand category/language:python. It reports 0 results across 172 rules, with no processing errors or warnings. Downloaded SARIF confirms bothpy/reflective-xssandpy/unnecessary-lambdaremain enabled and reports no results; the two selected callback findings and selected alert instances are absent on this PR ref.The first PR scan removed the two selected callback findings but identified one redundant lambda in the new test-only settings seam. The final commit replaces it with the identical
dictcallable; the final scan above confirms the no-new-findings criterion. Final JavaScript/TypeScript analysis 2118596556 and Actions analysis 2118589418 also report 0 results on the same merge SHA. Baseline Python analysis 2117078539 retains the exact two original callback sinks for before/after comparison.Fresh Cosmos contracts run 42388538920 also succeeded for final head; job 128451003970 passed with external network blocked before collection. Scanning configuration, rules, severity, exclusions, and dismissals are unchanged. This is PR-ref evidence, not a claim that existing Development/main findings are globally closed. Final Development verification is parent-owned after a user-approved merge; this PR must not be merged automatically.
Documentation
Fix documentation:
docs/explanation/fixes/OAUTH_ERROR_RESPONSE_XSS_FIX.md, version0.261.423. The coordinator-assigned concise Bug Fix entry is underv0.261.423indocs/explanation/release_notes.md, and the split release pages were regenerated. The required generator's version-index/archive-boundary reflow accounts for the extra documentation diff; all 317 source release sections are preserved. Historical #1903 references are non-closing. No application surface or Latest Features card was added or renamed; the application inventory and app-driven catalog are unchanged.Security checklist
@swagger_route(security=get_auth_security())sanitize_settings_for_user()No new routes, settings payloads, browser assets, shared Graph/M365 helper edits, deployment changes, or deferred findings are included. Both non-amended commits include the required co-author trailer. Every merge still requires the user's approval; auto-merge remains disabled.