fix(network): cap rooms, joiners and connections on the signaling server and the p2p host

Abierto
#486 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
38/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
typescript

Línea de trabajo

Start with the cited room creation and joiner handling in modules/network/src/server/signaling.server.network.ts, then inspect joiner allocation in modules/network/src/server/peer-host.ts. Map the existing room and connection lifecycle before choosing limits and rate-limit behavior; the issue lists these goals but does not specify threshold values or validation rules. Done means enforcing agreed limits and validating bounded offers, with tests covering the listed abuse cases.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug modules:network
Which package is this bug report for?

network

Issue description

Every host connection creates a room and every joiner is added, with no cap on rooms, joiners per room, connections per IP or frame rate. The 404-versus-upgrade answer tells whether a room exists and nothing throttles it (code space 32^6). On the p2p host, each new signal id that sends an offer allocates an RTCPeerConnection, with no limit on _joiners and no validation of offer / candidate.

Where:

Evidence:

if (room !== null && !this._rooms.has(room)) { return new Response("Unknown room", { status: 404 }); }
this._rooms.set(room, { host: webSocket, joiners: new Map() });
...
if (!joiner) { if (message.type !== "offer") return; joiner = this.addJoiner(signalId); }

Suggested fix: Cap rooms, joiners per room, connections per IP and joiners not yet welcomed. Rate-limit failed room lookups and joiner frames. Check the offer shape and bound the sdp length.

Found during a code audit of main at be72076.

Code sample

No response

Versions
  • Engine main at be72076
  • pnpm 12.0.0, Node.js 26, Bun 1.3.14
Issue priority

High (immediate attention needed)

I have tested this issue on a development release

be72076

Lenguaje dominante
TypeScript
Estrellas
7
Forks
2
Merge medio
1 d 17 h
PR fusionados (30 d)
17

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de NanoForge-dev/Engine

Todos los issues de NanoForge-dev/Engine

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.