Skip to content

fix(runtime,plugin-auth)!: a banned user's OAuth access tokens and refresh grants are refused while the ban holds - #30360

Merged
objectstack-fleet[bot] merged 16 commits into
mainfrom
claude/sec-hardening-r5
Nov 5, 2026
Merged

objectstack-fleet[bot] merged 16 commits into
mainfrom
claude/sec-hardening-r5

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Clause-②: yes (narrowing)
Metadata-protocol: none
Skills-docs: updated here

Base is main. The pull request this branch was stacked on (#30287) has landed on main as f4cd4ec879. This branch merged origin/main at f6faf75116 in 949fd3f1e4 (a merge, no rebase); the files both sides added are main's copies, so the diff against main is this change alone.

维护者速读

  • 改了什么:用户被封禁期间,其 OAuth 访问令牌在 MCP 入口按"无法验证的令牌"拒绝,在 /oauth2/userinfo 按无效令牌应答、在 /oauth2/introspect 按非活动令牌应答;令牌端点不再为其签发新令牌(refresh 与授权码兑换均被拒)。封禁确认框与管理员、认证文档同步写明。
  • 为什么改:封禁已拒绝该用户的登录、会话与 API key;OAuth 令牌及其续期是同一用户的凭据,在读取或签发它们的入口适用同一规则。
  • 风险与回滚:MCP 入口每个 OAuth 凭据多一次按主键读 sys_user 封禁列(读失败 503);introspection 每个活动应答多一次读用户行(读失败则请求失败,不臆造应答);令牌端点与 userinfo 不增加读取。不吊销、不改写任何令牌行;授权码在封禁期间被出示即作废,客户端需重新登录。回滚即还原本 PR。
  • 先看:packages/plugins/plugin-auth/src/oauth-token-read-ban-refusal.ts(userinfo 与 introspection 两处拒绝);packages/plugins/plugin-auth/src/oauth-grant-ban-refusal.ts(令牌端点,授权码分支的先后顺序见文件头);packages/runtime/src/security/oauth-subject-ban.ts(MCP 入口读取与 503 分类)。
  • 两分钟验证:pnpm --filter @objectstack/plugin-auth exec vitest run src/auth-manager.oauth-consent-organization.test.ts,预期全部通过(真实 provider 上:封禁用户的 refresh、授权码、userinfo、introspection 应答与无效凭据一致,解封或到期后恢复)。
  • 需要你做的:无,席位落地。

What changes

While a user's ban holds, the rule holds at these doors, and only these:

  • MCP door. An OAuth access token whose subject is banned resolves as a token that does not verify: no principal, no fall-back to a cookie session, the same 401 body and WWW-Authenticate header. An agent forward credential acting for a banned user resolves as one that does not redeem. The ban is read where the credential becomes its user (resolveExecutionContext → isOAuthSubjectBanned, packages/runtime/src/security/oauth-subject-ban.ts), with the shared predicate isUserBanInForce from @objectstack/core. The verifier (verifyMcpAccessToken) stays the local, I/O-free signature check.
  • Token endpoint. The provider mints a banned user no token. A refresh_token grant is answered as an invalid refresh token (400 invalid_grant, invalid refresh token) and writes nothing. An authorization_code exchange is refused and the code is spent: when the ban ended the user's sessions, as the ban routes do, the provider's own session answer refuses it (400 invalid_request); otherwise it is answered as an invalid code (400 invalid_grant, invalid code). Any extension grant that issues through the provider is refused as an invalid grant. The refusal runs in the provider's callback customTokenResponseFields, which receives the user row the provider already read (packages/plugins/plugin-auth/src/oauth-grant-ban-refusal.ts; its header records the order on each grant and why this hook).
  • Userinfo. /oauth2/userinfo answers a banned user's access token as an access token that does not verify (401 invalid_token, the provider's description and WWW-Authenticate challenge), the answer a made-up token gets. It runs in customUserInfoClaims, on the user row the provider already read, before the locale claim (packages/plugins/plugin-auth/src/oauth-token-read-ban-refusal.ts).
  • Introspection. /oauth2/introspect answers a banned user's access and refresh tokens as inactive ({ "active": false }), the answer a made-up, expired or revoked token gets (RFC 7662 §2.2). It runs as a section of AuthManager's global after-hook, on the provider's active answer, with one read of the subject's user row through the provider's adapter (same file).
  • Expiry. A ban with an expiry stops binding once it has passed, exactly as sign-in reads it, at every door above.
  • Not a revocation. No token, refresh token or consent row is revoked or rewritten; lifting the ban (or its expiry) admits the same access token at the MCP door and lets the same refresh token renew.
  • Cost. One primary-key read of sys_user (id, banned, ban_expires), as the system, per OAuth credential the MCP door resolves; one user-row read per active introspection answer that names a user; zero at the token and userinfo endpoints. A store fault on the MCP door's read is 503 SERVICE_UNAVAILABLE naming sys_user; a store fault on the introspection read fails the request (500) rather than answering active or inactive; a missing user row or an unprovisioned table keeps today's answer.
  • The words. The Ban User confirmation (packages/platform-objects/src/identity/sys-user.object.ts, its AI description and the three translated bundles), content/docs/permissions/administrator-guide.mdx (lifecycle actions and the offboarding row) and content/docs/permissions/authentication.mdx (the ban-user route) name OAuth access tokens and token refreshes among what a ban refuses. @objectstack/platform-objects joins the changeset at patch.
  • The plugin-auth APIError code pin now also reads an OAuth 2.0 error response (a literal error beside an error_description, RFC 6749 §5.2) as a coded body, with fixtures for both directions: the token-endpoint refusal must answer exactly as the provider's own error does, which carries no ADR-0112 code.

