Skip to content

fix(dev): limit /_vfs to local ips only #3154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 5, 2025
Merged

fix(dev): limit /_vfs to local ips only #3154

merged 1 commit into from
Mar 5, 2025

Conversation

pi0
Copy link
Member

@pi0 pi0 commented Mar 5, 2025

Nitro dev server has a default /_vfs endpoint for debugging virtual templates, however, it can leak some limited information when using nitro dev --host.

This PR limits this feature to only when incoming request IP is strictly ::1 or 127.*.

Note

this change, limits some valid cases too, like using external IP of same computer to access the endpoint, but considering it is just a debugging feature I think worth doing it and minimizing exposure changes.

Alternative option was validating incoming host but it can be also forged.

/cc @danielroe @antfu

@pi0 pi0 merged commit 94a73b5 into v2 Mar 5, 2025
5 checks passed
@pi0 pi0 deleted the fix/dev-vfs branch March 5, 2025 12:00
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.

1 participant