@lenne.tech/nest-server 11.46.0 → 11.46.1
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.
- package/.claude/rules/testing.md +3 -3
- package/FRAMEWORK-API.md +1 -1
- package/dist/core/common/filters/http-exception-log.filter.js +4 -3
- package/dist/core/common/filters/http-exception-log.filter.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/migration-guides/11.46.0-to-11.46.1.md +68 -0
- package/package.json +3 -3
- package/src/core/common/filters/http-exception-log.filter.ts +7 -3
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Migration Guide: 11.46.0 → 11.46.1
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
| Category | Details |
|
|
6
|
+
|---|---|
|
|
7
|
+
| **Breaking Changes** | None |
|
|
8
|
+
| **New Features** | None |
|
|
9
|
+
| **Bugfixes** | Security: mongodb 7.8.0 closes GHSA-77w5-j825-v4qm (`timeoutMS`) and a flaw in the host-name check of SRV lookups (`mongodb+srv://`) (§1). Error responses of `HttpExceptionLogFilter` no longer contain `options` / `cause` (§2) |
|
|
10
|
+
| **Migration Effort** | Update. A project that pins mongoose / mongodb itself — vendored cores included — raises them (§1) |
|
|
11
|
+
|
|
12
|
+
11.46.1 is a security patch for 11.46.0 (`latest-11`). Besides the dependency update, one framework fix: error
|
|
13
|
+
responses no longer carry `options` / `cause` (§2). Both changes also ship in 12.8.5 (`latest`; the mongoose / mongodb update already in 12.8.4) and 12.6.8
|
|
14
|
+
(`latest-12.6`).
|
|
15
|
+
|
|
16
|
+
## Quick Migration
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
pnpm add @lenne.tech/nest-server@11.46.1
|
|
20
|
+
pnpm run update # nest-server-starter based projects
|
|
21
|
+
pnpm run build
|
|
22
|
+
pnpm test
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
**Vendor mode**: run `/lt-dev:backend:update-nest-server-core` as usual, and raise mongoose / mongodb in the project's own
|
|
26
|
+
`package.json` (§1).
|
|
27
|
+
|
|
28
|
+
## 1. mongoose 9.12.0 and mongodb 7.8.0 (security)
|
|
29
|
+
|
|
30
|
+
On 11.x mongoose and mongodb are regular dependencies of the framework, so an npm-mode project gets both with the
|
|
31
|
+
update. mongoose 9.12.0 moves to the mongodb driver 7.8.0, which closes two flaws present in every earlier 7.x:
|
|
32
|
+
|
|
33
|
+
- **GHSA-77w5-j825-v4qm / CVE-2026-119179** (high): with `timeoutMS`, a connection-pool desynchronization after an
|
|
34
|
+
operation timeout could hand one user's data to another. Only projects that set `timeoutMS` themselves are affected —
|
|
35
|
+
the framework never sets it. Since 7.8.0 `timeoutMS` is a no-op; use `serverSelectionTimeoutMS`, `socketTimeoutMS`,
|
|
36
|
+
`waitQueueTimeoutMS` and `maxTimeMS` instead.
|
|
37
|
+
- **SRV host-name verification** (mongodb `>= 3.3.3 < 7.8.0`, no GHSA): a host returned by the SRV lookup of a
|
|
38
|
+
`mongodb+srv://` URL was not verified properly, so whoever controlled the DNS answer could redirect the driver to a
|
|
39
|
+
host outside your domain. Projects with `mongodb://host1,host2` URLs are not affected.
|
|
40
|
+
|
|
41
|
+
Neither appears in `pnpm audit`, so the update is the only signal.
|
|
42
|
+
|
|
43
|
+
**What to do:** nothing for an npm-mode project that does not pin mongoose itself. A project that pins mongoose or
|
|
44
|
+
mongodb itself — every vendor-mode project does — sets them to `9.12.0` / `7.8.0`; mongoose 9.11 pins the driver to
|
|
45
|
+
`~7.7`, so raising mongodb alone leaves mongoose's own copy vulnerable:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
pnpm add mongoose@9.12.0 mongodb@7.8.0
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## 2. Error responses no longer contain `options` / `cause`
|
|
52
|
+
|
|
53
|
+
`HttpExceptionLogFilter` (registered by nest-server-starter's `main.ts` while `logExceptions` is on, its default)
|
|
54
|
+
answered a REST request with every field of the exception — including `options` and the `cause` the throwing code
|
|
55
|
+
passed (`new BadRequestException('…', { cause: dbError })`). An internal error message, a query or a connection
|
|
56
|
+
string could reach the client that way. Error responses now leave `options` and `cause` out; `response`, `status`,
|
|
57
|
+
`message` and `name` stay as before, so frontends reading them need no change. The cause is still logged.
|
|
58
|
+
|
|
59
|
+
## Troubleshooting
|
|
60
|
+
|
|
61
|
+
| Symptom | Cause | Fix |
|
|
62
|
+
|---|---|---|
|
|
63
|
+
| Two mongodb copies in `pnpm why mongodb` | The project pins mongoose 9.11 or mongodb 7.7 | `pnpm add mongoose@9.12.0 mongodb@7.8.0` |
|
|
64
|
+
| Operations no longer time out after `timeoutMS` | `timeoutMS` is a no-op since mongodb 7.8.0 | `serverSelectionTimeoutMS`, `socketTimeoutMS`, `maxTimeMS` |
|
|
65
|
+
|
|
66
|
+
## References
|
|
67
|
+
|
|
68
|
+
- `package.json` — `dependencies` (mongodb, mongoose)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lenne.tech/nest-server",
|
|
3
|
-
"version": "11.46.
|
|
3
|
+
"version": "11.46.1",
|
|
4
4
|
"description": "Modern, fast, powerful Node.js web framework in TypeScript based on Nest with a GraphQL API and a connection to MongoDB (or other databases).",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"node",
|
|
@@ -125,8 +125,8 @@
|
|
|
125
125
|
"js-sha256": "1.0.0",
|
|
126
126
|
"json-to-graphql-query": "2.3.0",
|
|
127
127
|
"lodash": "4.18.1",
|
|
128
|
-
"mongodb": "7.
|
|
129
|
-
"mongoose": "9.
|
|
128
|
+
"mongodb": "7.8.0",
|
|
129
|
+
"mongoose": "9.12.0",
|
|
130
130
|
"multer": "2.5.0",
|
|
131
131
|
"node-mailjet": "6.0.11",
|
|
132
132
|
"nodemailer": "10.1.4",
|
|
@@ -21,8 +21,12 @@ export class HttpExceptionLogFilter implements ExceptionFilter {
|
|
|
21
21
|
const ctx = host.switchToHttp();
|
|
22
22
|
const res = ctx.getResponse<Response>();
|
|
23
23
|
const status = exception.getStatus();
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
// The exception's own fields, minus what it carries for the log: `options` and the `cause` passed to it (an
|
|
25
|
+
// internal error, a query, a connection string) must never reach the client. The shape the frontends read
|
|
26
|
+
// (response, status, message, name) is unchanged.
|
|
27
|
+
const body: Record<string, unknown> = { ...exception };
|
|
28
|
+
delete body.options;
|
|
29
|
+
delete body.cause;
|
|
30
|
+
res.status(status).json(exception instanceof ServiceUnavailableException ? body.response : body);
|
|
27
31
|
}
|
|
28
32
|
}
|