Files
nick-doc/Issues/ISSUE-028-delivery-code-generated-socket-event-broadcasts-raw-6-digit-.md
Siavash Sameni dceaf82934 audit: 2026-05-30 full-codebase audit — report, issues, docs, runbooks
Full-codebase-audit 2026-05-30 outputs:
- Audit report: 09 - Audits/Full Codebase Audit - 2026-05-30.md
- 81 issue files ISSUE-055..135 (decisions + 1 skipped no-brainer).
- Scanner docs from scratch (was zero): architecture, data model, API ref, payment
  flow, operations runbook + repo README.
- Doc-sync updates across API reference, data models, flows, design system.
- Secret Rotation Runbook (08 - Operations) for the exposed credentials.
- Reusable workflow guide (07 - Development) + .claude/workflows/full-codebase-audit.js.

Issues remain status:open intentionally — the code fixes are uncommitted-then-committed
working-tree changes per repo and aren't "resolved" until merged/deployed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-30 18:48:04 +04:00

1.5 KiB

issue, title, severity, domain, labels, status, resolved, fix, status, created, source
issue title severity domain labels status resolved fix status created source
028 delivery-code-generated socket event broadcasts raw 6-digit code to entire request room including seller major Delivery
security
bug
backend
major
delivery
resolved 2026-05-29 Removed 'code' field from the delivery-code-generated socket payload in deliveryService.ts — only metadata (requestId, expiresAt, timestamp) is now broadcast to the room. open 2026-05-29 Doc vs Code Audit 2026-05-29

🟠 delivery-code-generated socket event broadcasts raw 6-digit code to entire request room including seller

Severity: major Domain: Delivery Labels: security, bug, backend, major, delivery

Description

DeliveryService.generateDeliveryCode emits 'delivery-code-generated' with the raw 6-digit code to the room request-{id}. Both buyer and seller are subscribers of this room. A seller with socket access can intercept the code before physical handoff, defeating the security purpose of the code-based handoff verification.

Current Behavior

DeliveryService.ts line 55 broadcasts {requestId, code, expiresAt, timestamp} to all room subscribers. Seller receives the code via socket before physically receiving the goods.

Expected Behavior

The code should only be emitted to the buyer's personal room (user-{buyerId}), not the shared request room.

Affected Files

  • backend/src/services/deliveryService.ts

References