@lenne.tech/nest-server 12.6.14 → 12.6.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -174,7 +174,7 @@ load-bearing (it has since grown back to as many as 20, mostly as new advisories
174
174
  and they were removed, leaving `@graphql-tools/utils` and `multer`, both on an upstream EXACT pin with
175
175
  an open advisory. Those two left on 2026-10-29 (nest-server 12.1.0), once `@nestjs/graphql` 14.1.0 and
176
176
  `@nestjs/platform-express` 12.3.2 moved their pins past the fixes: **the set is empty** (`overrides: {}`,
177
- written explicitly so `check:overrides` reads it as a decision). An override is only necessary if removing it lets the package resolve
177
+ written explicitly so `check:overrides` reads it as a decision). Since 12.6.15 a further entry, `i18next` 26 -> 26.4.4: `@compodoc/compodoc` 2.0.0 exact-pins 26.3.3, and GHSA-6jcc-5g8w-32mx reached GitHub's global database on 2026-11-24, so `pnpm audit` failed the build (dev tooling only; the same entry the current line carries since 12.10.0). An override is only necessary if removing it lets the package resolve
178
178
  back INTO its vulnerable range (verify with a with/without lockfile diff; `pnpm audit` is the arbiter).
179
179
  "Cheap insurance against a parent re-pinning downwards" is not a reason to keep one: `pnpm audit` and
180
180
  `check:overrides` run on every `check` and report such a regression the day it happens. Each surviving entry carries its CVE rationale as a comment. Remove an entry once its parent dependency ships a fixed version.
@@ -461,6 +461,12 @@ allows minimatch in the production tree only under `@ts-morph/common` (ts-morph,
461
461
  matching globs the developer writes) — its `prodVia` form. `GHSA-3g3m-2fjr-6pw4` (glob `<= 14.0.1`) was a second
462
462
  entry until 2026-11-14 on this line (12.6.x), when rimraf 6.1.4 moved to glob 14 and no affected glob remained.
463
463
 
464
+ **Second entry since 2026-12-02 (owner decision 2026-11-15, "as GHSA-g3hv").** `GHSA-c859-jr93-m5j4` (minimatch
465
+ `>= 7.4.0 <= 11.0.7`, moderate: `minimatch.escape()` output matches more or less than the literal), fixed only in
466
+ 11.0.8, held below it by the same four consumers, none of which calls `minimatch.escape()`. It waited for GitHub's
467
+ global advisory database (listed 2026-12-01): a suppression of a GHSA the database does not know is `UNVERIFIED` and
468
+ fails under `CI`. Its guard allows minimatch in the production tree only under `@ts-morph/common`, as for GHSA-g3hv.
469
+
464
470
  **Before that, no entry from 2026-10-24.** `GHSA-vfj7-8cjw-p6xm` (braces, via nodemon / npm-watch) was
465
471
  listed from 2026-10-11 to 2026-10-24: a dev-tooling-only path of an advisory with no patched release
466
472
  at all. GitHub withdrew the advisory on 2026-10-23, and `check:overrides` reported the entry as
@@ -410,7 +410,7 @@ pnpm run check:mutations -- --id=<id> # one mutation
410
410
  pnpm run check:mutations -- --list # the registry, without running anything
411
411
  pnpm run check:mutations -- --allow-dirty # when the fix and its evidence share a working tree
412
412
  pnpm run check:mutations -- --jobs=4 # N mutations at a time (default: 2, or 4 on >=12 cores)
413
- pnpm run check:mutations -- --no-infra # only the 437 that need no MongoDB
413
+ pnpm run check:mutations -- --no-infra # only the 438 that need no MongoDB
414
414
  pnpm run check:mutations -- --since=<ref> # only mutations touching files changed since <ref>
415
415
  pnpm run check:mutations -- --shard=2/4 # this job's quarter of the selection (CI splits the full run)