Tests

  • packages/runtime/src/security/resolve-execution-context.test.ts — new top-level describe: banned subject resolves exactly as an unverified bearer; a future expiry binds, a passed one does not; not-banned, unbanned, no-row and no-table controls admit as before; a ban read that throws is 503 SERVICE_UNAVAILABLE naming sys_user; cost pinned at one ban-column read per token and none for an unverified bearer; a forward credential for a banned user resolves as one that does not redeem.
  • packages/plugins/plugin-auth/src/oauth-grant-ban-refusal.test.ts — the refusal against the provider's own error (class, status, body, headers) for each grant type; expiry in both spellings; not-banned and no-user controls.
  • packages/plugins/plugin-auth/src/oauth-token-read-ban-refusal.test.ts (new) — the userinfo refusal (status, body, challenge; expiry in both spellings; controls); the introspection section (rewritten in place for a banned subject; expiry; not-banned and no-row controls; inactive, subject-less, other-path and non-object answers read nothing; a read that throws fails and leaves the answer as produced; the provider's adapter is the default reader; AuthManager's global after-hook runs the section).
  • packages/plugins/plugin-auth/src/auth-manager.oauth-consent-organization.test.ts — on the real provider with AuthManager's own options: a banned user's refresh grant equals an invalid refresh token's answer and writes no refresh row, and renews once the ban lapses; a code issued before a ban that ended the user's sessions gets the provider's session answer, starts no refresh family and is spent; a code exchanged while the user's session survived equals a code never issued and starts no refresh family; userinfo for a banned user's token equals a made-up token's answer and reads the claims again once the ban lapses; introspection of a banned user's access and refresh tokens equals a made-up token's answer and is active again once the ban lapses; not-banned controls for each.
  • packages/platform-objects/src/identity/action-confirm-one-dialog.test.ts — the Ban User confirmation pinned word for word, now naming OAuth access tokens and token refreshes.
  • packages/qa/dogfood/test/oauth-banned-subject.dogfood.test.ts — booted showcase, real DCR → authorize → consent → token: initialize, query_records, create_record and the refresh grant against a made-up token / an invalid refresh token, the refused write landing nothing; peer, unban and timed-ban controls. Its header declares its measured test budget (20 s: 13.13 s of tests, the slower of two local runs, × 1.25, rounded up).

Acceptance notes

  • The plugin-auth APIError code pin gains a third accepted shape, the RFC 6749 §5.2 error response, so a token-endpoint refusal can carry exactly the provider's own body; a literal error with no error_description, or a non-literal error, is still reported (fixtures in both directions).
  • An authorization code presented for a banned user is spent whichever refusal answers it, as the provider consumes a code before it reads the code's session; after the ban the client signs the user in again.
  • The banned-subject dogfood file's 20 s test budget is a local reading on a shared box; no CI reading exists yet, so it should be re-measured on CI.

Verification

Readings at head 942ee6846660 unless stated. Readings marked 11504e470d were taken one commit earlier; 942ee68466 adds only the budget header line of oauth-banned-subject.dogfood.test.ts. packages/runtime is unchanged since 949fd3f1e4, so its reading from that head stands.

Unit and integration suites
  • pnpm --filter @objectstack/plugin-auth test (at 11504e470d): Test Files 226 passed (226), Tests 3999 passed, 10 skipped (4009).
  • pnpm --filter @objectstack/platform-objects test (at 11504e470d): Test Files 111 passed (111), Tests 1526 passed (1526).
  • oauth-token-read-ban-refusal.test.ts, oauth-grant-ban-refusal.test.ts and auth-manager.oauth-consent-organization.test.ts together: Test Files 3 passed (3), Tests 29 passed (29).
  • pnpm --filter @objectstack/runtime test (at 949fd3f1e4): Test Files 542 passed (542), Tests 8651 passed, 19 skipped (8670).
  • pnpm --filter @objectstack/plugin-auth --filter @objectstack/platform-objects run typecheck: exit 0 (both check:test-typecheck OK).
  • eslint --no-inline-config over the 19 changed .ts files: exit 0, no findings.
  • node scripts/check-i18n-bundles.mjs: OK, 10 packages, all bundles in sync.
Ablations (at `11504e470d`; one per refusal and one per wiring; each red, then restored, blob equal to HEAD and `git diff HEAD` empty; the restored run 29 passed of 29)
  • Userinfo refusal short-circuited: 3 failed of 29 (two unit, one real-provider).
  • Introspection refusal short-circuited: 5 failed of 29 (four unit, one real-provider).
  • Introspection section removed from AuthManager's global after-hook: 1 failed of 29 (the wiring test).
  • Userinfo refusal removed from customUserInfoClaims: 1 failed of 29 (the real-provider userinfo leg).
  • Grant refusal short-circuited: 6 failed of 29 (four unit, two real-provider). The code leg where the ban ended the user's sessions stays green, as it should: the provider's own session answer refuses that exchange first, as the refusal's header records.
Dogfood
  • test/oauth-banned-subject.dogfood.test.ts alone, run twice (at 11504e470d): Test Files 1 passed (1), Tests 4 passed (4), both runs; the slower took 13.13 s of tests, which gives the declared 20 s budget.
  • Full battery at 942ee6846660 (pnpm --filter @objectstack/dogfood test, after a build of its closure at that head): Test Files 421 passed, 3 skipped (424); Tests 3500 passed, 36 skipped (3536); 2208 s on a shared box. Nothing red: the timeout in the reading at 949fd3f1e4 does not recur.
Gates
  • node scripts/pm/dispatch-gates.mjs --commands at 942ee6846660: 96 commands, each run with its exit code captured before any pipe: 96 exit 0. check:type-check-debt answered PREREQUISITE NOT MET (exit 3) on a first pass, because the verify lock was held by this head's dogfood battery, and exit 0 when re-run. --ran reconciliation: 96 derived, 96 run, 0 NOT-MEASURED (derived from recorded exit codes).
  • CI at 942ee6846660: 50 check runs, 38 success, 12 skipped, none failed. "Type Check · consumer gates", red at d3daa06af0 because the generated platform-objects translation bundle had drifted, is green: 11504e470d regenerates the en bundle.

🤖 Generated with Claude Code

https://claude.ai/code/session_01L6bhgVfjk2i8T2D4RmxsKg

claude added 11 commits November 5, 2026 03:58
A ban holds every credential of the user, at every door that accepts an
API key; a ban with an expiry stops binding once it expires. One ban
predicate (isUserBanInForce) now serves every place that asks.

Claude-Session: https://claude.ai/code/session_01QSeKYn5CmmdShCJifm6WYj
Co-authored-by: Claude <noreply@anthropic.com>
…resh grants are refused while the ban holds

Claude-Session: https://claude.ai/code/session_01QSeKYn5CmmdShCJifm6WYj
Co-authored-by: Claude <noreply@anthropic.com>
…gets

A key refused for its owner or for the tenancy posture now resolves to
the same anonymous entry as a key that does not exist, on every
composition, the guest-serving one included. The restore wording in the
changeset and the auth docs is qualified by each key's inactivity window.

Claude-Session: https://claude.ai/code/session_01QSeKYn5CmmdShCJifm6WYj
Co-authored-by: Claude <noreply@anthropic.com>
…aude/sec-hardening-r5

Claude-Session: https://claude.ai/code/session_01QSeKYn5CmmdShCJifm6WYj
Co-authored-by: Claude <noreply@anthropic.com>
…ponse as coded; the ban double is a bounded table filter

