Description
Frame Duration Bounds
- Reject animations with frameDuration < 16ms (too fast for human eye)
- Reject animations with frameDuration > 300000ms (5+ minutes causes UX issues)
Memory Protection
- Calculate total queue memory: sum(animations.length * frameCount * 768 bytes)
- Reject if total exceeds maxQueueSizeBytes
- Validate each frame is exactly 768 bytes
Loop Prevention
- Limit repeatCount to prevent near-infinite loops
- Limit total frames to prevent memory exhaustion
Injection Prevention
- Sanitize animationID and frameID strings
- Prevent path traversal attempts (../, ./, etc.)
- Use allowlist patterns for IDs
Queue Bounds
- Limit total animations in single metadata update
- Prevent oversized individual animations
Implementation Notes
Validate on metadata endpoint before storing/sending to ESP32
Return clear error messages for validation failures
Log validation failures for monitoring
Consider rate limiting to prevent spam validation attempts
Acceptance Criteria
All timing values validated within safe bounds
Memory usage calculated and limited
String inputs sanitized and length-limited
Queue size limits enforced
Clear error responses for validation failures
Validation failures logged for monitoring
Reactions are currently unavailable
You can’t perform that action at this time.
- Reject animations with frameDuration < 16ms (too fast for human eye)
- Reject animations with frameDuration > 300000ms (5+ minutes causes UX issues)
- Calculate total queue memory: sum(animations.length * frameCount * 768 bytes)
- Reject if total exceeds maxQueueSizeBytes
- Validate each frame is exactly 768 bytes
- Limit repeatCount to prevent near-infinite loops
- Limit total frames to prevent memory exhaustion
- Sanitize animationID and frameID strings
- Prevent path traversal attempts (../, ./, etc.)
- Use allowlist patterns for IDs
- Limit total animations in single metadata update
- Prevent oversized individual animations
Implementation Notes
Acceptance Criteria