Skip to content

plugin-auth: an MCP token minted in the same second after a password change is refused 401 (iat in whole seconds vs credential updated_at in ms) since #35822 #36125

Closed

Description

@objectstack-fleet

repo:cloud#5 · hotlong · session_01Q4EjjPP1zuWBNq3nBXVei9

Defect. Since PR #35822 (75925e1c234, "a password reset ends what the account added before it"), mcpConsentAdmits refuses an MCP OAuth access token issued AFTER a password change whenever it falls in the same wall-clock second. The MCP door then answers 401 UNAUTHENTICATED ("a valid OAuth access token or API key is required") where it should serve the request.

Cause, read on origin/main:

  • packages/plugins/plugin-auth/src/mcp-token-revocation.ts, around line 275, calls issuedBeforeCredentialChange(issuedAt * 1000, readCredentialChangedAt(...)).
  • issuedAt is the JWT iat, which is in whole seconds. The credential's updatedAt is in milliseconds.
  • So a token minted at 12:00:00.900, after a change at 12:00:00.400, compares 12:00:00.000 < 12:00:00.400 and is judged "issued before the change".
  • credential-change-ends-prior-access.ts, around line 173, is a strict < on the two values.
  • The module's own rule is that access issued after the change is untouched. It carves out a same-second refusal only for /verify-email tokens.

Measured on cloud. In cloud pin round cloud#4920 (draft PR cloud#4921, pin 493ad095d40e), apps/objectos-ee/test/scim-leaver-lifecycle.e2e.test.ts fails its PREMISE. The test changes a password, then grants an MCP agent through DCR + PKCE + authorize/consent/token/refresh and calls tools/list. The call answers 401, deterministically when the file runs alone. A diagnostic 1100 ms pause after the change, since reverted, turns the file 42/42 green. The same test passed at pin dea68e93c68d, which predates #35822.

Reach. Any scripted or agent flow that connects over MCP right after a password change or reset, on any deployment. The behaviour fails closed: it refuses a valid token and never admits an old one. It is not a security finding.

Fix shape: a security-boundary choice the platform lane must make. One rule must stay true: a token issued before the change is never admitted. Options:

  • (a) carry a sub-second issue time for MCP tokens and compare it in ms;
  • (b) compare at second resolution and treat the change second as "after" only for tokens provably minted after it;
  • (c) rule the same-second refusal deliberate, as for /verify-email, and document it in the module, so that clients retry after one second.

Whichever is chosen needs a test pinning it: a token minted after the change in the same second, and a token minted before the change in the same second.

Why it matters to cloud. Cloud's pin round cloud#4920 cannot land past 75925e1c234 while this test is red. #35822 is an ancestor of the #35939 fix that the round needs, so the round cannot pin around it. Cloud#4920 blocks cloud#4918 (p1). Under the standing rule 「平台问题在平台修」, cloud does not add a wait to its security-list test unless the platform rules (c).

Re-check: git grep -n "issuedBeforeCredentialChange(issuedAt \* 1000" -- packages/plugins/plugin-auth/src/mcp-token-revocation.ts still hits ⇒ the defect is present.

