#21935: fix: handle symlinked media roots in local media checks
channel: whatsapp-web
gateway
commands
size: S
Cluster:
Media File Management Fixes
## Summary
- Fix local media path allowlist checks in `src/web/media.ts` to handle symlinked roots correctly.
- Ensure `/tmp`-based paths are accepted when the root resolves through another canonical path (e.g. `/tmp` <-> `/private/tmp`).
- Preserve existing security hardening: explicit `localRoots`, `path-not-allowed`, and filesystem-root rejection remain enforced.
## Why
CI had failures like:
- `Local media path is not under an allowed directory: /tmp/...`
`assertLocalMediaAllowed` previously validated against a single root representation and could reject valid temp files in symlink-heavy environments.
## Notes
- This PR is now based on branch `fix/gateway-probe-resilience` and includes the earlier gateway probe resilience commit plus this local-media hardening fix.
Most Similar PRs
#22348: fix(tests): pass localRoots to media test fixtures (#22191)
by VikrantSingh01 · 2026-02-21
76.0%
#22401: fix: resolve relative media paths against workspace and fix /tmp on...
by derrickburns · 2026-02-21
75.3%
#22178: test(web): allow fixture roots in media local file tests
by Kansodata · 2026-02-20
72.3%
#22356: test(web): fix media test fixture local root handling
by AIflow-Labs · 2026-02-21
71.8%
#9817: fix(media): resolve relative paths before reading local files (#8759)
by lailoo · 2026-02-05
69.4%
#17456: fix(test): stabilize media root guard test against tmpdir HOME overlap
by widingmarcus-cyber · 2026-02-15
69.3%
#17944: fix(security): fail-closed for local media paths without sandboxRoot
by Operative-001 · 2026-02-16
68.4%
#23308: fix(browser): accept upload paths that traverse symlinked tmp dirs
by SidQin-cyber · 2026-02-22
67.0%
#19171: fix(feishu): pass mediaLocalRoots to sendMediaFeishu for agent-scop...
by whiskyboy · 2026-02-17
66.8%
#18811: fix(media): require file extension for ambiguous MEDIA: path detection
by aldoeliacim · 2026-02-17
66.3%