fix(lambda): resolve hot-reload paths before checking the allow-list (#4053)

Normalize the hot-reload S3Key and compare it against the allow-list by directory instead of by string prefix, so dot-dot segments and sibling directories no longer pass. Store the normalized path, reject a colon in it, and warn at startup when hot-reload runs without an allow-list.
This commit is contained in:
Priamo Germosen authored and GitHub committed 2026-09-21 07:53:07 -05:00
1 parent bc9f41df6f
commit 847ad256f2
5 files changed
+186 -6

No files matched your search

+2
View File
@@ -126,6 +126,8 @@ FLOCI_SERVICES_LAMBDA_HOT_RELOAD_ENABLED=true
FLOCI_SERVICES_LAMBDA_HOT_RELOAD_ALLOWED_PATHS=/home/user/projects,/tmp
```
An `S3Key` is accepted when it is one of the listed directories or inside one. `.` and `..` segments are resolved first, so `/home/user/projects/../secrets` and a sibling such as `/home/user/projects-old` are rejected. Symbolic links on the Docker host are not resolved by Floci. A path containing `:` is rejected. Without an allow-list any absolute host path is accepted, and Floci logs a warning at startup when hot-reload is enabled that way.
**Docker Compose setup**: enable the feature and share the Docker socket:
```yaml