Repository navigation
Closed
Labels
area: web serverIssues related to the integrated web server.
Description
Overview
Move the static file serving functionality from Serverpod to the Relic package as part of the ongoing refactoring to replace direct dependency on dart:io HttpServer.
Background
As part of PR #3625, Serverpod is being refactored to use Relic instead of direct dependency on dart:io HttpServer. During code review, security concerns were raised about the current static file serving implementation, specifically around path traversal vulnerabilities.
Current State
The static file serving functionality is currently implemented in:
packages/serverpod/lib/src/web_server/routes/static_directory.dart
Proposed Changes
- Move to Relic: Transfer the static file serving functionality from Serverpod to the Relic package
- Security Hardening: As part of the move, address the path traversal vulnerability identified in the code review
- Clean Integration: Ensure the moved functionality integrates cleanly with Relic's architecture
Benefits
- Separation of Concerns: Static file serving is more naturally suited to be handled by the web server abstraction layer (Relic)
- Security: Opportunity to implement proper path validation during the move
- Consistency: Aligns with the overall direction of moving HTTP server functionality to Relic
References
- Original PR: refactor!: Use Relic instead of direct dependency on dart:io HttpServer #3625 (refactor!: Use Relic instead of direct dependency on dart:io HttpServer)
- Security Discussion: Comment thread
- Related Relic Issue: Path traversal vulnerability in static file serving #116
- Architecture Discussion: Comment by @vlidholt
Acceptance Criteria
- Static file serving functionality is moved from Serverpod to Relic
- Path traversal vulnerability is addressed in the new implementation
- Existing functionality is preserved (cache control, MIME type handling, etc.)
- Integration tests pass with the new implementation
- Documentation is updated to reflect the change
Priority
This should be coordinated with the completion of PR #3625 and the resolution of the security issue in Relic.
Metadata
Metadata
Assignees
Labels
area: web serverIssues related to the integrated web server.
Type
Projects
- StatusShow more project fieldsDone 🚀
Activity