Skip to content

Move static file serving functionality to Relic #3758

Closed

Description

@coderabbitai

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

  1. Move to Relic: Transfer the static file serving functionality from Serverpod to the Relic package
  2. Security Hardening: As part of the move, address the path traversal vulnerability identified in the code review
  3. 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

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.

Activity

  1. added
    area: web server
    on Aug 8, 2025
  2. moved this from Inbox 📫 to Backlog 🗂️ in Serverpod Frameworkson Aug 8, 2025
  3. moved this from Backlog 🗂️ to Planned 🔭 in Serverpod Frameworkson Aug 8, 2025
  4. moved this from Planned 🔭 to Next Up 🎯 in Serverpod Frameworkson Aug 11, 2025
  5. self-assigned this
    on Sep 1, 2025
  6. moved this from Next Up 🎯 to In Progress 🔥 in Serverpod Frameworkson Sep 10, 2025
  7. moved this from In Progress 🔥 to Done 🚀 in Serverpod Frameworkson Oct 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area: web server

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions