Context
redisCache.ts (and propertyCache paths) JSON.parse Redis payloads and cast/return them as Property/SearchResult without schema validation.
Problem
A poisoned or stale cache entry (or partial write) yields malformed objects into UI rendering, potentially causing runtime crashes or injected markup via dangerouslySetInnerHTML-adjacent paths.
Proposed approach
Parse through zod schemas (src/types/property schemas) with a safe fallback to miss/regenerate; log parse failures via structured logger.
Acceptance criteria
- Cached values validated or safely discarded on mismatch
- Parse failure counted in stats/logs
- Unit test with corrupted payload
Context
redisCache.ts(andpropertyCachepaths)JSON.parseRedis payloads and cast/return them asProperty/SearchResultwithout schema validation.Problem
A poisoned or stale cache entry (or partial write) yields malformed objects into UI rendering, potentially causing runtime crashes or injected markup via
dangerouslySetInnerHTML-adjacent paths.Proposed approach
Parse through zod schemas (
src/types/propertyschemas) with a safe fallback to miss/regenerate; log parse failures via structured logger.Acceptance criteria