diff options
| author | historia <[not public]> | 2026-09-18 15:16:44 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-09-18 15:16:44 -0400 |
| commit | 7eab582d8a8ee2af1a6baae7baf0696c7005de2e (patch) | |
| tree | 902bbc8c6e39c9f62f779ca23267714ec420b9f5 /internal/admin/api_map.go | |
| parent | 153acb7f644d755c45533b7c5311e3ffa47e8973 (diff) | |
| download | thehouseoficarus-7eab582d8a8ee2af1a6baae7baf0696c7005de2e.tar.gz | |
fix: harden triggers, economy, casino, world data, and admin/net paths
Diffstat (limited to 'internal/admin/api_map.go')
| -rw-r--r-- | internal/admin/api_map.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/internal/admin/api_map.go b/internal/admin/api_map.go index 5eac385..d0372df 100644 --- a/internal/admin/api_map.go +++ b/internal/admin/api_map.go @@ -24,6 +24,16 @@ func (s *AdminServer) handleMap(w http.ResponseWriter, r *http.Request) { } dir := r.URL.Query().Get("dir") + if dir != "" { + // Route the map's directory through the same guard every other room + // API uses, so ?dir=../../.. cannot read/walk outside data/rooms. + clean, err := s.resolveRoomSubdir(dir) + if err != nil { + failJSON(w, err.Error()) + return + } + dir = clean + } seed := s.cfg.StartingRoom if dir != "" { if low, ok := findLowestLoadableRoom(s, dir); ok { |
