mirror of
https://github.com/jhd3197/ServerKit.git
synced 2026-11-01 09:37:11 +09:00
Copilot review on the GHSA-rm3m-9mvw-68fh patch caught two issues: - _BACKEND_DIR/_INSTALL_DIR were one level too shallow (backend/app and backend/ instead of backend/ and the install root), which left <install>/.env and frontend/dist reachable on the deployed layout — the exact PoC path from the advisory. _BACKEND_DIR stays in PROTECTED_ROOTS so flat layouts (code at /app) are covered too. - The ALLOWED_ROOTS check used a bare startswith, so e.g. /optfoo matched the /opt root. Both checks now require an exact match or a path-boundary prefix. New tests pin the level math (the existing cases computed the expected layout independently and passed on Windows for the wrong reason) and simulate the deployed layout with the install dir inside an allowed root.