agentbbs/internal/gopher
eouzoe 671d0c5f9e Fix symlink escape in Gopher public file resolver
The userTree function confined selectors with path cleaning and HasPrefix
checks, but called os.Stat/os.ReadFile on the unresolved path. A symlink
created inside a member's public area pointing outside would pass the
lexical checks and leak external content.

Fix: resolve symlinks with filepath.EvalSymlinks after the path check
and reject the request if the real path escapes the member's area.

Adds TestSymlinkEscapeRefused to verify both rejection of external
symlinks and acceptance of symlinks within the member area.
2026-07-09 21:25:14 +08:00
..
browser.go feat(gopher): serve BBS content over Gopher + SSH-authenticated "hedgehog" (#83) 2026-07-07 05:39:35 -07:00
gopher.go feat(gopher): serve BBS content over Gopher + SSH-authenticated "hedgehog" (#83) 2026-07-07 05:39:35 -07:00
gopher_test.go Fix symlink escape in Gopher public file resolver 2026-07-09 21:25:14 +08:00
listener.go feat(gopher): serve BBS content over Gopher + SSH-authenticated "hedgehog" (#83) 2026-07-07 05:39:35 -07:00
server.go Fix symlink escape in Gopher public file resolver 2026-07-09 21:25:14 +08:00