Commit Graph

7 Commits

Author SHA1 Message Date
Peter Steinberger
138279a7e1 fix(media): clean up files after response finishes 2025-12-02 21:10:18 +00:00
Joao Lisboa
d53d8da56f fix: media serving and id consistency
- server.ts: Replace sendFile with manual readFile+send to fix
  NotFoundError when serving media (sendFile failed even after stat)
- store.ts: Return id with file extension so it matches actual filename

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 21:07:13 +00:00
Peter Steinberger
dc226c4ee0 fix(media): block symlink traversal 2025-12-02 18:37:15 +00:00
Joao Lisboa
0ea182c0c1 Fix path traversal vulnerability in media server
The /media/:id endpoint was vulnerable to path traversal attacks.
Since this endpoint is exposed via Tailscale Funnel (unlike the
WhatsApp webhook which requires Twilio signature validation),
attackers could directly request paths like /media/%2e%2e%2fwarelay.json
to access sensitive files in ~/.warelay/ (e.g. warelay.json), or even
escape further to the user's home directory via multiple ../ sequences.

Fix: validate resolved paths stay within the media directory.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 19:33:21 +01:00
Peter Steinberger
9fa3cbab8a chore: format to 2-space and bump changelog 2025-11-26 00:53:53 +01:00
Peter Steinberger
d298ca2d81 chore: sync source updates 2025-11-25 12:12:13 +01:00
Peter Steinberger
0bd9c5f5c7 feat: add image support across web and twilio 2025-11-25 04:58:31 +01:00