Claude-Session: https://claude.ai/code/session_01QSeKYn5CmmdShCJifm6WYj
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/l documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 5, 2026
@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 3 package(s): @objectstack/platform-objects, @objectstack/plugin-auth, @objectstack/runtime, touching 24 documentable anchor(s).

7 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/automation/connectors.mdx (via authorization_code (symbol, a field of const object INVALID_GRANT_DESCRIPTION), invalid_grant (literal, a string literal in refuseGrantForBannedUser))
  • content/docs/kernel/contracts/auth-service.mdx (via AuthManager (symbol, a top-level class), verifyMcpAccessToken (literal, a string literal in resolveExecutionContext))
  • content/docs/kernel/runtime-services/push-service.mdx (via invalid_token (literal, a string literal in INVALID_ACCESS_TOKEN_WWW_AUTHENTICATE; a string literal in refuseUserInfoForBannedUser))
  • content/docs/kernel/services-checklist.mdx (via AuthManager (symbol, a top-level class))
  • content/docs/permissions/authentication.mdx (via AuthManager (symbol, a top-level class))
  • content/docs/permissions/system-context.mdx (via authorization_code (symbol, a field of const object INVALID_GRANT_DESCRIPTION))
  • content/docs/protocol/kernel/index.mdx (via resolveExecutionContext (symbol, a top-level function))

⛔ 3 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/v18/18-1.mdx (via invalid_grant (literal, a string literal in refuseGrantForBannedUser))
  • content/docs/releases/v18/18-2.mdx (via AuthManager (symbol, a top-level class))
  • content/docs/releases/v18/18-3.mdx (via AuthManager (symbol, a top-level class), authorization_code (symbol, a field of const object INVALID_GRANT_DESCRIPTION))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see
  • 2 anchor(s) matched too much of the corpus to be a work list: sys_user (symbol, 49 pages), sys_user (literal, 49 pages)
  • 3 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 63 of 221 client-bound route-ledger rows — the other 158 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 158: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 55 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 103 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 43 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 14c67d446e577926460f3ed893e44cc32cbecb12 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from ce22ba450713376a29c843eff83b8596d41b5500 — the merge of head 6efeaf733aa20c6d2dd5c0a9c5a4abd322e5f200 into base 14c67d446e577926460f3ed893e44cc32cbecb12, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin ce22ba450713376a29c843eff83b8596d41b5500 && git checkout ce22ba450713376a29c843eff83b8596d41b5500
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 14c67d446e577926460f3ed893e44cc32cbecb12 6efeaf733aa20c6d2dd5c0a9c5a4abd322e5f200 && git checkout -B drift-repro 14c67d446e577926460f3ed893e44cc32cbecb12 && git merge --no-ff 6efeaf733aa20c6d2dd5c0a9c5a4abd322e5f200

node scripts/docs-audit/affected-docs.mjs --json 14c67d446e577926460f3ed893e44cc32cbecb12

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 14c67d446e577926460f3ed893e44cc32cbecb12 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

The base branch's change landed on main as one squashed commit; main's copy
of the two files both sides added is taken whole, and this branch's own
change sits on top unchanged.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgVfjk2i8T2D4RmxsKg
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

security#1 · os-sales · session_01L6bhgVfjk2i8T2D4RmxsKg

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 949fd3f1e4bb6c97599741c67440907bc5eb2053
Local-runs: none
Scope: packages/runtime/src/security/oauth-subject-ban.ts, packages/runtime/src/security/resolve-execution-context.ts, packages/runtime/src/security/resolve-execution-context.test.ts, packages/plugins/plugin-auth/src/oauth-grant-ban-refusal.ts, packages/plugins/plugin-auth/src/oauth-grant-ban-refusal.test.ts, packages/plugins/plugin-auth/src/auth-manager-plugin-list.ts, packages/plugins/plugin-auth/src/auth-manager.ts, packages/plugins/plugin-auth/src/auth-manager.oauth-consent-organization.test.ts, packages/plugins/plugin-auth/src/api-error-code.pin.test.ts, packages/qa/dogfood/test/oauth-banned-subject.dogfood.test.ts + packages/core/src/security/user-ban.ts, packages/core/src/security/api-key.ts, packages/core/src/security/authz-store-unavailable.ts, packages/types/src/driver-error-classification.ts, packages/spec/src/contracts/auth-service.ts, packages/runtime/src/http-dispatcher.ts, packages/mcp/src/mcp-server-runtime.ts, packages/plugins/plugin-auth/src/auth-route-ledger.ts, packages/plugins/plugin-auth/src/admin-ban-endpoints.ts, packages/plugins/plugin-auth/src/user-ban-write.ts, the installed @better-auth/oauth-provider@1.7.12 and better-auth@1.7.12 (admin, device-authorization, one-time-token, jwt plugins), read from the pnpm store. Face: narrowing (Clause-②: yes (narrowing) on the PR body and the changeset; reviewFace finds no schema or governed path), so the floor is every path of the diff outside the prose faces. The changeset itself is the lane seat's ACCEPT at TIER_DEFAULT; it is read here only for ②. Full review (no prior at-tier record on this PR). Independence: ④ run by a subagent that did not draft the change; the seat adopts.

① Derived judgments