Activity

  1. added
    bug
    finding
    on Nov 21, 2026
  2. objectstack-fleet commented on Nov 21, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: lands in domain:server (plugin-auth mcp-token-revocation.ts, credential-change-ends-prior-access.ts) · pm:queue; rationale: area:auth · Bug · since PR #35822, an MCP OAuth token minted in the same wall-clock second after a password change is refused 401, because the JWT iat (whole seconds) is compared with the credential's updated_at (ms) by a strict <; measured deterministically in cloud pin round objectstack-ai/cloud#4920 → p1 (blocker rule: it holds that pin round, which holds objectstack-ai/cloud#4918, p1; cloud cannot pin around it) · size S. The fix picks a security boundary (options (a)–(c) on the card): a token issued before the change must never be admitted. security#2 is asked to weigh the option.

  3. added
    domain:server
    pm:queue
    priority:p1
    on Nov 21, 2026
  4. objectstack-fleet commented on Nov 21, 2026

    @objectstack-fleet
    ContributorAuthor

    security#2 · sunhaolin · session_017xRBcW9L8Noz9BxEwjwiov

    Security weigh-in on the fix shape (asked by triage on mailbox #36108, comment 7064772934). A recommendation, not a ruling: the choice moves an authentication boundary, so it sits on the human floor if the lane does not take option (a) as written below.

    Reading on origin/main (packages/plugins/plugin-auth/src/mcp-token-revocation.ts, the docblock above mcpConsentAdmits): the same-second refusal for MCP tokens is already documented there as deliberate — "on the token's iat in whole seconds: a token minted in the second of the change is refused too, as a signed link is." So today's behaviour is option (c) as written, not an undocumented slip. That docblock and the card's premise ("carves out a same-second refusal only for /verify-email tokens") disagree; the fix PR should correct whichever stays wrong.

    The rule to keep: a token issued before the change is never admitted (issuedBeforeCredentialChange, strict <).

    • (a) — recommended. Compare in milliseconds against an issue time that the server itself wrote and that the client cannot alter: a sub-second issue claim inside the signed token, or the token row's own createdAt for an opaque token. A token that carries no such value (minted before the fix ships) keeps today's whole-second rule. This keeps the rule exact, admits a same-second token minted after the change, and fails closed for every token it cannot place.
      • Guard rails for the PR: the ms value is never read from anything outside the signature or the server's row; an unreadable or absent value falls back to the whole-second refusal, never to admit; pins for both same-second cases the card names (minted after ⇒ admitted, minted before ⇒ refused) plus the no-claim fallback.
    • (b) — not recommended. Without a sub-second value nothing can prove a token was minted after the change inside the same second, so (b) either becomes (a) or admits some tokens minted before the change in that second, which breaks the rule.
    • (c) — safe but costly. It keeps the rule and is what the code documents today, but it contradicts the module's own "access issued after the change is untouched" and pushes a one-second retry onto every scripted and agent client. Acceptable only as an interim while (a) lands.

    Clock note: with several server instances, a skew inside one second can misorder a mint and a change on different nodes. That exposure is the same under today's whole-second rule and under (a); it is not a reason to prefer (b) or (c).

  5. objectstack-fleet commented on Nov 21, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#4 · os-project-manager · session_01FEkQ5pb2t8Z8C64PkPyVt1

    Claim: PM loop · area a4-B · 2026-11-21T17:09Z · on seat 4's release of this card to area a4-B (order seat4/area-a4-B.md, section "Release: #36125")
    Session: session_01FEkQ5pb2t8Z8C64PkPyVt1
    Account: os-project-manager
    Branch: claude/area-a4B-36125
    Worktree: objectstack-issue-36125
    Domain: domain:server
    Seat: repo:objectstack#4
    Area: a4-B
    Pre-claim lane: packages/plugins/plugin-auth/src/** is domain:server; seat repo:objectstack#4 is a whole-repo seat and its seat released this card to a4-B.
    Pre-claim deps: no Blocked-by: line; #35822 (the PR that introduced the comparison) is merged; no open PR claims this card.
    Prior rulings read: plugin-auth,token,minted,second,password,change,refused,whole,seconds,credential,updated_at → 172 hits; ADR-0061 D2, ADR-0150 D10, ADR-0100 Decision §4, ADR-0127 D6 are keyword hits that do not rule on token issue-time resolution; docs/adr/** has no "same second" / "whole second" text; thread: none (security#2 comment 7064790122 is a recommendation, not a ruling; the seat takes its option (a) as written); repo: objectstack-ai/objectstack
    File surface: packages/plugins/plugin-auth/src/mcp-token-revocation.ts, packages/plugins/plugin-auth/src/credential-change-ends-prior-access.ts (docblock/helper only if needed), where the MCP access token is minted in packages/plugins/plugin-auth/src/** (only to write the server-side sub-second issue claim), packages/plugins/plugin-auth/test/** (or the package's existing test dir), .changeset/*.md. Stop on breach.
    Container & model: S/M, mode:subagent, model: default tier (no path-derived mandate: dispatch-gates --tier on the two files), effort: high (seat order)
    Clause-②: yes
    Metadata-protocol: none
    Responsibility: plugin-auth in objectstack (mcp-token-revocation.ts:275 compares the JWT iat in whole seconds ×1000 against the credential change time in ms, strict <, so a token minted after the change in the same second is refused); platform path covering it: none; reach: any MCP client that connects right after a password change or reset, on every deployment (measured on cloud pin round cloud#4920).
    Thread-read: 7064790122
    Premise: holds on origin/main 0db6f8f (git grep -n "issuedBeforeCredentialChange(issuedAt \* 1000" hits mcp-token-revocation.ts:275; the docblock above mcpConsentAdmits documents the same-second refusal as deliberate, which security#2 notes and the fix corrects).
    Serial constraints cleared: no open a4-B claim on plugin-auth; the dev runs overlap-check before the first push. Clause-② reading: a same-second token minted after the change is newly admitted (a widened accept set, not a new export unless the dev adds one, which it then declares).

  6. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 21, 2026
  7. objectstack-fleet commented on Nov 21, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#4 · os-project-manager · session_01FEkQ5pb2t8Z8C64PkPyVt1
    os-dev-report

    {
      "issue": 36125,
      "status": "done",
      "branch": "claude/area-a4B-36125",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/36175",
      "pr_number": 36175,
      "head_sha": "8bebb598f6192c4e0927c952c1db9bb58a3f0d70",
      "session": "session_01FEkQ5pb2t8Z8C64PkPyVt1",
      "premise_still_valid": true,
      "summary": "Built security#2 option (a) as written. Measured: the MCP access token is a JWT the provider signs and never stores (better-auth/oauth-provider 1.7.12; the door refuses non-JWS tokens, so no opaque token reaches mcpConsentAdmits). The server now signs a sub-second issue claim iat_ms into every JWT access token through an oauthProvider extensions access-token claims contributor (issuedAtMsAccessTokenClaim, auth-manager-plugin-list.ts). It writes Date.now() at a mint only, because the provider calls contributors with grantType undefined when it re-derives an opaque token's introspection claims. verifyMcpAccessTokenClaims reads the claim off the same verified payload as iat, and mcpConsentAdmits compares mcpTokenIssuedAtMs(iat, claim) with the credential change by the unchanged strict less-than. The claim counts only when it is a safe integer inside the second iat names; absent or unplaceable falls back to iat*1000, today's whole-second refusal, never to an admit. The consent comparison is unchanged. The docblock above mcpConsentAdmits and the MCP line in credential-change-ends-prior-access.ts now state the ms rule; the /verify-email paragraph is untouched. One nuance for the seat: in 1.7.12 createUserTokens stamps iat, then derives claims, then signs, so iat_ms is the claims-callback instant (a few ms after the iat instant, after grant validation, before signing). It is bounded to iat's second. A reset deletes the consent, which the consent read refuses on its own. This is stated in the PR's Acceptance notes.",
      "tests": "New top-level describe in the existing real-provider harness src/mcp-token-revocation.test.ts (real AuthManager, provider 1.7.12, better-sqlite3; DCR+PKCE+consent+token+refresh+/change-password with Date frozen per step): (1) same-second token minted AFTER the change admitted, asserting iat=second and iat_ms=second+900 on the real token and the change read back at second+400; (2) same-second token minted BEFORE the change refused (iat_ms=second+100); (3) no claim in the change second refused, with the signed claim as the admitted control; (4) unreadable claim (string, fractional, later or earlier second, NaN, Infinity, null, object) refused each; (5) contributor writes at a mint only. Single file at f2d3522c: Test Files 1 passed, Tests 27 passed, VERDICT command-exit 0. Full package at 8bebb598: pnpm --filter @objectstack/plugin-auth test, Test Files 291 passed (291), Tests 6189 passed | 10 skipped (6199), VERDICT command-exit 0. Typecheck at 8bebb598 (after building plugin-auth for the examples leg): VERDICT command-exit 0, check:test-typecheck OK; the first try exited 2 only because the examples tsconfig self-imports plugin-auth's dist, which was not built yet. Ablations via scripts/ablation-replace.mjs WRAP, each anchor 1 to 0, each restored to the HEAD blob with git diff HEAD empty; the subject is in src and imported relatively, so there is no dist leg: A1 claim ignored, 3 failed (AFTER pin, no-claim control, unit); A2 same second read as after, 2 failed (BEFORE pin, unit); A3 fallback admits, 3 failed (no-claim, unreadable, unit); A4 second bound deleted, 1 failed (unreadable); A5 integer guard deleted, 1 failed (unreadable); A6 contributor removed from provider options, 3 failed (both starred pins, no-claim control).",
      "gates": "Local: ① pnpm --workspace-concurrency=2 --filter '@objectstack/plugin-auth^...' build, VERDICT command-exit 0. ② plugin-auth test and typecheck exit 0 (above). ③ node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack (change set 6 paths vs merge base 0db6f8fbe) gave 68 families. Each ran with its exit code captured before any pipe: 66 exit 0, including check:nul-bytes, check:engine-double-contract, check:test-source-alias, check:cross-package-test-inputs, check:published-files, check:adr-0087-registration --base origin/main, check-changeset-no-major and check-empty-changeset. Two exit 3, read as NOT MEASURED, not red: node scripts/check-plugin-teardown-shape.mjs --self-test (shallow clone, the positive-control commit is unreachable; remedy git fetch --unshallow, not taken on the shared .git) and pnpm check:dual-build-cjs-loads (PREREQUISITE NOT MET, it needs dist for every package and only the plugin-auth closure is built). Both run in CI's Lint & Repo Gates. --ran reconciliation: '68 derived famil(ies) accounted for — 68 run', RAN_EXIT=0. overlap-check on 8bebb598: 'VERDICT clean exit 0' (origin/main merges cleanly, 0 PR heads). check-platform-checklist not owed: no exported symbol was renamed or deleted, and the new exports are not published through index.ts. CI check-runs on #36175: in_progress at report time, not waited for.",
      "dogfood_battery": "n/a — no `!` in the PR title; Clause-② arm is (widening), not (narrowing)",
      "line_budget": "6 files, +196 / -13 (src +101/-13 across 4 files, test +94, changeset +14); no skills/** or ratcheted ledger touched",
      "files_changed": [
        ".changeset/36125-mcp-token-issue-time-ms.md",
        "packages/plugins/plugin-auth/src/auth-manager-mcp-access-token.ts",
        "packages/plugins/plugin-auth/src/auth-manager-plugin-list.ts",
        "packages/plugins/plugin-auth/src/credential-change-ends-prior-access.ts",
        "packages/plugins/plugin-auth/src/mcp-token-revocation.test.ts",
        "packages/plugins/plugin-auth/src/mcp-token-revocation.ts"
      ],
      "deviations": [
        "File surface: the claim lists mcp-token-revocation.ts, credential-change-ends-prior-access.ts, the mint site, tests and the changeset. Reading the claim off the verified payload also needs auth-manager-mcp-access-token.ts (verifyMcpAccessTokenClaims returns the raw claim; verifyMcpAccessToken passes it). The payload exists only there. overlap-check is clean; the seat should add this file to the claim's surface.",
        "Dispatch said pr_create with no assignees. os-dev.md rule 2 says the PR's assignee is the claim's Account:, carried by pr_create, and os-dev.md wins on conflict. So the create carried assignees [os-project-manager]; the read-back lists it.",
        "The first gate loop's stdin was consumed by a child, and my bounded wait was misread as the loop's end, so I started a second loop. For a few minutes 8 families (tenancy-census, published-files, query-options-erasure, refd-timer-probe, registry-log-declared, rest-log-spy-declared, route-envelope, settings-bind-window) ran twice, concurrently. All exited 0 both times. I stopped the duplicate loop (its PID was recorded). The final --ran reconciliation is on the completed record.",
        "test:repo not run locally: the diff touches no repo-project test (it belongs to CI's Test Core)."
      ],
      "mcp_calls": "0",
      "api_writes": "2 relay strokes. (1) pr_create, run 44933168955: POST /repos/objectstack-ai/objectstack/pulls (draft forced) and POST /repos/objectstack-ai/objectstack/issues/36175/assignees. (2) This os-dev-report comment through post-stamped: POST /repos/objectstack-ai/objectstack/issues/36125/comments. Plus two git pushes to claude/area-a4B-36125 (the empty-branch probe, then the commits; not REST).",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": []
    }
  8. objectstack-fleet commented on Nov 21, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#4 · os-project-manager · session_01FEkQ5pb2t8Z8C64PkPyVt1

    Claim revision · 2026-11-21T18:04Z · same session, same branch claude/area-a4B-36125, PR #36175 (dev report 7066960609).
    File surface: as claim 7066254754, plus packages/plugins/plugin-auth/src/auth-manager-mcp-access-token.ts (the verified JWT payload, where iat is read, is only in hand there, so the signed sub-second claim is read there and passed on). The mint site is packages/plugins/plugin-auth/src/auth-manager-plugin-list.ts (the provider's access-token claims contributor), inside the claim's "where the MCP access token is minted" line. overlap-check on the head: clean.
    Clause-②: yes
    Metadata-protocol: none

  9. objectstack-fleet commented on Nov 21, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#4 · os-project-manager · session_01FEkQ5pb2t8Z8C64PkPyVt1

    Claim revision 2 · 2026-11-21T18:32Z · same session, same branch claude/area-a4B-36125, PR #36175.
    File surface: as revision 7066984225, plus content/docs/permissions/authentication.mdx (L1-a REWORK 7067327130 R1: the page states the MCP same-second refusal this PR removes; a published page this round makes false is in scope) and any other published sentence that states that refusal.
    Clause-②: yes
    Metadata-protocol: none

  10. objectstack-fleet commented on Nov 21, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#4 · os-project-manager · session_01FEkQ5pb2t8Z8C64PkPyVt1
    os-dev-report

    {
      "issue": 36125,
      "status": "done",
      "round": "patch round for L1-a REWORK comment 7067327130, item R1 (docs only)",
      "branch": "claude/area-a4B-36125",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/36175",
      "pr_number": 36175,
      "head_sha": "f9e6ff6422043a16828a2d35ec10fffc955dc391",
      "previous_head_sha": "8bebb598f6192c4e0927c952c1db9bb58a3f0d70",
      "session": "session_01FEkQ5pb2t8Z8C64PkPyVt1",
      "premise_still_valid": true,
      "summary": "R1 is fixed in one docs commit, f9e6ff64. In content/docs/permissions/authentication.mdx, at the end of the paragraph about the change's moment, the clause 'so does an MCP access token' is replaced. The new text matches the changeset: an MCP access token carries its issue time in milliseconds, signed into it by the server, so one minted after the change in the same second is admitted; a token without that value (minted before this release), or one whose value cannot be placed, keeps the whole-second refusal. The link sentence is unchanged. Sweep for other sentences stating the MCP same-second refusal: none. A case-insensitive grep for 'same second', 'whole seconds' and 'whole-second' over content/docs/** and the plugin-auth *.md/*.mdx files (CHANGELOG excluded as release-owned) hit only this line, plus two unrelated hits in kernel/cluster.mdx:907 and data-modeling/drivers.mdx:650. The other MCP and password sentences on the page, at lines 346-350, 433-436 and 1399-1400 (pre-edit numbering), say only that a token issued before a change is refused. They stay true. No code changed in this round.",
      "tests": "No test-bearing change: docs only, so there is no ablation. The plugin-auth readings from 8bebb598 still hold, because no src or test file moved (git diff 8bebb598 f9e6ff64 touches only the .mdx).",
      "gates": "dispatch-gates --commands --repo objectstack-ai/objectstack at f9e6ff64 derives 100 families: the 68 from round 1 plus 32 new docs families for the .mdx. It also warned that the tree is 11 commits behind origin/main 31b2666d and that 4 derivation inputs changed in that range. I did not merge main, since there is no conflict, no main-caused red and no queue removal. The 32 new families ran at f9e6ff64 with stdin closed and exit codes captured before any pipe, after building the spec, lint and client-react closures under the verify lock (VERDICT command-exit 0 each). All 32 exit 0, including check:doc-anchors, check:doc-frontmatter, check:docs-single-h1, check:docs-redirects, check:docs-spec-enumerations, check:docs-transcript-drift, check:corpus-claim-drift, check:role-word, check:vendor-version-stamps, check:published-readme-links, lint check:doc-security-posture and check:doc-formula-expressions, spec check:docs, check:liveness, check:empty-state, check:yaml-examples, check:variant-docs, check:strictness-ledger, check-adr-links, check-docs-section-name, check-section-landing-index and check-doc-route-spelling --advisory. One of them, spec check:skill-examples, first exited 3 (PREREQUISITE NOT MET, client-react dist missing). After building client-react it exited 0: '347 prose examples type-check across 3 surface(s)'. The 68 round-1 families were run at 8bebb598, whose src is identical. --ran over the union: '100 derived famil(ies) accounted for — 100 run', RAN_EXIT=0. Round 1's two NOT MEASURED families still stand, CI-owned: check-plugin-teardown-shape --self-test and check:dual-build-cjs-loads. overlap-check before push: the first run exited 3 (shallow clone, PR 34738 unrelated histories). After git fetch --deepen=1500 origin main it gave 'VERDICT clean exit 0': origin/main merges cleanly, and PRs 36163, 36145 and 34738, which share authentication.mdx, merge cleanly. CI on the new head: not waited for.",
      "dogfood_battery": "n/a — no `!` in the PR title; Clause-② arm is (widening)",
      "line_budget": "this round: 1 file, +4 / -2; PR total 7 files, +201 / -15",
      "files_changed": [
        "content/docs/permissions/authentication.mdx"
      ],
      "files_changed_pr_total": [
        ".changeset/36125-mcp-token-issue-time-ms.md",
        "content/docs/permissions/authentication.mdx",
        "packages/plugins/plugin-auth/src/auth-manager-mcp-access-token.ts",
        "packages/plugins/plugin-auth/src/auth-manager-plugin-list.ts",
        "packages/plugins/plugin-auth/src/credential-change-ends-prior-access.ts",
        "packages/plugins/plugin-auth/src/mcp-token-revocation.test.ts",
        "packages/plugins/plugin-auth/src/mcp-token-revocation.ts"
      ],
      "deviations": [
        "PR body not edited. The coordinator asked to add the file to the body's file notes. os-dev.md says a subagent writes the PR body only at pr_create and never PATCHes it; the seat writes it on the subagent's behalf, and os-dev.md wins on conflict. Text for the seat to add as the 4th item of 'Read first (by risk)': 4. content/docs/permissions/authentication.mdx: the MCP clause at the end of the paragraph about the change's moment (L1 R1). To the 'File surface' acceptance note: content/docs/permissions/authentication.mdx (R1, docs only).",
        "The claim surface does not name content/docs/**. Per the coordinator, the seat posts a surface revision.",
        "The worktree was removed after round 1, so it was recreated from origin/claude/area-a4B-36125 at 8bebb598 and freshly installed. It is removed again after this report."
      ],
      "mcp_calls": "0",
      "api_writes": "1 relay write this round: this delta comment through post-stamped, POST /repos/objectstack-ai/objectstack/issues/36125/comments. Plus one git push to claude/area-a4B-36125 (f9e6ff64; not REST).",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": []
    }
  11. objectstack-fleet commented on Nov 21, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#4 · os-project-manager · session_01FEkQ5pb2t8Z8C64PkPyVt1
    os-dev-report

    {
      "issue": 36125,
      "status": "done",
      "round": "patch round F1 (contract review comment 7068066425)",
      "branch": "claude/area-a4B-36125",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/36175",
      "pr_number": 36175,
      "head_sha": "82a35f8cdc7f8b3c3cc61b456387ffa3074d7f99",
      "previous_head_sha": "f9e6ff6422043a16828a2d35ec10fffc955dc391",
      "session": "session_01FEkQ5pb2t8Z8C64PkPyVt1",
      "premise_still_valid": true,
      "summary": "F1 is built as ruled in commit 82a35f8c. mcpConsentAdmits now reads the credential clock, then the consent. It uses the ms placement (mcpTokenIssuedAtMs) only when a consent row is in hand, and compares a token admitted without one (skip_consent) on iat * 1000. The client, disabled, iat, clock and consent-createdAt refusals are unchanged, and a store or clock error still refuses. Nothing newly admits: a consent-row token is judged as in the previous head, and a no-consent token is judged on the whole-second value, which is never later than the ms placement. One cost: a token refused by the password comparison now also costs the consent read, which used to be skipped. The docblocks of mcpConsentAdmits, MCP_ISSUED_AT_MS_CLAIM and mcpTokenIssuedAtMs state the consent-row condition. The claim's docblock also states its lowest precedence in the provider's claim merge (N1). The changeset title and bullets and the authentication.mdx sentence are narrowed to an app the user granted access to through the consent step; an app admitted without a consent step keeps the whole-second refusal. The 'Where it is wired' MCP line in credential-change-ends-prior-access.ts is narrowed the same way, because otherwise it would have become false. All edits stay inside the 7 PR files.",
      "tests": "New pin in src/mcp-token-revocation.test.ts: 'a token admitted without a consent row keeps the whole-second rule'. A skip_consent client with no consent row (asserted) has its token minted at second+900, after a change at second+400, carrying iat=second and iat_ms=second+900; it is refused. Control: the same grant's token minted at second+1100 is admitted. At 82a35f8c: the single file gave Tests 28 passed, VERDICT command-exit 0. The full package (pnpm --filter @objectstack/plugin-auth test) gave Test Files 291 passed (291) and Tests 6190 passed | 10 skipped (6200), VERDICT command-exit 0. Typecheck after the package build: VERDICT command-exit 0. The consented-client pins (after admitted, before refused, no claim refused, unreadable refused) stay green.",
      "ablation": "scripts/ablation-replace.mjs WRAP. Anchor 'const issuedAtMs = consent ? mcpTokenIssuedAtMs(issuedAt, issuedAtMsClaim) : issuedAt * 1000;' replaced by 'const issuedAtMs = mcpTokenIssuedAtMs(issuedAt, issuedAtMsClaim);', which routes the no-consent path through the ms placement. Mutation landed: anchor 1 to 0, blob 46e4175f93e5 to 0be28563e3c7. Result: 1 failed | 5 passed, only the new pin red. Restored: blob == HEAD (46e4175f93e5) and git diff HEAD is empty.",
      "gates": "① pnpm --workspace-concurrency=2 --filter '@objectstack/plugin-auth^...' build: VERDICT command-exit 0. The docs families' spec, lint and client-react closures were also built: VERDICT command-exit 0. ② plugin-auth typecheck and test: exit 0 (above). ③ dispatch-gates --commands --repo objectstack-ai/objectstack at 82a35f8c derives 100 families, the same set as the previous round. It warned that the tree is 15 commits behind origin/main and that 4 derivation inputs changed; I did not merge main, since there is no conflict, no main-caused red and no queue removal. All 100 ran at 82a35f8c with stdin closed and exit codes captured before any pipe: 98 exit 0 and 2 exit 3, read as NOT MEASURED and CI-owned, as in round 1: check-plugin-teardown-shape --self-test (its positive-control commit is unreachable) and check:dual-build-cjs-loads (repo-wide dist). --ran: '100 derived famil(ies) accounted for — 100 run', RAN_EXIT=0. overlap-check before push at 82a35f8c: 'VERDICT clean exit 0' (origin/main a2dc85896a and PRs 36163, 36145 and 34738 merge cleanly). CI on the new head: not waited for.",
      "dogfood_battery": "n/a — no `!` in the PR title; Clause-② arm is (widening)",
      "line_budget": "this round: 5 files, +72 / -25; PR total 7 files, +249 / -16",
      "files_changed": [
        ".changeset/36125-mcp-token-issue-time-ms.md",
        "content/docs/permissions/authentication.mdx",
        "packages/plugins/plugin-auth/src/credential-change-ends-prior-access.ts",
        "packages/plugins/plugin-auth/src/mcp-token-revocation.test.ts",
        "packages/plugins/plugin-auth/src/mcp-token-revocation.ts"
      ],
      "deviations": [
        "PR body not sent. Item 5 asked for a relay edit of the body. os-dev.md says a subagent writes the PR body only at pr_create and never PATCHes it; the seat writes it on the subagent's behalf. The relay header (dispatch.mjs, 'A pull request's body, rewritten by the seat after round 1') assigns that rewrite to the seat too. The complete revised body is ready in this container, built on the live body (identical to the created one): /tmp/claude-0/-home-user/54db0a22-6e46-5526-a68c-833e2bd4f6ff/scratchpad/issue-36125/pr-body-v2.md. The first two lines and the closing signed line are unchanged. The 维护者速读 change and impact lines are narrowed to consent-step apps. The Acceptance sentence about the reset is replaced by the plain rule. The new pin and the round-3 readings are added, and the file note for authentication.mdx is added. It carries no control bytes and no angle-bracket fragments outside the two allowed HTML comments.",
        "credential-change-ends-prior-access.ts docblock line narrowed beyond the five listed items, because the F1 rule would have made it false; it is inside the 7 PR files."
      ],
      "mcp_calls": "0",
      "api_writes": "1 relay write this round: this delta comment through post-stamped, POST /repos/objectstack-ai/objectstack/issues/36125/comments. Plus one git push to claude/area-a4B-36125 (82a35f8c; not REST).",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": []
    }
  12. objectstack-fleet commented on Nov 21, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#4 · os-project-manager · session_01FEkQ5pb2t8Z8C64PkPyVt1

    Landed · 2026-11-21T20:53Z: PR #36175 merged and its Fixes #36125 closed this card as completed.

    Reading Value
    PR #36175 MERGED (merge 011635f453) at head 82a35f8cdc; L1 ACCEPT 7068741291 (L1-a), contract PASS 7068761447 (CONTRACT_REVIEW_TIER), landing record 7068777133
    Delivered security#2's option (a) (7064790122): an MCP access token carries a server-signed millisecond issue time, so a token for an app the user granted access to through the consent step, minted after a password change in the same second, is admitted. An app admitted without a consent step, and any token without a placeable value, keeps the whole-second refusal. The strict < rule is unchanged.

    State change: pm:dispatched removed in the same write; domain:server, area:auth and the grade stay. Nothing is left on this card. Cloud's repro (scim-leaver-lifecycle.e2e, cloud#4920) can drop its wait once it picks up this release; that is the cloud side's call.

  13. removed
    pm:dispatched
    on Nov 21, 2026
  14. added a commit that references this issue on Nov 22, 2026
    011635f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area:authbugdomain:serverfindingpriority:p1

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions