## ADDED Requirements ### Requirement: Input Length Validation The system SHALL enforce maximum length limits on all user-provided string inputs to prevent DoS attacks and database overflow. #### Scenario: Task title exceeds maximum length - **WHEN** user submits a task with title longer than 500 characters - **THEN** system returns 422 Validation Error with descriptive message #### Scenario: Description field within limits - **WHEN** user submits content with description under 10000 characters - **THEN** system accepts the input and processes normally ### Requirement: Secure WebSocket Authentication The system SHALL authenticate WebSocket connections without exposing tokens in URL query parameters. #### Scenario: WebSocket connection with token in first message - **WHEN** client connects to WebSocket endpoint - **THEN** server waits for authentication message containing JWT token - **THEN** server validates token before accepting further messages #### Scenario: WebSocket connection timeout without authentication - **WHEN** client connects but does not send authentication within 10 seconds - **THEN** server closes the connection with appropriate error code ### Requirement: Path Traversal Protection The system SHALL prevent file path traversal attacks by validating all file paths resolve within the designated storage directory. #### Scenario: Path traversal attempt detected - **WHEN** request contains file path with "../" or absolute path outside storage - **THEN** system rejects request and logs security warning - **THEN** system returns 403 Forbidden error #### Scenario: Valid file path within storage - **WHEN** request contains valid relative file path - **THEN** system resolves path and verifies it is within storage directory - **THEN** system processes file operation normally