Every path on this head that turns an OAuth credential into a principal, or mints a new token or session for the same user, enumerated from the code and judged against the stated rule ("a ban holds every credential of the user"):

  1. MCP HTTP door, access token (resolve-execution-context.ts:191-210) — COVERED. The ban is read once per verified token, outside the verifier's net, with the shared predicate isUserBanInForce (core/security/user-ban.ts:55) and the same read shape as the key-admission seam (core/security/api-key.ts:770-783): primary key, USER_BAN_FIELDS, limit: 1, isSystem. A banned subject gets exactly the unverified-bearer envelope (session: 'none', guest, no cookie fallback). Correct. The verifier (auth-manager.ts:4411) stays local and I/O-free, as its docblock now records. The MCP transport is stateless (mcp-server-runtime.ts:1965, sessionIdGenerator: undefined) and the dispatcher resolves per request (http-dispatcher.ts:1112), so no principal survives across requests. Correct.
  2. MCP door, in-process forward credential (resolve-execution-context.ts:182-183) — COVERED. A forward whose agent acts for a banned user resolves as one that does not redeem; the control pins equality with an unredeemable handle. Correct.
  3. Token endpoint, refresh_token (oauth-grant-ban-refusal.ts:71-77; wired at auth-manager-plugin-list.ts:696-699) — COVERED. In the installed provider the one minter every user grant reaches calls customTokenResponseFields before the refresh rotation and before any token row or signature; the refresh handler writes nothing before the minter. The refusal is the provider's own 400 invalid_grant / invalid refresh token, pinned against the real provider's answer (class, status, body, cache-control, www-authenticate) and in the dogfood against a misdirected real refresh token. Correct, and "leaves every row as it was" holds on this arm.
  4. Token endpoint, authorization_code — COVERED as defence in depth, but the body overstates it. In the installed provider the code handler consumes the code and requires the code's session to still exist before the minter (and so before this hook) runs. Both ban routes on this head end the user's sessions (admin-ban-endpoints.ts:181; the vendor route does the same), so for a ban placed the normal way a pre-ban code is refused by the provider's own session check, with its own invalid_request description, and never reaches the hook; the hook's invalid code answer is reached only when a session survived the ban. Either way no token is minted — the rule holds — but "400 invalid_grant with the provider's own description (invalid code)" (PR body, changeset line 8) and "leaves every row as it was" (oauth-grant-ban-refusal.ts:22-27) describe the uncommon case, and the code is consumed before the refusal on this arm. The real-provider describe pins the refresh arm only (auth-manager.oauth-consent-organization.test.ts:423-481); the code arm is pinned at module level alone.
  5. Token endpoint, extension grants — COVERED by construction: an extension handler issues only through the provider's bound issueTokens, which is the same minter. None is wired on this head, so the claim is correct and currently vacuous.
  6. Token endpoint, client_credentials — OUT BY CONSTRUCTION: no user row; the MCP verifier refuses M2M tokens anyway (auth-manager.ts:4365-4377). Body says so. Correct.
  7. Authorize + consent — OUT BY CONSTRUCTION: needs a live session; the ban routes end sessions and the vendor's session.create hook refuses a banned user (the same hook core/security/user-ban.ts:7-9 names). Correct.
  8. Device-authorization /device/token (opt-in) — OUT BY CONSTRUCTION: mints a session through the internal adapter, so the same session.create hook refuses it. Not an oauth-provider grant; not named in the body, harmless.
  9. jwt plugin /token, one-time-token verify — OUT BY CONSTRUCTION: session-bound (the first also mints a token without the MCP audience, which the verifier refuses). Not named; harmless.
  10. stdio MCP, REST, GraphQL — OUT BY CONSTRUCTION: API key or session only (mcp/src/plugin.ts:268, current-user-endpoints.ts:593-596); keys are covered on main by the predecessor.
  11. Principal-session mint and agent-forward identity view — already refuse a banned user on main (principal-session-mint.ts:266, agent-forward-identity-view.ts:170). Correct.
  12. The authorization server's own endpoints (auth-route-ledger.ts:352,421,424,428) — NOT NAMED. The body's "A ban holds every credential of the user" and the changeset's "Nothing else narrows" state a scope wider than the doors the diff names; the body has to list exactly which doors the rule holds at, these included or excluded. Detail is in the reviewer's local note, not here.

Fault classification: a thrown ban read is AuthzStoreUnavailableError('sys_user') (503 SERVICE_UNAVAILABLE) unless isMissingTableError(err, 'sys_user'); a missing table and a missing row both answer "not banned" — byte-for-byte the key-admission seam's posture, pinned (resolve-execution-context.test.ts:887-909). Correct. The ban read sits outside the verifier's try, so a store fault is never laundered into "did not verify". Correct. The token endpoint adds no read, so no new fault class there. Correct.

APIError code pin (api-error-code.pin.test.ts:137-145): the third accepted shape requires a string-literal error AND an error_description on the same literal; fixtures accept the two compliant spellings and report a bare literal error, a non-literal error, and a description alone ([true,true,false,false,false], :261-269). Narrow enough; both directions pinned. Correct.

Tests are rule tests: the banned answer is asserted toEqual a real control on every door (unverified bearer, unredeemable handle, misdirected refresh token, made-up MCP token), with the write-landed-nothing read, cost pin, expiry in both spellings, not-banned/unbanned/no-row/no-table controls, and the timed-ban lapse. Ablation evidence in the body (three ablations at 9032503647, each red then restored blob-equal) covers both resolver checks and the grant refusal. Accepted.

Accept-set change: the narrowing the changeset declares is exactly what the diff does at the MCP door and on the refresh arm; on the code arm the declared envelope is the uncommon case (item 4). No public export is added or removed; Metadata-protocol: none is correct.

② Semver level

@objectstack/runtime patch, @objectstack/plugin-auth patch — correct: a non-protocol narrowing ships patch with its BREAKING banner, and both lines carry Clause-②: yes (narrowing) plus Metadata-protocol: none and the single ADR-0087 marker (not-required (no-migration-prescription)). @objectstack/dogfood is private: true and needs none; @objectstack/core is not touched by this diff. Changeset present for every published touched package. One accuracy point folded into ① item 4 (should-fix, not a level question).

③ Boundary flags

  • Author is objectstack-fleet[bot]; no out-of-relay author to name.
  • No open card is referenced; the only number in the body is the merged predecessor, with no closing keyword beside it. Correct.
  • Skills-docs: follow-up owed — … (PR body line 3): still follow-up owed, no #N, and no such card exists (issue search on the named files and wording returns none). The checklist makes an unfiled follow-up on a (narrowing) change a REWORK. The predecessor resolved the same line by editing the two docs pages in-PR (Skills-docs: updated here); the pages and the Ban User confirmation (administrator-guide.mdx:84,184, authentication.mdx:1256, sys-user.object.ts:210) each list what a ban refuses and are one clause short. Must-fix: either edit them here, or file the card (rule-level wording only) and write its number into the line.
  • packages/qa/dogfood/test/oauth-banned-subject.dogfood.test.ts:1-3: no // test-budget: header line. The file boots the showcase, runs two DCR-to-token flows and waits a timed ban out, so it is over the 10 s line by construction; its sibling from the same series declares // test-budget: 20 — spawns the real producer once per single-cause fixture: … (api-key-banned-owner.dogfood.test.ts:2). Without the declaration the file is its lane's card the day it lands. Must-fix: declare the budget from a measured reading, same class.
  • CI at head 949fd3f1e4: every check-run success or skipped (the UI jobs skip on the paths filter; Lint & Repo Gates, TypeScript Type Check, Test Core, Build Core, Governed Surface Queue Guard, Test UI, Live E2E UI all success). Not a governed-surface PR; Tier S/H does not apply. The body's full-dogfood red (package-commit-revert-path-package, a timeout under load, green alone at the same head) is unrelated to this diff and reported as such.
  • open_questions: none declared by the dev. Reviewer's questions: see ④.

④ Design judgment

The narrowing against the published behaviour on main: it takes nothing from a consumer that the rule does not already take from sessions and API keys; it makes the ban real for two more credential kinds at the doors that resolve them, reads the ban through the one shared predicate and the one shared read shape, answers a store fault as the door already does, and revokes nothing. The hook choice at the token endpoint is the right seam for the refresh arm (the provider's own user row, before any write). Design holds.

Findings:

  • must-fix (③) Skills-docs: follow-up owed with no filed card — PR body line 3. Edit the three listed surfaces here, or file the rule-level card and write #N.
  • must-fix (③) packages/qa/dogfood/test/oauth-banned-subject.dogfood.test.ts:1-3 — no // test-budget: SECONDS — spawns the real producer once per single-cause fixture: REASON line on a file over the 10 s line.
  • should packages/plugins/plugin-auth/src/oauth-grant-ban-refusal.ts:22-27,56-59, PR body "Token endpoint", changeset line 8 — on the authorization_code arm the provider consumes the code and requires the code's session before this hook runs, so for a ban placed through the ban routes the refusal is the provider's own session answer, not this one, and the code is spent; say so, and add a real-provider leg for the code arm beside the refresh leg (auth-manager.oauth-consent-organization.test.ts:423-481).
  • should PR body "What changes" / changeset — state exactly which doors the rule holds at, naming the authorization server's own endpoints (auth-route-ledger.ts:352,421,424,428) either way. Rule level only here; the detail stays with the security seat.
  • question packages/runtime/src/security/oauth-subject-ban.ts:50 — a door with no data engine answers "not banned"; documented and identical to today's answer, accepted as is. Confirm it is intended that this stays silent rather than loud.

Implemented-by: claude/sec-hardening-r5
Reviewed-by: session_01L6bhgVfjk2i8T2D4RmxsKg

VERDICT: FAIL

…as not valid at userinfo and introspection; the ban docs and confirmation name OAuth tokens

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgVfjk2i8T2D4RmxsKg
@github-actions github-actions Bot added size/xl and removed size/l labels Nov 5, 2026
…s the doors the rule holds at and the package the confirmation ships in

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgVfjk2i8T2D4RmxsKg
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

security#1 · os-sales · session_01L6bhgVfjk2i8T2D4RmxsKg

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 942ee6846660205ce270eb192ce574bf78609619
Local-runs: none
Scope: packages/plugins/plugin-auth/src/oauth-token-read-ban-refusal.ts, packages/plugins/plugin-auth/src/oauth-token-read-ban-refusal.test.ts, packages/plugins/plugin-auth/src/auth-manager-after-hook.ts, packages/plugins/plugin-auth/src/auth-manager-plugin-list.ts, packages/plugins/plugin-auth/src/oauth-grant-ban-refusal.ts, packages/plugins/plugin-auth/src/auth-manager.oauth-consent-organization.test.ts, packages/platform-objects/src/identity/sys-user.object.ts, packages/platform-objects/src/identity/action-confirm-one-dialog.test.ts, packages/platform-objects/src/apps/translations/en.objects.generated.ts, packages/platform-objects/src/apps/translations/es-ES.objects.generated.ts, packages/platform-objects/src/apps/translations/ja-JP.objects.generated.ts, packages/platform-objects/src/apps/translations/zh-CN.objects.generated.ts, packages/qa/dogfood/test/oauth-banned-subject.dogfood.test.ts + packages/core/src/security/user-ban.ts, packages/plugins/plugin-auth/src/admin-ban-endpoints.ts, scripts/measure-test-shard-timings.mjs (the test-budget grammar), the installed @better-auth/oauth-provider@1.7.12 (token, userinfo and introspection handlers, subject-identifier resolution) and better-auth@1.7.12 (the after-hook runner and router error path), read from the pnpm store. The prose faces (.changeset, content/docs/**) are the lane seat's ACCEPT at TIER_DEFAULT; they are read here sentence by sentence for ② and ③ because the delta's purpose was to land them.

This is a DELTA record by the reviewer of the 949fd3f1e4 record (comment 6663770415): commits d3daa06af0, 11504e470d, 942ee68466 on top of that head. It judges every finding of that record as resolved or not, and reviews the code those commits add in full. packages/runtime is unchanged since 949fd3f1e4; its judgments stand.

① Derived judgments

Findings of the 949fd3f1e4 record:

  • must-fix, Skills-docs: follow-up owed with no card — RESOLVED. The line now reads Skills-docs: updated here, and the three surfaces are edited in this PR: administrator-guide.mdx:84-85,184, authentication.mdx:1256, sys-user.object.ts:210 (the confirmation) and :219 (the AI description), with the en bundle regenerated and the three translated-locale values hand-edited (check:i18n sits in Lint & Repo Gates, green). Sentence check below under ③.
  • must-fix, no // test-budget: header on the dogfood file — RESOLVED. oauth-banned-subject.dogfood.test.ts:2 declares // test-budget: 20 — spawns the real producer once per single-cause fixture: …; 13.13 s of tests, the slower of two local runs on a shared agent box, x 1.25, rounded up, no CI reading yet, re-measure on CI. Against the grammar (measure-test-shard-timings.mjs:1248-1300): line 2 is inside the header, SECONDS = 20 is a whole multiple of 10 above the 10 s line, CLASS is the exact first class string, REASON is non-empty; 13.13 × 1.25 = 16.4 rounds up to 20. Correct.
  • should, the authorization_code arm overstated — RESOLVED. oauth-grant-ban-refusal.ts:20-41,55-61,69-73 now records what each grant has already done when the callback runs (refresh: nothing written; code: consumed, and the code's session required, so a ban placed through the ban routes is answered by the provider's own session check and the callback answers only a code whose session survived; the code is spent either way). PR body "Token endpoint" and changeset line 8 say the same. Two real-provider legs were added (auth-manager.oauth-consent-organization.test.ts:498-547): sessions ended → 400 invalid_request / session no longer exists, no refresh family, and after the unban the same code equals a code never issued (spent); session survived → equals the unknown-code control (400 invalid_grant / invalid code), no refresh family. Both match the installed provider's handler order as read. Correct.
  • should, the authorization server's own doors not named — RESOLVED, by covering them. Body, changeset and docs now list exactly the doors the rule holds at: MCP door, token endpoint (refresh and code), userinfo, introspection. The new code is reviewed below.
  • question, a door with no data engine answers "not banned" (oauth-subject-ban.ts:50) — not answered in the body or open_questions; accepted as is in the prior record and still non-blocking. Carried as a note for the seat.

New code, in full:

  1. Userinfo (oauth-token-read-ban-refusal.ts:75-83, wired first in customUserInfoClaims, auth-manager-plugin-list.ts:712-722) — COVERED. In the installed provider the userinfo handler verifies the token, reads the user row and hands it to the operator callback before answering; nothing is written there. The refusal throws the provider's own invalid-access-token error: 401, body { error_description: 'Invalid access token', error: 'invalid_token' }, WWW-Authenticate: Bearer error="invalid_token", error_description="Invalid access token" — the description and challenge match the provider's constants as read (INVALID_ACCESS_TOKEN_ERROR_DESCRIPTION, INVALID_ACCESS_TOKEN_WWW_AUTHENTICATE in the introspect chunk). Envelope equality to a made-up token's answer is pinned on the real provider with AuthManager's own options (auth-manager.oauth-consent-organization.test.ts:566-594: status, body, cache-control, www-authenticate toEqual), with the lapse-and-read-again leg and a not-banned control. Judged before the locale claim, so a refused request reads no locale. The row is the provider's read: no added read. The callback receives the real user row, so this door does not depend on the subject-identifier mode. Correct.
  2. Introspection (oauth-token-read-ban-refusal.ts:94-108, a section of AuthManager's global after-hook, auth-manager-after-hook.ts:142-146) — COVERED. The JWT introspection path in the installed provider reads no user row and calls no operator callback, so the ban is judged on the produced answer: path /oauth2/introspect, an object answer with active === true and a non-empty string sub, one internalAdapter.findUserById(sub), and on a holding ban the answer is emptied in place and set to { active: false } — the answer a made-up, expired or revoked token gets (RFC 7662 §2.2). In-place mutation is the right shape: better-auth sends ctx.context.returned after the hooks when a hook returns nothing (dispatch.mjs:runAfterHooks). The real-provider leg (:596-692, confidential client, access and refresh tokens, toEqual the made-up-token control including cache-control; active again once the ban lapses; not-banned control) proves the rewrite reaches the wire, and the unit leg :131-141 proves AuthManager's globalAfterHook reaches the section through the four sections ahead of it. An inactive answer, a subject-less answer, another path, a non-object answer and an APIError answer read nothing (:96-113). Correct.
    • Fault path. A thrown subject read propagates out of the section (:118-119, answer left as produced). In the installed after-hook runner a non-APIError thrown from hooks.after is re-thrown, so the provider's active answer is never sent: the "never invent" invariant holds, and the request fails. What the endpoint then answers is the router's generic failure — the dev reads it as a 500 with an empty body — which is neither the platform's branded answer for this class of fault (an authorization input that exists and could not be read: 503 SERVICE_UNAVAILABLE naming the object, as the MCP door's oauth-subject-ban.ts and every other door answer it) nor the provider's own server-fault dialect (500 with error: 'server_error' and a description, as its token endpoint throws). The same runner turns an APIError thrown from the hook into the response, so the branded answer is reachable from this section. The endpoint-level fault answer is pinned nowhere (the unit leg pins only the propagation). See ④, should.
    • Subject identity. The section looks the subject up by sub. The installed provider mints sub as the user id unless the client is registered pairwise AND the provider option for pairwise subjects is set, and it applies the same resolution to the introspection answer at presentation, before the after-hook sees it. The platform sets no such option on this head (auth-manager-plugin-list.ts, auth-manager.ts: none), so sub is the user id and the section is correct — but that is declared in the module header (:39-40) and enforced by nothing: a future provider option would turn the section into a no-op for that client's tokens without reddening any test. See ④, should.
    • Cost. One adapter read per active answer that names a subject (a machine-to-machine token's subject is its client id, reads once, finds no row, keeps the answer). The body and changeset say "per active introspection answer that names a user"; the header says "subject", which is the exact reading. Cosmetic.
  3. Token endpoint, code arm — see the resolved should above. The INVALID_GRANT_DESCRIPTION map is unchanged; only the header and the real-provider legs moved. Correct.
  4. MCP door, forward credential, refresh arm, extension grants, client_credentials, authorize/consent, device token, jwt /token, one-time-token, stdio/REST/GraphQL, principal-session mint, agent-forward view — unchanged since 949fd3f1e4; the prior judgments stand.

Accept-set change: the narrowing the changeset declares is now exactly the set of doors the diff narrows (MCP door; token endpoint refresh and code, with the code arm's two answers spelled out; userinfo 401 invalid_token; introspection { active: false }), and Those are the doors this change narrows is true. No public export is added or removed beyond plugin-auth's new module (not re-exported). Metadata-protocol: none stays correct.

② Semver level

@objectstack/runtime patch, @objectstack/plugin-auth patch, @objectstack/platform-objects patch (newly listed; private unset, so published; it ships the confirmation and the AI description) — correct for a non-protocol narrowing with its BREAKING banner and single ADR-0087 marker (not-required (no-migration-prescription), wording extended to "becomes its user or is read back"). @objectstack/dogfood is private and needs none. Changeset body, sentence by sentence: the Clause-② line enumerates the doors and answers as the code does; "Not a revocation" adds the spent code correctly; "Cost" states the MCP read, the introspection read, zero at token and userinfo, the MCP 503 and that an introspection fault fails the request — all true as read; "Who moves" names MCP clients and OIDC relying parties with the right answers per door. Cosmetic: the changeset's title line and the PR title still spell fix(runtime,plugin-auth)! while platform-objects moves too.

③ Boundary flags

  • Author objectstack-fleet[bot]; no out-of-relay author.
  • No open card referenced; the only number in the body is the merged predecessor, bare. Correct.
  • Skills-docs: updated here — true. Docs, sentence by sentence: administrator-guide.mdx:84-85 ("refuses their API keys and OAuth access tokens while the ban holds, with no new OAuth token issued to them") — true at every door above; :184 ("blocks sign-in, the user's API keys and their OAuth access tokens and token refreshes immediately") — true; authentication.mdx:1256 ("refused at the MCP endpoint and read as not valid at /oauth2/userinfo and /oauth2/introspect, and the token endpoint issues them no new token … Neither the keys nor the OAuth tokens are revoked") — true, the relative route spelling matches the section's "under /api/v1/auth/*" lead. Cosmetic: :1257 (unban-user) still names sign-in and API keys only.
  • Confirmation and bundles: sys-user.object.ts:210 and en.objects.generated.ts:162 are byte-equal ("…and their API keys refused until unbanned, as are their OAuth access tokens and token refreshes. The keys work again after the unban."), pinned word for word in action-confirm-one-dialog.test.ts:150-155; es-ES ("al igual que sus tokens de acceso OAuth y sus renovaciones de token"), ja-JP ("OAuth アクセストークンとトークンの更新も同様に拒否されます"), zh-CN ("OAuth 访问令牌与令牌续期同样被拒绝") each add the same clause and nothing else — faithful, keys unchanged, structure untouched (translated-locale values are hand-written by rule; en is regenerated). The AI description (:219) names keys, tokens and refreshes. Correct.
  • Test-budget header: correct (① above). The body says the 20 s is a local reading and asks for a CI re-measure; that is the declared form.
  • CI at 942ee6846660: 54 check-runs, every one success or skipped; the ten queue contexts read Lint & Repo Gates, TypeScript Type Check, Test Core, Build Core, Governed Surface Queue Guard, Test UI, Live E2E UI success and Lint UI, Type Check UI, Build & E2E UI skipped on the paths filter. The body's "Type Check · consumer gates" red at d3daa06af0 (drifted en bundle) is green at head after 11504e470d. Full dogfood battery at head: nothing red.
  • Size: 1355 / 25 lines, under the 3,000 line class.
  • Ablations (five, at 11504e470d, each red then restored blob-equal): userinfo refusal, introspection refusal, after-hook wiring, customUserInfoClaims wiring, grant refusal — each names the tests it reddens; the code-arm "sessions ended" leg staying green under the grant ablation is the correct reading of the provider's order. Accepted.
  • open_questions: none declared. The prior question on the no-engine answer stays open and non-blocking.

④ Design judgment

The two new doors are closed at the right seams: userinfo in the provider's own pre-answer callback on the row it already read, introspection on the produced answer because the provider's JWT path reads no row and offers no callback there. Both answer as the provider answers a token that is not valid, read the ban through the one shared predicate, write nothing, and lift with the ban. Against the published behaviour on main the narrowing now takes exactly what the rule takes from sessions and keys, at every door the authorization server and the platform serve for these credentials. Design holds; no must-fix.

Findings on this head:

  • should packages/plugins/plugin-auth/src/oauth-token-read-ban-refusal.ts:103-105 — classify the introspection subject-read fault as the platform classifies the same fault at the MCP door: throw the provider's APIError shape at 503 with a coded body naming the read (an APIError thrown from the hook becomes the response), instead of letting a raw error fall to the router's unbranded 500; and pin the endpoint-level fault answer with a real-provider leg beside auth-manager.oauth-consent-organization.test.ts:596-692. The invariant (never an invented active or inactive answer) already holds.
  • should packages/plugins/plugin-auth/src/oauth-token-read-ban-refusal.ts:39-40 — the section's reading of the subject rests on a provider option the platform does not set; pin that AuthManager's provider options carry no pairwise subject configuration (e.g. in the options-capture describe of auth-manager.oauth-consent-organization.test.ts), so enabling it later reddens a test that names this section, rather than silently narrowing where the rule holds.
  • nit content/docs/permissions/authentication.mdx:1257; changeset and PR title scope fix(runtime,plugin-auth)!; auth-manager.ts:4382-4386 (the verifier docblock names the MCP door and the token endpoint only); body/changeset "names a user" vs the header's exact "names a subject".

Implemented-by: claude/sec-hardening-r5
Reviewed-by: session_01L6bhgVfjk2i8T2D4RmxsKg

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

security#1 · os-sales · session_01L6bhgVfjk2i8T2D4RmxsKg

维护者速读

  • 改了什么: 用户被封禁期间,其 OAuth 凭据在四处入口按“无效凭据”拒绝:MCP 入口的访问令牌与转发凭据、令牌端点的 refresh 与授权码授权、userinfo、introspection。带到期时间的封禁到期即恢复;令牌本身不吊销。
  • 为什么改: 封禁本应管住该用户的全部凭据;登录、会话与 API key 已被拒(fix(core)!: a banned user's credentials are refused while the ban holds, at every door #30287),OAuth 令牌要与之一致。
  • 风险与回滚: 每次 MCP OAuth 请求与每次 active 的 introspection 应答多一次按主键读 sys_user;被封禁用户的 OAuth 集成会收到 401/400,属预期(BREAKING,changeset 写明)。回滚即撤本 PR。
  • 先看: packages/runtime/src/security/oauth-subject-ban.ts,packages/plugins/plugin-auth/src/oauth-grant-ban-refusal.ts,packages/plugins/plugin-auth/src/oauth-token-read-ban-refusal.ts。
  • 两分钟验证: pnpm --filter @objectstack/dogfood exec vitest run test/oauth-banned-subject.dogfood.test.ts,预期 4/4。
  • 需要您做的: 无,席位经合并队列落地(非受管面,1380 行)。复核提的两条非阻塞建议(introspection 读失败时的应答归类、为 pairwise subject 加一条钉)由本席另行加固。
  • 席位意见: ACCEPT。完整达档复审 FAIL(6663770415),两轮补丁已改;同一复审者增量复审 PASS(6667434647)。

席位核对 — ACCEPT · security#1 · head 942ee6846660205ce270eb192ce574bf78609619

  • 形态: draft, author objectstack-fleet[bot], no assignee, no review request, no closing keyword (no-card security order); 22 files, +1355 −25; base main (the stacked base fix(core)!: a banned user's credentials are refused while the ban holds, at every door #30287 landed as f4cd4ec879; main merged in at 949fd3f1e4); check-governed-merges --pr 30360 on the final file list: NOT governed, 1380 lines ≤ 3000; mergeable clean.
  • 契约复审: CONTRACT_REVIEW_TIER, narrowing face. Full review FAIL 6663770415 on 949fd3f1 (must-fix: Skills-docs: follow-up owed with no card; no test-budget: header on the new dogfood file; should: authorization-code wording, the doors the rule holds at). Delta PASS 6667434647 on 942ee684 by the same reviewer: all four resolved, the new userinfo and introspection refusals reviewed in full, public text at rule level.
  • Declarations (seat read): Clause-②: yes (narrowing), Metadata-protocol: none, Skills-docs: updated here in the body and the changeset; patch for runtime, plugin-auth and platform-objects (the three published packages the diff moves; dogfood is private); BREAKING banner; one ADR-0087 marker. The body names the four doors and says "and only these"; no wider claim remains.
  • Dev readings (942ee684): dispatch-gates 96 derived, 96 run, 0 NOT-MEASURED; plugin-auth 226 files / 3999 passed; platform-objects 111 / 1526; runtime unchanged since 949fd3f1 (542 / 8651); five ablations at 11504e47, each red then restored blob-equal. dogfood_battery at this head, full: 421 files passed, 3500 tests passed, 0 failed.
  • 门禁 check-runs: 54 runs, 40 success, 14 skipped, 0 failed (Lint & Repo Gates and TypeScript Type Check success).
  • Accepted: the docs, Ban User confirmation and four locale strings were read sentence by sentence against the code (record 6667434647 lists them). The no-engine reading in oauth-subject-ban.ts:50 stays as documented: without an engine there is no store in which a ban could exist.
  • 范围外去向: the two non-blocking shoulds from the delta record go to this seat as a hardening follow-up (no public card). Nits (unban-user line in authentication.mdx, title scope, verifier docblock) ride that follow-up.
  • 落地条款: No closing keyword; on MERGED the seat closes the advisory through the relay and records it on seat post [PM seat] security — 🟢 os-mickey · high only #29740. Ordinary queue landing by this seat: pr_ready + automerge_enable on this head.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 5, 2026 19:39
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge November 5, 2026 19:39
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 5, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 5, 2026
Resolve the offboarding row in the administrator guide: keep main's
hand-over step and this branch's OAuth credential clause.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgVfjk2i8T2D4RmxsKg
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

security#1 · os-sales · session_01L6bhgVfjk2i8T2D4RmxsKg

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 6efeaf733aa20c6d2dd5c0a9c5a4abd322e5f200
Local-runs: none
Scope: every non-prose path of the PR's diff against main at this head (the 22-file set the 942ee68466 record covered, narrowing face) + the three trees the hop is judged against: the merge's parents 942ee68466 (the PASS head) and 14c67d446e (origin/main at the merge), and the prior base f6faf75116; the prose faces (.changeset, content/docs/**) read for the conflict row and the hop only.

This is a DELTA record by the reviewer of the 949fd3f1e4 and 942ee68466 records, for the merge hop alone: 6efeaf733a merges origin/main (14c67d446e) into the branch (parents 942ee68466, 14c67d446e). main moved files this PR touches, so the carry rule does not apply and the hop is judged here; the 942ee68466 PASS stands for the PR's content.

① Derived judgments

  • The PR's intent is unmoved. The PR's contribution against the new base (git diff 14c67d446e...6efeaf733a: 22 files, +1355 / −25) is line-for-line identical to its contribution at the PASS head (f6faf75116..942ee68466) on every added and removed line, with one exception: the "Offboard someone" row of content/docs/permissions/administrator-guide.mdx:204, the only textual conflict. No file outside those 22 differs between the head and main, so the head is main plus exactly that contribution: nothing of the PR was dropped and nothing of main was lost.
  • The conflict resolution keeps both parents' intents. main's own change to the row added "then hand over their records (below)"; the branch's change added "the user's API keys and their OAuth access tokens and token refreshes immediately". The merged row carries both, and nothing else: **Ban User** (blocks sign-in, the user's API keys and their OAuth access tokens and token refreshes immediately) — then hand over their records ([below](#handing-over-a-banned-users-work)) and remove assignments at leisure. Correct.
  • main's movement inside PR-touched files changes no behaviour the PR relies on. sys-user.object.ts: two field descriptions (banned at :984, the password-reset flag at :1088-1089), nowhere near the ban_user action. auth-manager.ts: an import, the auth-email locale docblock (:1272-1282) and a new getMfaGracePeriodDays() method (:5373-5386), none near the verifier docblock, which is intact at :4395-4399. authentication.mdx: a client-address bullet under the IP-ranges section (:672-679), not the ban-user route line. The four translation bundles: main's regenerated entries for other objects; no hunk of main's touches the ban_user entry or the OAuth clause (zero matches). At the head the confirmation (sys-user.object.ts:210), its AI description (:219) and the en bundle entry (en.objects.generated.ts:162) are the PR's strings, source and bundle byte-equal, still pinned word for word by action-confirm-one-dialog.test.ts; check:i18n (Lint & Repo Gates, green at the head) confirms the merged en bundle equals a regeneration of the merged source.
  • Every judgment of the 942ee68466 record on the code stands unchanged: the packages/** content of the PR is byte-identical at this head.

② Semver level

Unchanged: @objectstack/runtime patch, @objectstack/plugin-auth patch, @objectstack/platform-objects patch; the changeset is byte-identical to the PASS head.

③ Boundary flags

  • CI at 6efeaf733a: 50 check-runs — 38 success, 12 skipped, none failed, none in progress (the seat's read of 38 / 12 confirmed). The ten queue contexts: Lint & Repo Gates, TypeScript Type Check, Test Core, Build Core, Governed Surface Queue Guard, Test UI, Live E2E UI success; Lint UI, Type Check UI, Build & E2E UI skipped on the paths filter.
  • PR state: non-draft, mergeable_state: clean, auto-merge not armed (dequeued for MERGE_CONFLICT before the hop; re-arming follows the landing procedure, not this record). Size unchanged, 1355 / 25.
  • Body: the readings it cites were taken at 942ee68466 / 11504e470d; they carry, since the PR's package content is byte-identical and the head's own CI is the gate reading. Cosmetic: the "Base is main" note still names only the first merge (f6faf75116 in 949fd3f1e4), not this one.
  • Author objectstack-fleet[bot]; no open card referenced; no closing keyword.

④ Design judgment

The hop adds no code and changes no accepted behaviour; the narrowing judged at 942ee68466 is what this head narrows. The two should-findings of that record (introspection fault classification and its endpoint-level pin; the pin on the subject-identifier assumption) stay open and non-blocking.

Implemented-by: claude/sec-hardening-r5
Reviewed-by: session_01L6bhgVfjk2i8T2D4RmxsKg

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

security#1 · os-sales · session_01L6bhgVfjk2i8T2D4RmxsKg

席位核对 — ACCEPT · security#1 · head 6efeaf733aa20c6d2dd5c0a9c5a4abd322e5f200

  • Head move: the merge queue dequeued 942ee684 for a merge conflict; the seat merged origin/main 14c67d446e as 6efeaf733a. One conflict, the "Offboard someone" row in content/docs/permissions/administrator-guide.mdx, now carries main's hand-over step and this branch's OAuth clause.
  • 契约复审: the same reviewer's hop delta PASS 6669070448 on 6efeaf73: the PR contribution against the new base is line-for-line the one PASSed at 942ee684 (6667434647) except that row; main's own hunks in PR-touched files sit away from every PR hunk.
  • 门禁 check-runs: 50 runs, 38 success, 12 skipped, 0 failed; mergeable clean; check-governed-merges: NOT governed, 1380 lines.
  • Carried: the ACCEPT 6667457786 on 942ee684 stands in every other respect. 落地条款: re-arm automerge_enable on this head.

@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 5, 2026
Merged via the queue into main with commit b3d2f4b Nov 5, 2026
50 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/sec-hardening-r5 branch November 5, 2026 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/xl tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant