Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
f46c97f
fix(deps): take the fixed releases for seven advisories and refresh b…
claude Dec 2, 2026
425d082
chore(changeset): patch notes for the dependency refresh
claude Dec 2, 2026
0083093
fix(deps): keep the better-auth family on 1.7.12
claude Dec 2, 2026
43fc955
docs(deps): name the real ws and cross-spawn dependents in the overri…
claude Dec 2, 2026
8542d60
fix(deps): lift the better-auth family to 1.7.29 again
claude Dec 2, 2026
376f22c
fix(plugin-auth): follow better-auth 1.7.29's role-list reading on th…
claude Dec 2, 2026
2eaa477
fix(plugin-auth): read texted codes under better-auth 1.7.29's phone-…
claude Dec 2, 2026
f71b7b7
fix(plugin-auth): keep a locked account's change-email link refused a…
claude Dec 2, 2026
1807a70
test(plugin-auth): bind the address-change links to their account, as…
claude Dec 2, 2026
8847d6e
test(plugin-auth): pin the oauth-provider 1.7.29 refusals as they now…
claude Dec 2, 2026
6c25fe8
docs(plugin-auth): note better-auth 1.7.29's change-email step
claude Dec 2, 2026
513576d
test(plugin-auth): pay the egress module's first load at collection i…
claude Dec 2, 2026
e986400
chore(changeset): say what the better-auth 1.7.29 lift changes and ke…
claude Dec 2, 2026
10a9ad6
fix(plugin-auth): refuse a sessionless address-change link for a seco…
claude Dec 2, 2026
2992d19
docs(plugin-auth): scope the better-auth 1.7.12 readings to the then-…
claude Dec 2, 2026
db8aeb1
fix(plugin-auth): admit a change-email link only for the bound accoun…
claude Dec 2, 2026
d9acfd4
fix(plugin-auth): keep the engine-less manager's change-email link wo…
claude Dec 2, 2026
e75528a
fix(plugin-auth): read second-factor enrollment through the vendor ad…
claude Dec 2, 2026
eaa7cf1
fix(plugin-auth): read the blank-role invite caller through resolveActor
claude Dec 2, 2026
551ad8e
test(dogfood): external directory under better-auth 1.7.29's invitati…
claude Dec 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .changeset/39068-deps-refresh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
'@objectstack/driver-odata': patch
'@objectstack/metadata': patch
'@objectstack/plugin-auth': patch
'@objectstack/plugin-email': patch
'@objectstack/mcp': patch
'@objectstack/connector-mcp': patch
'@object-ui/auth': patch
'@object-ui/cli': patch
---

fix(deps): the fixed releases for seven advisories, and better-auth 1.7.29

Clause-②: no
Metadata-protocol: none

A downstream install now resolves the fixed release of every dependency these packages declare that `pnpm audit` flagged:

- `fast-xml-parser` 5.12.1 (GHSA-7cfw-w2rf-f3jc): `@objectstack/driver-odata` declares `^5.12.1`; `@objectstack/plugin-auth` keeps its exact pin, now `5.12.1`, the same release `@better-auth/sso` resolves.
- `glob` 14.0.6 (GHSA-qxr8-q827-836c): `@objectstack/metadata` and `@object-ui/cli` declare `^14.0.6`.

The same release refreshes four runtime dependencies to their latest patch level:

- `better-auth` and the `@better-auth/*` family 1.7.12 → 1.7.29 (`@objectstack/plugin-auth`, `@object-ui/auth`), still exact. The upstream releases in between include stricter session revocation (a revoke or sign-out that a hook vetoes now fails instead of reporting success, and revoking a session expires its cookies), an origin check on anonymous sign-in, headers and cookies set by a `hooks.before` hook now reaching the response, and stricter organization role and invitation handling. Every symbol `@objectstack/plugin-auth` imports is still exported.

