Summary
A malformed WebSocket close frame with status code 1006 causes an uncaught RangeError in the Termix server process. The process exits with code 1; Docker then restarts the container when restart: unless-stopped is configured.
WebSocket status code 1006 is reserved and must not appear in a close frame. A client or intermediary can therefore turn a bad frame into a full server restart.
Observed server log
[ERROR] Uncaught exception occurred [op:error_handling]
RangeError: Invalid WebSocket frame: invalid status code 1006
Docker evidence
For each observed restart, Docker reported:
restarting container ... exitCode=1 manualRestart=false restartPolicy="{unless-stopped 0}"
The application error occurred immediately before the Docker restart. The same exception was recorded seven times, matching the container restart count.
Expected behavior
An invalid WebSocket frame should terminate only the affected WebSocket session and be logged with sufficient context. It should not be able to terminate the Termix server process.
Environment
- Self-hosted Docker deployment
- Image: ghcr.io/lukegus/termix:latest
- Restart policy: unless-stopped
Suggested direction
Please handle the WebSocket error at the connection boundary, for example via an error handler that closes the affected connection, so it cannot become an uncaught process-level exception.
Summary
A malformed WebSocket close frame with status code 1006 causes an uncaught RangeError in the Termix server process. The process exits with code 1; Docker then restarts the container when restart: unless-stopped is configured.
WebSocket status code 1006 is reserved and must not appear in a close frame. A client or intermediary can therefore turn a bad frame into a full server restart.
Observed server log
Docker evidence
For each observed restart, Docker reported:
The application error occurred immediately before the Docker restart. The same exception was recorded seven times, matching the container restart count.
Expected behavior
An invalid WebSocket frame should terminate only the affected WebSocket session and be logged with sufficient context. It should not be able to terminate the Termix server process.
Environment
Suggested direction
Please handle the WebSocket error at the connection boundary, for example via an error handler that closes the affected connection, so it cannot become an uncaught process-level exception.