Skip to content

Commit aaf3cc9

Browse files
authored
fix: upgrade Fastify to v5 to resolve CVE-2026-25223 (#1346)
1 parent 7ee1b83 commit aaf3cc9

5 files changed

Lines changed: 157 additions & 188 deletions

File tree

.changeset/upgrade-fastify-v5.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@callstack/repack-dev-server": patch
3+
---
4+
5+
Upgrade Fastify to v5 to resolve CVE-2026-25223 (HIGH severity). Updated `fastify`, `@fastify/middie`, `@fastify/sensible`, `fastify-plugin`, and `fastify-favicon` to their v5-compatible versions.

packages/dev-server/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@
2929
},
3030
"dependencies": {
3131
"@babel/code-frame": "^7.26.2",
32-
"@fastify/middie": "^8.3.0",
33-
"@fastify/sensible": "^5.5.0",
34-
"fastify": "^4.24.3",
35-
"fastify-favicon": "^4.3.0",
36-
"fastify-plugin": "^4.5.1",
32+
"@fastify/middie": "^9.0.0",
33+
"@fastify/sensible": "^6.0.0",
34+
"fastify": "^5.7.2",
35+
"fastify-favicon": "^5.0.0",
36+
"fastify-plugin": "^5.0.0",
3737
"http-proxy-middleware": "^3.0.3",
3838
"launch-editor": "^2.10.0",
3939
"open": "^10.1.0",

packages/dev-server/src/plugins/symbolicate/Symbolicator.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { URL } from 'node:url';
22
import { codeFrameColumns } from '@babel/code-frame';
3-
import type { FastifyLoggerInstance } from 'fastify';
3+
import type { FastifyBaseLogger } from 'fastify';
44
import { SourceMapConsumer } from 'source-map';
55
import type {
66
CodeFrame,
@@ -70,7 +70,7 @@ export class Symbolicator {
7070
* @returns Symbolicated stack frames.
7171
*/
7272
async process(
73-
logger: FastifyLoggerInstance,
73+
logger: FastifyBaseLogger,
7474
stack: ReactNativeStackFrame[]
7575
): Promise<SymbolicatorResults> {
7676
logger.debug({ msg: 'Filtering out unnecessary frames' });
@@ -195,7 +195,7 @@ export class Symbolicator {
195195
}
196196

197197
private async getCodeFrame(
198-
logger: FastifyLoggerInstance,
198+
logger: FastifyBaseLogger,
199199
processedFrames: StackFrame[]
200200
): Promise<CodeFrame | undefined> {
201201
for (const frame of processedFrames) {

packages/dev-server/src/plugins/wss/servers/WebSocketMessageServer.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,10 @@ export class WebSocketMessageServer extends WebSocketServer {
182182
})
183183
);
184184
} catch (error) {
185-
this.fastify.log.error('Failed to reply', {
186-
clientId,
187-
error,
188-
errorMessage,
189-
});
185+
this.fastify.log.error(
186+
{ clientId, error, errorMessage },
187+
'Failed to reply'
188+
);
190189
}
191190
}
192191
}

0 commit comments

Comments
 (0)