- Add security.ts: helmet, CORS allowlist, timing-safe API key auth, prototype pollution guard, Mermaid input limits, rate limiting (general/destructive/burst) - WS auth challenge-response with 5 s timeout and close code 4001 - Fix sync crash: array check before logger access (500 → 400) - Fix sync/v2: validate element type before write (invalid → 400) - Upgrade zod 3.22.4 → 3.25.5 (fixes ERR_PACKAGE_PATH_NOT_EXPORTED on startup) - Extract ElementSharedFieldsSchema; move VALID_ELEMENT_TYPES to module level - Docker: resource limits, .dockerignore hardening - Add .project-hooks/pre-commit; expand test coverage (369 tests) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2.0 KiB
2.0 KiB
Changelog
All notable changes to this project are documented here. Format: Keep a Changelog
[Unreleased]
[1.6.3] - 2026-03-29
Security
- Added
security.tsmiddleware module: helmet headers, explicit CORS allowlist, API key auth with timing-safe comparison, prototype pollution guard, Mermaid input size limits - WebSocket authentication: challenge-response (
auth_required→hello + apiKey) with 5 s timeout and close code 4001 on failure; origin verification viaverifyClient - Rate limiting on all
/api/*routes: 100 req/15 min general, 10 req/min destructive, 10 req/min sync write burst sanitizeSearchQuerynow throws typedInvalidSearchQueryErrorinstead of genericError- Docker: added
deploy.resources.limits(canvas 1 CPU/512M, mcp 0.5 CPU/256M) todocker-compose.yml; extended.dockerignorewithtests/and sensitive key file patterns
Fixed
POST /api/elements/sync: array validation now runs before logger access, preventing aTypeErrorcrash (500) on null/non-array input — now returns 400POST /api/elements/sync/v2: element type validated againstEXCALIDRAW_ELEMENT_TYPESbefore write; invalid types return 400 instead of being persisted silently- Upgraded
zodfrom 3.22.4 to 3.25.5 to resolveERR_PACKAGE_PATH_NOT_EXPORTEDcrash at MCP server startup caused byzod-to-json-schemapeer dependency mismatch
Changed
ElementSharedFieldsSchemaextracted fromCreateElementSchema/UpdateElementSchemato eliminate 25-field duplication; both schemas now use.extend()VALID_ELEMENT_TYPESmoved to module-level constant (was allocated per-request)resolveHelloTenantAndProjectparameter typed asHelloMessage(wasany)getAllFilesObject()helper extracted;sendFilesAdded()andGET /api/filesshare itsendLegacyInitialWsMessagesrenamed tosendAuthlessInitialMessages.project-hooks/pre-commitadded to run vitest on every commit