Skip to content

feat: add followSymlinks option to restrict symlink traversal#310

Open
MD-Mushfiqur123 wants to merge 1 commit into
pillarjs:masterfrom
MD-Mushfiqur123:feat/follow-symlinks
Open

feat: add followSymlinks option to restrict symlink traversal#310
MD-Mushfiqur123 wants to merge 1 commit into
pillarjs:masterfrom
MD-Mushfiqur123:feat/follow-symlinks

Conversation

@MD-Mushfiqur123
Copy link
Copy Markdown

Add a followSymlinks option (default: true for backward compatibility) that restricts symlink traversal. When set to false and root is configured, the canonical path is resolved via fs.realpath() and the request is rejected with 403 if it falls outside root.

This gives developers an explicit opt-in safeguard against symlink traversal attacks, similar to how dotfiles already controls another filesystem-level concern. Particularly useful for applications that serve user-writable directories.

Closes #297

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add followSymlinks option to restrict symlink traversal

2 participants