fix potential dos attack and fix sanitation not being done

This commit is contained in:
KingKDot
2026-04-14 20:31:01 -05:00
parent 1807a94e9f
commit 7c6bcccda7
4 changed files with 40 additions and 29 deletions
@@ -911,11 +911,12 @@ export function handleConsoleViewerMessage(ws: ServerWebSocket<SocketData>, raw:
}
}
export function handleConsoleOutput(payload: any) {
export function handleConsoleOutput(clientId: string, payload: any) {
const sessionId = payload.sessionId as string;
if (!sessionId) return;
const session = sessionManager.getConsoleSession(sessionId);
if (!session) return;
if (session.clientId !== clientId) return;
const data = payload.data ? textDecoder.decode(payload.data as Uint8Array) : "";
safeSendViewer(session.viewer, {
type: "output",