416
416
  ```
@@ -430,7 +430,7 @@ when the registry, a vitest config or a setup file changed, since those can move
430
430
  commit, and in CI alongside the publish without blocking it. The price of caching is a cache that
431
431
  has to model each spec's full dependency closure correctly, and getting that wrong produces a stale
432
432
  PASS for a test that has since gone vacuous — exactly what the gate is there to prevent. Bad trade
433
- at 676 mutations.
433
+ at 678 mutations.
434
434
 
435
435
  **Decided 2026-10-03 (repo owner): keep the full run.** Measured at 128 mutations, the CI job for
436
436
  11.41.6 took **14 minutes**. The trigger to revisit is that wall time, not the mutation count —
@@ -501,9 +501,9 @@ exactly the environment where the answer matters.
501
501
 
502
502
  ### The cost is vitest's cold start, not the tests
503
503
 
504
- Worth knowing before optimising the wrong thing: the specs behind all 239 e2e mutations add up to
504
+ Worth knowing before optimising the wrong thing: the specs behind all 240 e2e mutations add up to
505
505
  **~40 seconds**. The step takes ~740s. The remaining ~700s is paying vitest's startup — process
506
- spawn, transform, module graph, mongod connect, DB create and drop — once per mutation, 676 times.
506
+ spawn, transform, module graph, mongod connect, DB create and drop — once per mutation, 678 times.
507
507
  That work is largely single-threaded I/O and barely scales with cores: the full registry measures
508
508
  **744s on a 12-core laptop and 777s on a 4-vCPU CI runner**.
509
509
 
package/CLAUDE.md CHANGED
@@ -178,7 +178,7 @@ pnpm run check:esm # Compiles what a vendor project receives as a "type": "
178
178
  # named import Node cannot see in a CJS package, a type imported as a value,
179
179
  # a missing `.js`; see .claude/rules/architecture.md → "Module Format"
180
180
  pnpm run check:vendor-lint # The core in the vendor layout, linted with nest-server-starter's .oxlintrc.json
181
- # (main on GitHub, or --starter=<path>), type-aware, warnings fail. A vendor
181
+ # (release/12.6.x on GitHub, or --starter=<path>), type-aware, warnings fail. A vendor
182
182
  # project lints with the STARTER's file: an exception only .oxlintrc.json here
183
183
  # has is green in `lint` and a warning there. Unreachable: skipped locally, red in CI
184
184
  pnpm run check:without-mongodb # dist/ with mongoose, @nestjs/mongoose and mongodb unresolvable: loads, boots on
package/FRAMEWORK-API.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @lenne.tech/nest-server — Framework API Reference
2
2
 
3
- > Auto-generated from source code as of 2026-11-19 (v12.6.14)
3
+ > Auto-generated from source code as of 2026-11-25 (v12.6.16)
4
4
  > File: `FRAMEWORK-API.md` — compact, machine-readable API surface for Claude Code
5
5
 
6
6
  ## CoreModule.forRoot()
@@ -1,3 +1,5 @@
1
1
  export declare function resolveBetterAuthCookiePrefix(basePath: string, env?: NodeJS.ProcessEnv): string;
2
2
  export declare function resolveBetterAuthSessionCookieName(basePath: string, env?: NodeJS.ProcessEnv): string;
3
+ export declare const DEFAULT_JWT_COOKIE_NAME = "lt-jwt-token";
4
+ export declare function resolveJwtCookieName(env?: NodeJS.ProcessEnv): string;
3
5
  export declare function detectCookiePrefixDrift(resolvedPrefix: string, programmaticOptionsAdvanced: unknown): null | string;
@@ -9,6 +9,11 @@ export function resolveBetterAuthCookiePrefix(basePath, env = process.env) {
9
9
  export function resolveBetterAuthSessionCookieName(basePath, env = process.env) {
10
10
  return `${resolveBetterAuthCookiePrefix(basePath, env)}.session_token`;
11
11
  }
12
+ export const DEFAULT_JWT_COOKIE_NAME = 'lt-jwt-token';
13
+ export function resolveJwtCookieName(env = process.env) {
14
+ const explicit = sanitizeCookiePrefix(typeof env.COOKIE_PREFIX === 'string' ? env.COOKIE_PREFIX : '');
15
+ return explicit ? `${explicit}-jwt-token` : DEFAULT_JWT_COOKIE_NAME;
16
+ }
12
17
  export function detectCookiePrefixDrift(resolvedPrefix, programmaticOptionsAdvanced) {
13
18
  if (!programmaticOptionsAdvanced || typeof programmaticOptionsAdvanced !== 'object')
14
19
  return null;
@@ -1 +1 @@
1
- {"version":3,"file":"better-auth-cookie-prefix.helper.js","sourceRoot":"","sources":["../../../../src/core/modules/better-auth/better-auth-cookie-prefix.helper.ts"],"names":[],"mappings":"AAqBA,SAAS,oBAAoB,CAAC,GAAW;IACvC,OAAO,GAAG,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC;AACpD,CAAC;AAsBD,MAAM,UAAU,6BAA6B,CAAC,QAAgB,EAAE,MAAyB,OAAO,CAAC,GAAG;IAClG,MAAM,cAAc,GAAG,CAAC,QAAQ,IAAI,MAAM,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACnF,MAAM,QAAQ,GAAG,oBAAoB,CAAC,OAAO,GAAG,CAAC,aAAa,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACtG,OAAO,QAAQ,IAAI,cAAc,CAAC;AACpC,CAAC;AAOD,MAAM,UAAU,kCAAkC,CAAC,QAAgB,EAAE,MAAyB,OAAO,CAAC,GAAG;IACvG,OAAO,GAAG,6BAA6B,CAAC,QAAQ,EAAE,GAAG,CAAC,gBAAgB,CAAC;AACzE,CAAC;AAgBD,MAAM,UAAU,uBAAuB,CAAC,cAAsB,EAAE,2BAAoC;IAClG,IAAI,CAAC,2BAA2B,IAAI,OAAO,2BAA2B,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IACjG,MAAM,kBAAkB,GAAI,2BAAuD,CAAC,YAAY,CAAC;IACjG,IAAI,OAAO,kBAAkB,KAAK,QAAQ,IAAI,kBAAkB,KAAK,cAAc;QAAE,OAAO,IAAI,CAAC;IACjG,OAAO,CACL,kCAAkC,kBAAkB,kCAAkC;QACtF,4BAA4B,cAAc,iDAAiD;QAC3F,2EAA2E,CAC5E,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"better-auth-cookie-prefix.helper.js","sourceRoot":"","sources":["../../../../src/core/modules/better-auth/better-auth-cookie-prefix.helper.ts"],"names":[],"mappings":"AAqBA,SAAS,oBAAoB,CAAC,GAAW;IACvC,OAAO,GAAG,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC;AACpD,CAAC;AAsBD,MAAM,UAAU,6BAA6B,CAAC,QAAgB,EAAE,MAAyB,OAAO,CAAC,GAAG;IAClG,MAAM,cAAc,GAAG,CAAC,QAAQ,IAAI,MAAM,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACnF,MAAM,QAAQ,GAAG,oBAAoB,CAAC,OAAO,GAAG,CAAC,aAAa,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACtG,OAAO,QAAQ,IAAI,cAAc,CAAC;AACpC,CAAC;AAOD,MAAM,UAAU,kCAAkC,CAAC,QAAgB,EAAE,MAAyB,OAAO,CAAC,GAAG;IACvG,OAAO,GAAG,6BAA6B,CAAC,QAAQ,EAAE,GAAG,CAAC,gBAAgB,CAAC;AACzE,CAAC;AAGD,MAAM,CAAC,MAAM,uBAAuB,GAAG,cAAc,CAAC;AAWtD,MAAM,UAAU,oBAAoB,CAAC,MAAyB,OAAO,CAAC,GAAG;IACvE,MAAM,QAAQ,GAAG,oBAAoB,CAAC,OAAO,GAAG,CAAC,aAAa,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACtG,OAAO,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,YAAY,CAAC,CAAC,CAAC,uBAAuB,CAAC;AACtE,CAAC;AAgBD,MAAM,UAAU,uBAAuB,CAAC,cAAsB,EAAE,2BAAoC;IAClG,IAAI,CAAC,2BAA2B,IAAI,OAAO,2BAA2B,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IACjG,MAAM,kBAAkB,GAAI,2BAAuD,CAAC,YAAY,CAAC;IACjG,IAAI,OAAO,kBAAkB,KAAK,QAAQ,IAAI,kBAAkB,KAAK,cAAc;QAAE,OAAO,IAAI,CAAC;IACjG,OAAO,CACL,kCAAkC,kBAAkB,kCAAkC;QACtF,4BAA4B,cAAc,iDAAiD;QAC3F,2EAA2E,CAC5E,CAAC;AACJ,CAAC"}
@@ -10,6 +10,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  var CoreBetterAuthMiddleware_1;
11
11
  import { Injectable, Logger } from '@nestjs/common';
12
12
  import { hasApiTokenCredential } from '../api-token/core-api-token.helpers.js';
13
+ import { resolveJwtCookieName } from './better-auth-cookie-prefix.helper.js';
13
14
  import { isLegacyJwt } from './core-better-auth-token.helper.js';
14
15
  import { CoreBetterAuthUserMapper } from './core-better-auth-user.mapper.js';
15
16
  import { convertExpressHeaders, extractSessionToken } from './core-better-auth-web.helper.js';
@@ -86,9 +87,10 @@ let CoreBetterAuthMiddleware = CoreBetterAuthMiddleware_1 = class CoreBetterAuth
86
87
  }
87
88
  if (!req.user && !req.headers.authorization && this.betterAuthService.isJwtEnabled()) {
88
89
  try {
89
- let jwtFromCookie = req.cookies?.['lt-jwt-token'];
90
+ const jwtCookieName = resolveJwtCookieName();
91
+ let jwtFromCookie = req.cookies?.[jwtCookieName];
90
92
  if (!jwtFromCookie && req.headers.cookie) {
91
- const match = req.headers.cookie.match(/(?:^|;\s*)lt-jwt-token=([^;]+)/);
93
+ const match = req.headers.cookie.match(new RegExp(`(?:^|;\\s*)${jwtCookieName.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}=([^;]+)`));
92
94
  if (match) {
93
95
  jwtFromCookie = decodeURIComponent(match[1]);
94
96
  }
@@ -1 +1 @@
1
- {"version":3,"file":"core-better-auth.middleware.js","sourceRoot":"","sources":["../../../../src/core/modules/better-auth/core-better-auth.middleware.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAkB,MAAM,gBAAgB,CAAC;AAGpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAyB,wBAAwB,EAAc,MAAM,mCAAmC,CAAC;AAChH,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAC9F,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AA+B/D,IAAM,wBAAwB,gCAA9B,MAAM,wBAAwB;IAIhB;IACA;IAJF,MAAM,GAAG,IAAI,MAAM,CAAC,0BAAwB,CAAC,IAAI,CAAC,CAAC;IAEpE,YACmB,iBAAwC,EACxC,UAAoC;QADpC,sBAAiB,GAAjB,iBAAiB,CAAuB;QACxC,eAAU,GAAV,UAAU,CAA0B;IACpD,CAAC;IAEJ,KAAK,CAAC,GAAG,CAAC,GAA0B,EAAE,IAAc,EAAE,IAAkB;QAEtE,IAAI,CAAC,IAAI,CAAC,iBAAiB,C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AAqB,CAAC,GAAG,CAAC,OAAwD,CAAC,CAAC;YAGpG,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,UAAU,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;YAEnD,IAAI,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,MAAM,IAAI,QAAQ,EAAE,CAAC;gBACnE,OAAO,QAAyD,CAAC;YACnE,CAAC;YAED,OAAO,IAAI,CAAC;QACd,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,qBAAqB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,EAAE,CAAC,CAAC;YACnG,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;CACF,CAAA;AAnPY,wBAAwB;IADpC,UAAU,EAAE;qCAK2B,qBAAqB;QAC5B,wBAAwB;GAL5C,wBAAwB,CAmPpC"}
1
+ {"version":3,"file":"core-better-auth.middleware.js","sourceRoot":"","sources":["../../../../src/core/modules/better-auth/core-better-auth.middleware.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAkB,MAAM,gBAAgB,CAAC;AAGpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAyB,wBAAwB,EAAc,MAAM,mCAAmC,CAAC;AAChH,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAC9F,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AA+B/D,IAAM,wBAAwB,gCAA9B,MAAM,wBAAwB;IAIhB;IACA;IAJF,MAAM,GAAG,IAAI,MAAM,CAAC,0BAAwB,CAA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,aAAa,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC;gBAEnF,IAAI,aAAa,EAAE,IAAI,IAAI,aAAa,EAAE,OAAO,EAAE,CAAC;oBAClD,OAAO,aAA8D,CAAC;gBACxE,CAAC;YACH,CAAC;YAGD,MAAM,GAAG,GAAG,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE,CAAC;YAC5C,IAAI,CAAC,GAAG,EAAE,CAAC;gBACT,OAAO,IAAI,CAAC;YACd,CAAC;YAGD,MAAM,OAAO,GAAG,qBAAqB,CAAC,GAAG,CAAC,OAAwD,CAAC,CAAC;YAGpG,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,UAAU,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;YAEnD,IAAI,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,MAAM,IAAI,QAAQ,EAAE,CAAC;gBACnE,OAAO,QAAyD,CAAC;YACnE,CAAC;YAED,OAAO,IAAI,CAAC;QACd,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,qBAAqB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,EAAE,CAAC,CAAC;YACnG,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;CACF,CAAA;AAvPY,wBAAwB;IADpC,UAAU,EAAE;qCAK2B,qBAAqB;QAC5B,wBAAwB;GAL5C,wBAAwB,CAuPpC"}
@@ -0,0 +1,70 @@
1
+ # Migration Guide: 12.6.14 → 12.6.15
2
+
3
+ ## Overview
4
+
5
+ | Category | Details |
6
+ |---|---|
7
+ | **Breaking Changes** | None |
8
+ | **New Features** | None. `resolveJwtCookieName()` and `DEFAULT_JWT_COOKIE_NAME` name the JWT cookie |
9
+ | **Bugfixes** | With `COOKIE_PREFIX`, the API reads a JWT-mode frontend's JWT cookie under `<prefix>-jwt-token`, the name `@lenne.tech/nuxt-extensions` writes (§1) |
10
+ | **Security** | None |
11
+ | **Migration Effort** | Package update. Only projects that set `COOKIE_PREFIX` and run in JWT mode (`cookies: false`) notice a difference |
12
+
13
+ ## Quick Migration
14
+
15
+ ```bash
16
+ pnpm add @lenne.tech/nest-server@12.6.15
17
+ pnpm run update # nest-server-starter based projects
18
+ pnpm run build
19
+ pnpm test
20
+ ```
21
+
22
+ **Vendor mode**: run `/lt-dev:backend:update-nest-server-core` as usual.
23
+
24
+ ## 1. Bugfix: the JWT cookie follows `COOKIE_PREFIX`
25
+
26
+ **No action needed.** Keep `COOKIE_PREFIX` (API) and `NUXT_PUBLIC_COOKIE_PREFIX` (app) equal, as before.
27
+
28
+ In JWT mode the frontend keeps the Better-Auth JWT in a cookie as well as sending it as a bearer token. A request that
29
+ carries the cookie but no `Authorization` header is authenticated by `CoreBetterAuthMiddleware` from that cookie: a
30
+ server-side rendered page that forwards the browser's cookies, and a passkey request from the app.
31
+
32
+ `@lenne.tech/nuxt-extensions` names that cookie `<NUXT_PUBLIC_COOKIE_PREFIX>-jwt-token` when a prefix is set. Up to
33
+ 12.6.14 the API read `lt-jwt-token` only. With a prefix such a request was anonymous, and Better-Auth's plugin routes
34
+ (passkey registration, two-factor) answered `401`.
35
+
36
+ | `COOKIE_PREFIX` | JWT cookie read since 12.6.15 | Before |
37
+ |---|---|---|
38
+ | not set | `lt-jwt-token` | `lt-jwt-token` |
39
+ | `acme` | `acme-jwt-token` | `lt-jwt-token` |
40
+
41
+ The prefix is sanitised by the same rule as on the frontend (`[A-Za-z0-9._-]`). The base path does not enter the name,
42
+ unlike the session cookie (`<prefix>.session_token`, else `iam.session_token`). There is no fallback to `lt-jwt-token`
43
+ while `COOKIE_PREFIX` is set: the prefix keeps the apps on one host apart, and the session cookie does not fall back
44
+ either.
45
+
46
+ ## 2. Dependencies
47
+
48
+ A pnpm override lifts `i18next` to 26.4.4 under `@compodoc/compodoc` (GHSA-6jcc-5g8w-32mx, GHSA-5jr9-983r-c8x4). It is dev tooling of this repository (`pnpm run docs`) and does not reach consumers; nothing to do in a project.
49
+
50
+ ## Compatibility Notes
51
+
52
+ | Pattern | Status |
53
+ |---|---|
54
+ | No `COOKIE_PREFIX` | Unchanged |
55
+ | `COOKIE_PREFIX` with cookies (the default `cookies: true`) | Unchanged; the session cookie already followed the prefix |
56
+ | `COOKIE_PREFIX` with `cookies: false` and a matching `NUXT_PUBLIC_COOKIE_PREFIX` | Fixed: the JWT cookie is read |
57
+ | A frontend that sets `COOKIE_PREFIX` on the API but writes `lt-jwt-token` | No longer authenticated through the cookie. Set the same prefix on both sides |
58
+
59
+ ## Troubleshooting
60
+
61
+ | Symptom | Cause | Fix |
62
+ |---|---|---|
63
+ | Passkey or 2FA routes answer `401` in JWT mode with a cookie prefix | 12.6.14 or older read only `lt-jwt-token` | Update to 12.6.15 |
64
+ | Still `401` after the update | The API and the app use different prefixes | Set `COOKIE_PREFIX` and `NUXT_PUBLIC_COOKIE_PREFIX` to the same value |
65
+
66
+ ## Module Documentation
67
+
68
+ - `src/core/modules/better-auth/better-auth-cookie-prefix.helper.ts`: `resolveJwtCookieName()`, `resolveBetterAuthCookiePrefix()`
69
+ - Same fix on the current line: 12.11.2
70
+ - `migration-guides/11.26.1-to-11.26.2.md`, §1: `COOKIE_PREFIX` and the frontend pairing
@@ -0,0 +1,98 @@
1
+ # Migration Guide: 12.6.15 → 12.6.16
2
+
3
+ ## Overview
4
+
5
+ | Category | Details |
6
+ |---|---|
7
+ | **Breaking Changes** | None |
8
+ | **New Features** | None |
9
+ | **Bugfixes** | None |
10
+ | **Security** | The Node.js runtime of a deployed API must be at least 24.22.3 (22.23.5, 26.13.1): a Brotli decoder flaw in older versions is reachable through every request body (§1). `cross-spawn` 7.1.2 clears GHSA-ghv9-86vm-4v8m (critical) in the framework's own tree (§2) |
11
+ | **Migration Effort** | Raise the Node.js base image of the project's `Dockerfile` and rebuild; re-resolve `cross-spawn` in the project's lockfile |
12
+
13
+ ## Quick Migration
14
+
15
+ ```bash
16
+ pnpm add @lenne.tech/nest-server@12.6.16
17
+ pnpm run update # nest-server-starter based projects
18
+ pnpm update cross-spawn # the project's lockfile keeps its own copy (§2)
19
+ pnpm audit
20
+ pnpm run build
21
+ pnpm test
22
+ ```
23
+
24
+ **Vendor mode**: run `/lt-dev:backend:update-nest-server-core` as usual.
25
+
26
+ Then raise the Node.js image of the deployment (§1). The package update alone does not change the runtime.
27
+
28
+ ## 1. Security: Node.js runtime at least 24.22.3
29
+
30
+ **Action needed** for every deployed API, in npm and in vendor mode.
31
+
32
+ Node.js versions before 22.23.4, 24.22.1 and 26.12.1 contain CVE-2026-111497 (high): malformed Brotli input makes the
33
+ bundled decoder write past the end of an internal buffer, which permits remote code execution. CISA lists it as
34
+ actively exploited. An API built on nest-server reaches the decoder without authentication: Express's body parser
35
+ decompresses a request body sent with `Content-Encoding: br`, before any guard runs, and a reverse proxy passes such a
36
+ body through. The November security releases (22.23.5, 24.22.3, 26.13.1) fix further CVEs in the TLS server, HTTP/2
37
+ and the HTTP client, so take those versions as the minimum.
38
+
39
+ The `Dockerfile` of nest-server-starter pinned `node:24-alpine` at a digest that is Node.js 24.18.0. Replace the base
40
+ image in every stage:
41
+
42
+ ```dockerfile
43
+ # Before
44
+ FROM node:24-alpine@sha256:a0b9bf06e4e6193cf7a0f58816cc935ff8c2a908f81e6f1a95432d679c54fbfd AS deps
45
+ # After
46
+ FROM node:24.22.3-alpine@sha256:116b800c3754b440ee0aa3ed2f20f5bf3d99a554bfd9adeea09ea8017f6e85f5 AS deps
47
+ ```
48
+
49
+ The version tag in front of the digest only documents the version; Docker uses the digest. Check the running image
50
+ after the deploy:
51
+
52
+ ```bash
53
+ docker run --rm --entrypoint node <image> -p process.version # v24.22.3 or later on the 24.x line
54
+ ```
55
+
56
+ A project on another runtime (a CI image, a PaaS Node.js version, a 22.x or 26.x image) raises it to 22.23.5, 24.22.3
57
+ or 26.13.1 at least. An image without a digest (`node:24-alpine`) is rebuilt with `docker build --pull --no-cache`:
58
+ `--no-cache` alone reuses a base image stored locally. `engines.node` of `@lenne.tech/nest-server` stays `>= 22.15`:
59
+ the package itself has no fix to ship, the runtime does.
60
+
61
+ ## 2. Security: `cross-spawn`
62
+
63
+ **Action needed** in the project's lockfile; nest-server's own lockfile does not reach a consumer.
64
+
65
+ GHSA-ghv9-86vm-4v8m (critical, `cross-spawn` >= 7.0.0 < 7.1.0): command injection on Windows when a `.bat` or `.cmd`
66
+ file is started. `cross-spawn` reaches a project through `@modelcontextprotocol/sdk` (a dependency of the framework),
67
+ `cross-env` and `@swc/cli`. Every path accepts 7.1.x, so `pnpm update cross-spawn` lifts all of them; `pnpm why
68
+ cross-spawn` then lists 7.1.2 only.
69
+
70
+ ## 3. Under the hood: GHSA-c859-jr93-m5j4 (minimatch)
71
+
72
+ The advisory (minimatch `>= 7.4.0 <= 11.0.7`, moderate: the output of `minimatch.escape()` matches more or less than
73
+ the literal) is fixed only in minimatch 11.0.8. On this line `@nestjs/cli` 12.0.11, `@swc/cli` 0.8.2,
74
+ `@ts-morph/common` 0.29.0 and nodemon 3.1.14 still depend on minimatch 9 or 10; none of them calls
75
+ `minimatch.escape()`. The repository declares it as a residual next to GHSA-g3hv-75wg-m249, with the same consumers.
76
+ A project whose `pnpm audit` reports it through these packages can declare it the same way, with the consumers its own
77
+ lockfile names:
78
+
79
+ ```yaml
80
+ auditConfig:
81
+ ignoreGhsas:
82
+ - GHSA-c859-jr93-m5j4
83
+ unusableFixConsumers:
84
+ GHSA-c859-jr93-m5j4: '@nestjs/cli@12.0.11 + @swc/cli@0.8.2 + @ts-morph/common@0.29.0 + nodemon@3.1.14 cannot use 11.0.8'
85
+ ```
86
+
87
+ ## Troubleshooting
88
+
89
+ | Symptom | Cause | Fix |
90
+ |---|---|---|
91
+ | `process.version` in the running container is below 24.22.3 | the image was built from a cached or still pinned base layer | Raise the digest in every `FROM` line and build with `--pull` |
92
+ | `pnpm audit` still reports GHSA-ghv9-86vm-4v8m | the project's lockfile keeps `cross-spawn` 7.0.x | `pnpm update cross-spawn` |
93
+ | `pnpm audit` reports GHSA-c859-jr93-m5j4 | a dev tool on minimatch 9 or 10 | Declare it as in §3 |
94
+
95
+ ## Module Documentation
96
+
97
+ - [Node.js October 2026 security releases](https://nodejs.org/en/blog/vulnerability/october-2026-security-releases)
98
+ - [Node.js November 2026 security releases](https://nodejs.org/en/blog/vulnerability/november-2026-security-releases)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lenne.tech/nest-server",
3
- "version": "12.6.14",
3
+ "version": "12.6.16",
4
4
  "type": "module",
5
5
  "description": "Server framework in TypeScript on top of NestJS: GraphQL and REST APIs on MongoDB, PostgreSQL, MySQL or MariaDB, with authentication, field-level permissions, multi-tenancy, offline sync and an AI assistant.",
6
6
  "keywords": [
@@ -58,6 +58,23 @@ export function resolveBetterAuthSessionCookieName(basePath: string, env: NodeJS
58
58
  return `${resolveBetterAuthCookiePrefix(basePath, env)}.session_token`;
59
59
  }
60
60
 
61
+ /** The name of the JWT cookie without `COOKIE_PREFIX`, the one `@lenne.tech/nuxt-extensions` writes by default. */
62
+ export const DEFAULT_JWT_COOKIE_NAME = 'lt-jwt-token';
63
+
64
+ /**
65
+ * The cookie a JWT-mode frontend keeps the Better-Auth JWT in (12.6.15): `<COOKIE_PREFIX>-jwt-token` when `COOKIE_PREFIX`
66
+ * is set, otherwise `lt-jwt-token`. `@lenne.tech/nuxt-extensions` names it the same way from `NUXT_PUBLIC_COOKIE_PREFIX`,
67
+ * sanitised by the same rule. Unlike the session cookie, the basePath never enters the name.
68
+ *
69
+ * There is no fallback to `lt-jwt-token` while `COOKIE_PREFIX` is set: the prefix isolates the apps on one host, and
70
+ * the session cookie does not fall back either. Before 12.6.15 the API read `lt-jwt-token` only, so with a prefix
71
+ * every request without an `Authorization` header (SSR with forwarded cookies, a passkey request) was anonymous.
72
+ */
73
+ export function resolveJwtCookieName(env: NodeJS.ProcessEnv = process.env): string {
74
+ const explicit = sanitizeCookiePrefix(typeof env.COOKIE_PREFIX === 'string' ? env.COOKIE_PREFIX : '');
75
+ return explicit ? `${explicit}-jwt-token` : DEFAULT_JWT_COOKIE_NAME;
76
+ }
77
+
61
78
  /**
62
79
  * Detect a Better-Auth cookie-prefix drift between the value the NestJS layer
63
80
  * resolves (via {@link resolveBetterAuthCookiePrefix}) and a programmatic
@@ -2,6 +2,7 @@ import { Injectable, Logger, NestMiddleware } from '@nestjs/common';
2
2
  import { NextFunction, Request, Response } from 'express';
3
3
 
4
4
  import { hasApiTokenCredential } from '../api-token/core-api-token.helpers.js';
5
+ import { resolveJwtCookieName } from './better-auth-cookie-prefix.helper.js';
5
6
  import { isLegacyJwt } from './core-better-auth-token.helper.js';
6
7
  import { BetterAuthSessionUser, CoreBetterAuthUserMapper, MappedUser } from './core-better-auth-user.mapper.js';
7
8
  import { convertExpressHeaders, extractSessionToken } from './core-better-auth-web.helper.js';
@@ -142,14 +143,18 @@ export class CoreBetterAuthMiddleware implements NestMiddleware {
142
143
 
143
144
  // Strategy 2: Try JWT from cookie (for JWT mode when frontend stores JWT as cookie)
144
145
  // In JWT mode (cookies=false), the frontend may store the JWT in a cookie
145
- // (e.g., lt-jwt-token) instead of sending it as an Authorization header.
146
+ // (`lt-jwt-token`, `<COOKIE_PREFIX>-jwt-token` with a prefix) instead of sending it as an Authorization header.
146
147
  // This bridges the gap between cookie-based frontend storage and JWT verification.
147
148
  if (!req.user && !req.headers.authorization && this.betterAuthService.isJwtEnabled()) {
148
149
  try {
149
- // Try parsed cookies first, then raw header (cookie-parser may not have run yet)
150
- let jwtFromCookie = req.cookies?.['lt-jwt-token'];
150
+ // Try parsed cookies first, then raw header (cookie-parser may not have run yet). The name follows
151
+ // COOKIE_PREFIX like the frontend's (`<prefix>-jwt-token`, else `lt-jwt-token`; 12.6.15).
152
+ const jwtCookieName = resolveJwtCookieName();
153
+ let jwtFromCookie = req.cookies?.[jwtCookieName];
151
154
  if (!jwtFromCookie && req.headers.cookie) {
152
- const match = req.headers.cookie.match(/(?:^|;\s*)lt-jwt-token=([^;]+)/);
155
+ const match = req.headers.cookie.match(
156
+ new RegExp(`(?:^|;\\s*)${jwtCookieName.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}=([^;]+)`),
157
+ );
153
158
  if (match) {
154
159
  jwtFromCookie = decodeURIComponent(match[1]);
155
160
  }