Skip to content

feat(backend): implement payload sanitization and strict validation for WebSocket Relay Service - #1595

Open
covenantalade wants to merge 1 commit into
emdevelopa:mainfrom
covenantalade:feature/be-implement-payload-sanitization-and-strict-validation-for-websocket-relay-service
Open

covenantalade wants to merge 1 commit into
emdevelopa:mainfrom
covenantalade:feature/be-implement-payload-sanitization-and-strict-validation-for-websocket-relay-service

Conversation

@covenantalade

Copy link
Copy Markdown

…

  • Add websocket-relay-validation: deep payload sanitization (prototype-pollution keys, control/bidi chars, depth/size limits), strict zod schemas for join:merchant / join:checkout / leave:checkout (UUID-only, unknown keys rejected), and a per-socket guard that reports errors via ack or relay:error, logs without raw payloads, and disconnects repeat offenders
  • Extract relay server setup from app.js into websocket-relay-server; cap maxHttpBufferSize at 16 KiB (configurable via WS_MAX_HTTP_BUFFER_SIZE)
  • Sanitize outbound checkout:presence and Horizon poller payment events
  • Deep-sanitize field values in sanitizeRelayMessage
  • Fix TypeError crash on join:* events sent without a payload
  • Add unit + real Socket.IO integration tests and docs

Closes #1452

…or WebSocket Relay Service

- Add websocket-relay-validation: deep payload sanitization (prototype-pollution
  keys, control/bidi chars, depth/size limits), strict zod schemas for
  join:merchant / join:checkout / leave:checkout (UUID-only, unknown keys
  rejected), and a per-socket guard that reports errors via ack or relay:error,
  logs without raw payloads, and disconnects repeat offenders
- Extract relay server setup from app.js into websocket-relay-server; cap
  maxHttpBufferSize at 16 KiB (configurable via WS_MAX_HTTP_BUFFER_SIZE)
- Sanitize outbound checkout:presence and Horizon poller payment events
- Deep-sanitize field values in sanitizeRelayMessage
- Fix TypeError crash on join:* events sent without a payload
- Add unit + real Socket.IO integration tests and docs

Closes emdevelopa#1452

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Sep 29, 2026

Copy link
Copy Markdown

@Nanle-code is attempting to deploy a commit to the Emmanuel's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Sep 29, 2026

Copy link
Copy Markdown

@covenantalade Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Backend] Implement payload sanitization and strict validation for WebSocket Relay Service

2 participants