#102 inbox-dir symlink into www exposes private submissions
What
ensure_inbox_outside_www() only compares lexical paths; serve static file lookup follows symlinks inside www.
src/serve.rs:175-186.
Reproduced
mkdir -p /tmp/www/private
ln -s /tmp/www/private /tmp/inbox-link
hu13 serve --www /tmp/www --inbox-dir /tmp/inbox-link --listen 127.0.0.1:39332
curl http://127.0.0.1:39332/private/leak.json
Startup succeeds (the inbox path is lexically outside /tmp/www), and the file is served with 200. Actual inbox submissions written through the symlink land inside the served tree.
Impact
Violates the explicit “inbox must never be served” invariant; private submissions can be exposed.
Fix
- Canonicalize/resolve the existing ancestors of both
wwwandinbox-dirbefore comparison (the buildresolve_existinghelper is a model). - Consider refusing symlinked components under
wwwfor static serving. - Tests: inbox path symlinked into www, inbox parent symlinked into www, and www itself a symlink.
Uunknown ·
Fixed in PR #60 (
8e812dd, merged as67f5fb2) with regression coverage intests/review4_hardening.rsand the Pages inbox tests. f0rge CI run2026-10-27T18-19-28.378320411Zpassed.