What changes for an auth client, from the vendor:
- The address-change link (`GET /verify-email` with a change-email token) no longer signs anyone in. The new address is marked verified only when the address being left was verified.
- A refused authorization-code exchange whose session has ended now leaves the code unspent. The same code keeps answering `400 invalid_request` (`session no longer exists`) until it expires, and it can never mint a token.
- Registering a native OAuth client with a plain-http, non-loopback redirect URI is still refused `400 OAUTH_REGISTER_FAILED`. `details.upstreamError` now names `invalid_redirect_uri`.
- Only an organization role that may create invitations may list them. `GET /organization/list-invitations` refuses every other role `403 YOU_ARE_NOT_ALLOWED_TO_LIST_INVITATIONS`, and `get-full-organization` answers it no invitations; this includes `member` and `external`. A pending invitation id works as a join link, so it is shown only to roles that could mint one. A person's own received invitations stay on `GET /organization/list-user-invitations`.

What `@objectstack/plugin-auth` keeps as it was:
- The texted sign-in and reset codes are read under the vendor's new identifiers. A password reset by texted code completes, and the checks that read those codes still apply: the account a reset names, and a code texted before a credential change being ended.
- A blank invitation role or an empty entry in a role list (`"member,"`) is still refused `400 ROLE_NOT_FOUND` with the sentence that says the role is empty. The vendor now drops empty entries itself.
- A locked account's address-change link is still refused with the lockout answer, and the address does not move.
- An address-change link opened without signing in, for an account enrolled in a second factor, still does not move the address: it is refused `401 UNAUTHENTICATED` ("Sign in to confirm the address change"), and no session is issued. Before, the link met the second-factor challenge; it no longer signs anyone in. Signed in, the link works as before; an account with no second factor follows the vendor's link.
- The remove-member owner guard reads both roles the way the vendor now does: trimmed, with empty entries dropped.
- `nodemailer` `^10.6.2` (`@objectstack/plugin-email`).
- `@modelcontextprotocol/sdk` `^1.32.2` (`@objectstack/mcp`, `@objectstack/connector-mcp`).

The transitive `ws`, `cross-spawn` and `minimatch` advisories, and `undici` 8.14.0, are fixed in this repository's own install only; nothing published declares them. No API or export of these packages changes.
2 changes: 1 addition & 1 deletion examples/app-showcase/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"test:smoke": "playwright test --config=playwright.config.ts"
},
"dependencies": {
"@modelcontextprotocol/sdk": "^1.30.1",
"@modelcontextprotocol/sdk": "^1.32.2",
"@objectstack/cloud-connection": "workspace:*",
"@objectstack/connector-mcp": "workspace:*",
"@objectstack/connector-openapi": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/connectors/connector-mcp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"typecheck": "tsc --noEmit && pnpm check:test-typecheck"
},
"dependencies": {
"@modelcontextprotocol/sdk": "^1.30.1",
"@modelcontextprotocol/sdk": "^1.32.2",
"@objectstack/core": "workspace:*",
"@objectstack/spec": "workspace:*",
"@objectstack/types": "workspace:*"
Expand Down
2 changes: 1 addition & 1 deletion packages/drivers/driver-odata/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@objectstack/core": "workspace:*",
"@objectstack/spec": "workspace:*",
"@objectstack/types": "workspace:*",
"fast-xml-parser": "^5.12.0",
"fast-xml-parser": "^5.12.1",
"zod": "^4.6.6"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/mcp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"typecheck": "tsc --noEmit && pnpm check:test-typecheck"
},
"dependencies": {
"@modelcontextprotocol/sdk": "^1.30.1",
"@modelcontextprotocol/sdk": "^1.32.2",
"@objectstack/core": "workspace:*",
"@objectstack/formula": "workspace:*",
"@objectstack/lint": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/metadata/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
"@objectstack/spec": "workspace:*",
"@objectstack/types": "workspace:*",
"chokidar": "^5.0.0",
"glob": "^14.0.3",
"glob": "^14.0.6",
"js-yaml": "^5.4.1",
"zod": "^4.6.6"
},
Expand Down
12 changes: 6 additions & 6 deletions packages/plugins/plugin-auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@
"gen:test-typecheck-debt": "tsx ../../../scripts/check-test-typecheck.mts --update --package packages/plugins/plugin-auth --project tsconfig.test.json"
},
"dependencies": {
"@better-auth/core": "1.7.12",
"@better-auth/oauth-provider": "1.7.12",
"@better-auth/scim": "1.7.12",
"@better-auth/sso": "1.7.12",
"@better-auth/core": "1.7.29",
"@better-auth/oauth-provider": "1.7.29",
"@better-auth/scim": "1.7.29",
"@better-auth/sso": "1.7.29",
"@noble/hashes": "^2.4.0",
"@objectstack/core": "workspace:*",
"@objectstack/platform-objects": "workspace:*",
Expand All @@ -60,8 +60,8 @@
"@objectstack/service-messaging": "workspace:*",
"@objectstack/spec": "workspace:*",
"@objectstack/types": "workspace:*",
"better-auth": "1.7.12",
"fast-xml-parser": "5.12.0",
"better-auth": "1.7.29",
"fast-xml-parser": "5.12.1",
"hono": "^4.13.16",
"jose": "^6.2.12"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,30 @@ describe('#29158 — invite-member refuses a blank role 400 ROLE_NOT_FOUND, like
});
}

// The bearer lane: the global before hook runs ahead of bearer()'s
// conversion, so a bare session read there misses this caller and the
// vendor (1.7.29) normalizes "member," to "member" and answers 200.
it('an empty entry in a role list, from a BEARER caller, is refused 400 ROLE_NOT_FOUND and no invitation row exists', async () => {
const { engine, manager } = await bootWithOwner();
const signedIn = await post(manager, '/sign-in/email', { email: 'owner@example.com', password: PASSWORD });
expect(signedIn.status, await signedIn.clone().text()).toBe(200);
const bearer = signedIn.headers.get('set-auth-token');
expect(bearer, 'the sign-in hands out a bearer token').toBeTruthy();
const email = 'qa-blank-role-bearer@example.com';

const res = await manager.handleRequest(
new Request(`${BASE}/api/v1/auth/organization/invite-member`, {
method: 'POST',
headers: { 'Content-Type': 'application/json', authorization: `Bearer ${bearer}` },
body: JSON.stringify({ email, role: 'member,', organizationId: DEFAULT_ORG }),
}),
);
const text = await res.clone().text();
expect(res.status, text).toBe(400);
expect(((await res.json()) as any).code).toBe('ROLE_NOT_FOUND');
expect(invitationsFor(engine, email)).toHaveLength(0);
});

