Skip to content

Commit 9eda232

Browse files
fix: don't send server stack trace to client
fixes #1967 Avoid sending Error.stack to the client. Stack traces can leak production file paths, internal function names, and other sensitive info, increasing attack surface.
1 parent 3b02718 commit 9eda232

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/start/src/runtime/server-handler.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/// <reference types="vinxi/types/server" />
2-
import { crossSerializeStream, fromJSON, getCrossReferenceHeader } from "seroval";
2+
import { crossSerializeStream, Feature, fromJSON, getCrossReferenceHeader } from "seroval";
33
// @ts-ignore
44
import {
55
CustomEventPlugin,
@@ -62,6 +62,7 @@ function serializeToStream(id: string, value: any) {
6262
URLSearchParamsPlugin,
6363
URLPlugin
6464
],
65+
disabledFeatures: import.meta.env.PROD ? Feature.ErrorPrototypeStack : undefined,
6566
onSerialize(data, initial) {
6667
controller.enqueue(
6768
createChunk(initial ? `(${getCrossReferenceHeader(id)},${data})` : data)

0 commit comments

Comments
 (0)