Skip to content

fix(oauth): preserve opaque state across redirects and login HTML - #374

Merged
voidvec merged 1 commit into
masterfrom
fix/opaque-oauth-state-353
Nov 27, 2026
Merged

voidvec merged 1 commit into
masterfrom
fix/opaque-oauth-state-353

Conversation

@voidvec

@voidvec voidvec commented Nov 25, 2026

Copy link
Copy Markdown
Owner

Opaque state values containing query delimiters were truncated or injected into redirect queries, authorize rejected otherwise valid opaque characters, and the default login HTML interpolated OAuth values without attribute escaping.

Use query-component encoding at the audited login/authorize/consent/error/logout sites, preserve existing callback queries, and escape login view data at the HTML boundary. Retain the existing authorize missing/8–512-byte rule and the existing authentication, redirect allowlist, CSRF and PKCE ordering. Synchronize the API descriptions and generated artifacts.

Root source builds now require Python3 for the mandatory real-HTML parser test. The product runtime and installed SDK consumption retain their existing dependencies.

Validation at 6edd2a2 (base master 763e7f1):

  • Recorded real red baselines for login state truncation, authorize delimiter 400 and HTML attribute corruption, then passed the same test TU against the fix. Independent plan/code review checked the full controller inverse reconstruction and all seven callback separators.
  • GCC13/C++17/Release/WERROR full build; six complete library/dedicated test binaries passed. Complete CTest: 701/701 passed, zero skipped, including unfiltered main, actual executable endpoints, HTML oracle, SDK external consumer and feature/social protocol checks.
  • Same current binary with a private memory runtime config passed the complete unfiltered main and 17 real HTML/form/query samples. PG-dependent cases explicitly report that they are not exercised in memory mode; the real PG matrix passed in the default run.
  • Both frontends passed unit/property tests, lint, production build, UI sync and bundle budgets. User E2E: 151 passed, two existing external-GitHub condition skips. Admin E2E: 213 passed, six existing Swagger/backend prerequisite skips.
  • Python, Go and TypeScript SDK regeneration and drift checks passed. Actual server-generated OpenAPI JSON differs only in five state descriptions; schema, public signatures and version are unchanged. Spec/schema/API/migration/naming/architecture/async/macro/doc-link gates passed.

Draft pending formal current-head CI and final integration checks. The separate repository-wide sanitizer follow-up remains in #366/#370.

Fixes #353

@voidvec

voidvec commented Nov 27, 2026

Copy link
Copy Markdown
Owner Author

PR 评审:阻碍合入项清单

基于当前 head 6edd2a2f 的代码与 CI 核查:

  • 代码与 CI 状态:OAuth 重定向/登录/同意/错误/登出路径已统一使用 authorizeUrlQuerySeparator 与 urlEncodeComponent,SessionController::showLoginPage 已对模板字段执行 HttpViewData::htmlTranslate HTML 转义,openapi.yaml、openapi.json、三端 SDK、中英文文档镜像、llms-full.txt 及 Fixes #353 均已同步。当前 head 的全部自动 PR 工作流(三平台 Build & Test、SDK Smoke、Website、ASan + UBSan、Optional Feature Matrix 等)均已通过;手动 Sanitizers Run 45650807319 中 TSan nightly 的 25 项失败均属未合入 ci: complete sanitizer instrumentation and fix test data races #370 的既有框架插桩问题(本 PR 新增的 OpaqueState_LoginHtml 在 TSan 下已通过)。无代码技术阻碍。

1. [PR 状态] 仍处于 Draft 状态

  • 确认无额外待办后,需转为 Ready for review(gh pr ready),并顺手更新 PR 正文中“待当前 head CI 验证”的过期提示。

2. [合入策略] 缺少外部审阅批准(REVIEW_REQUIRED)

  • 需由非 PR 作者的审阅者 Approve。

@voidvec
voidvec marked this pull request as ready for review November 27, 2026 05:42
@voidvec
voidvec merged commit 3b4abb8 into master Nov 27, 2026
25 of 26 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-27T05:43:14.683723Z 6edd2a2 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@voidvec
voidvec deleted the fix/opaque-oauth-state-353 branch December 2, 2026 04:43
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.

Tracking: preserve opaque OAuth state with query-component encoding

2 participants