Symlinks in an ebook library can expose any server file through downloads #27

Closed
opened 2026-10-18 16:23:37 +00:00 by jfro · 0 comments
Owner

From Nye's review of #17 (F7). Add to #15's symlink item.

The scanner uses Path.wildcard and File.regular?, which follow symlinks. A symlink inside a library pointing at e.g. /etc/passwd becomes an ebook record, and /ebooks/:id/download serves it to any signed-in user.

Fix: File.lstat in the scanner and skip symlinks (or resolve them and require the real path to stay inside the library root); check again at download time. Libraries are admin-configured, which limits this. Related: #15, #14.

From Nye's review of #17 (F7). Add to #15's symlink item. The scanner uses `Path.wildcard` and `File.regular?`, which follow symlinks. A symlink inside a library pointing at e.g. `/etc/passwd` becomes an ebook record, and `/ebooks/:id/download` serves it to any signed-in user. **Fix:** `File.lstat` in the scanner and skip symlinks (or resolve them and require the real path to stay inside the library root); check again at download time. Libraries are admin-configured, which limits this. Related: #15, #14.
jfro closed this issue 2026-10-18 17:51:24 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jfro/fuzzy_catalog#27
No description provided.