it('a delegated admin\'s blank role answers ROLE_NOT_FOUND too — the blank refusal runs before the role cap', async () => {
const { engine, manager } = await bootWithOwner();
const delegate = await signUp(manager, engine, 'delegate.blank@example.com');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* ## The defect, at the seam
*
* better-auth (`dist/api/routes/update-user.mjs`, measured against the
* installed `1.7.12`) refuses three conditions on these two doors with
* then-installed `1.7.12`) refuses three conditions on these two doors with
* `APIError.fromStatus("BAD_REQUEST", { message })` — a message and no `code`:
*
* POST /change-email {"newEmail": <the caller's own address>}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,11 @@ export async function createAuthInstance(this: AuthInstanceHost): Promise<Auth<a
// 2. `GET /verify-email?token=…` applies it: `updateUserByEmail(old,
// { email: newEmail, emailVerified: true })`, then re-issues the
// session cookie on the new identity.
// better-auth 1.7.29 changed step 2: the token is bound to the
// account (`userId`), the link no longer signs anyone in (it only
// refreshes the caller's own session cookie), and the new address
// is marked verified only when the old one was. A locked account's
// link is refused ahead of it (`change-email-link-lockout.ts`).
// So the change is confirmed by proving control of the new mailbox —
// 「变更需确认」 — and an unclicked request changes nothing.
//
Expand Down
18 changes: 17 additions & 1 deletion packages/plugins/plugin-auth/src/auth-manager-before-hook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ import { refuseSsoDiscoveryHostNotPublic, ssoDiscoveryCompanionContext } from '.
import { declareSsoDiscoveryReadsOf, judgeSsoDiscoveryUrl } from './sso-discovery-egress.js';
import { snapshotRoleChangeGrants, UPDATE_MEMBER_ROLE_PATH } from './role-change-granted-set.js';
import { refuseVisitorResendWithoutLiveTransport } from './visitor-verification-resend.js';
import { refuseBlankInvitationRoleAtTheDoor } from './invite-role-not-found-code.js';
import { refuseChangeEmailLinkForLockedAccount } from './change-email-link-lockout.js';
import { refuseSessionlessChangeEmailLinkForSecondFactor } from './change-email-link-second-factor.js';

/**
* Every client an `/oauth2/authorize` request names, for the ADR-0069 D5.1
Expand Down Expand Up @@ -278,6 +281,13 @@ export async function globalBeforeHook(
// the endpoint context does not reach the database hooks. Lockout on only;
// see `auth-manager-sign-in-lockout.ts`.
await recordLockoutRequest.call(this, ctx);
// ADR-0069 D2: a change-email link no longer opens a session (better-auth
// 1.7.29), so a locked account's link is refused here instead of at
// session creation (`change-email-link-lockout.ts`).
await refuseChangeEmailLinkForLockedAccount.call(this, ctx);
// The same link opened with no session no longer meets the second-factor
// challenge; an enrolled account is asked to sign in first.
await refuseSessionlessChangeEmailLinkForSecondFactor.call(this, ctx);

// ── A credential change ends access issued before it ──────────
// An email-change link, a verification link that signs its holder in and
Expand Down Expand Up @@ -895,7 +905,7 @@ export async function globalBeforeHook(
// reason the audience refusal above is — and STRICTLY after it.
//
// Same shield, its other arm. `shouldReturnGenericDuplicateResponse`
// (better-auth 1.7.12 sign-up.mjs:155) is on whenever
// (the then-installed better-auth 1.7.12 sign-up.mjs:155) is on whenever
// `requireEmailVerification` is on OR `autoSignIn === false`, and it
// guards TWO sites: the 403 catch at :227 (what the audience block
// above steps around) and the duplicate pre-check at :192–204. On
Expand Down Expand Up @@ -981,6 +991,12 @@ export async function globalBeforeHook(
});
}

// ── #29158: a blank invitation role, refused on the raw body ──
// better-auth 1.7.29 normalizes the role list before
// `beforeCreateInvitation` sees it, so the blank-entry refusal is asked
// here, ahead of that normalization (`invite-role-not-found-code.ts`).
await refuseBlankInvitationRoleAtTheDoor(ctx);

// ── #27862: read the member's org-admin grants before a role change ──
// The after hook compares them with what the change left held and names
// the set it granted (see `role-change-granted-set.ts`). A read only: it
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,10 @@ export async function buildOrganizationPlugin(this: OrganizationPluginHost) {
// written. better-auth's own check drops empty entries, so without
// this the invitation is stored with `role: ''` and, under a wall, its
// acceptance writes a membership with no organization role. Refused,
// never defaulted to `member`.
// never defaulted to `member`. Since better-auth 1.7.29 the route
// normalizes the role list before this hook runs, so the door-level
// refusal in the `before` hook (`refuseBlankInvitationRoleAtTheDoor`)
// answers first; this arm stays as the second line.
const blankRole = blankInvitationRoleRefusal(invitation?.role);
if (blankRole) {
const { APIError } = await import('better-auth/api');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ describe('a banned user is minted no token at the token endpoint while the ban h
});
const UNKNOWN_CODE = 'not-an-issued-code';

it('a code issued before a ban that ended the user\'s sessions mints no token: the provider\'s session answer, and the code is spent', async () => {
it('a code issued before a ban that ended the user\'s sessions mints no token: the provider\'s session answer, before and after the ban is lifted', async () => {
const server = await bootServer(await captureProviderOptions(), { admin: true });
const clientId = await registerClient(server);
const cookie = await signUp(server, 'code.ban.route@acme.example.com');
Expand All @@ -538,10 +538,19 @@ describe('a banned user is minted no token at the token endpoint while the ban h
expect(refused.body).toEqual({ error_description: 'session no longer exists', error: 'invalid_request' });
expect(server.refreshRows(), 'no refresh family was started').toEqual([]);

// Spent either way: with the ban lifted, the same code answers as one never issued.
// Lifting the ban mints nothing either. Up to @better-auth/oauth-provider
// 1.7.12 the code was consumed before the session check, so it then
// answered as a code never issued; 1.7.29 checks the code's session first
// and consumes the code only on the way to a token, so it keeps answering
// that its session no longer exists. The session row is deleted and a
// session id is never issued again, so the code cannot reach a token
// before it expires.
row.banned = false;
row.banExpires = null;
expect(await codeAnswer(server, clientId, code)).toEqual(await codeAnswer(server, clientId, UNKNOWN_CODE));
const again = await codeAnswer(server, clientId, code);
expect(again.status).toBe(400);
expect(again.body).toEqual({ error_description: 'session no longer exists', error: 'invalid_request' });
expect(server.refreshRows(), 'no refresh family was started').toEqual([]);
});

it('a code exchanged while a banned user\'s session survived answers as a code never issued, and mints no token', async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/plugin-auth/src/auth-route-ledger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export const AUTH_ROUTE_LEDGER: readonly AuthRouteLedgerEntry[] = [
{ route: 'POST /api/v1/auth/oauth2/consent', family: 'oauth-provider', source: 'better-auth', disposition: 'sdk', client: 'oauth.consent', requires: 'oidcProvider' },
{ route: 'POST /api/v1/auth/oauth2/create-client', family: 'oauth-provider', source: 'better-auth', disposition: 'sdk', client: 'oauth.applications.register', requires: 'oidcProvider' },
{ route: 'POST /api/v1/auth/oauth2/delete-client', family: 'oauth-provider', source: 'better-auth', disposition: 'sdk', client: 'oauth.applications.delete', requires: 'oidcProvider' },
{ route: 'POST /api/v1/auth/oauth2/delete-consent', family: 'oauth-provider', source: 'better-auth', disposition: 'server-only', requires: 'oidcProvider', note: 'no SDK method builds this URL — the withdraw door is POST /authorized-clients/withdraw. Measured on @better-auth/oauth-provider 1.7.12: the vendor route does check the consent is the session user\'s, but answers an unknown id 404 and another person\'s id 401, so the two can be told apart, and it leaves the client\'s refresh family in place; the ObjectStack door answers both the same 404 and revokes the whole grant' },
{ route: 'POST /api/v1/auth/oauth2/delete-consent', family: 'oauth-provider', source: 'better-auth', disposition: 'server-only', requires: 'oidcProvider', note: 'no SDK method builds this URL — the withdraw door is POST /authorized-clients/withdraw. Measured on the then-installed @better-auth/oauth-provider 1.7.12: the vendor route does check the consent is the session user\'s, but answers an unknown id 404 and another person\'s id 401, so the two can be told apart, and it leaves the client\'s refresh family in place; the ObjectStack door answers both the same 404 and revokes the whole grant' },
{ route: 'GET /api/v1/auth/oauth2/get-client', family: 'oauth-provider', source: 'better-auth', disposition: 'sdk', client: 'oauth.applications.get', requires: 'oidcProvider' },
{ route: 'GET /api/v1/auth/oauth2/get-clients', family: 'oauth-provider', source: 'better-auth', disposition: 'sdk', client: 'oauth.applications.list', requires: 'oidcProvider' },
{ route: 'GET /api/v1/auth/oauth2/public-client', family: 'oauth-provider', source: 'better-auth', disposition: 'sdk', client: 'oauth.applications.getPublic', requires: 'oidcProvider' },
Expand Down
Loading
Loading