fix(security): bind to localhost by default#17
Open
bkrabach wants to merge 1 commit intodanshapiro:mainfrom
Open
fix(security): bind to localhost by default#17bkrabach wants to merge 1 commit intodanshapiro:mainfrom
bkrabach wants to merge 1 commit intodanshapiro:mainfrom
Conversation
Changes the default bind address from 0.0.0.0 to 127.0.0.1 for both the Express server and Vite dev server, mitigating exposure of the unauthenticated /local-file endpoint on untrusted networks. Changes: - Server defaults to HOST=127.0.0.1 (was 0.0.0.0) - Vite defaults to VITE_HOST=127.0.0.1 (was host: true) - Updated startup message to show correct dev URL (port 5173) - Added hint about HOST=0.0.0.0 for network exposure Users can opt-in to network exposure with: HOST=0.0.0.0 npm run dev 🤖 Generated with [Amplifier](https://github.com/microsoft/amplifier) Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes the default bind address from
0.0.0.0to127.0.0.1for both the Express server and Vite dev server, mitigating the unauthenticated/local-fileendpoint vulnerability on untrusted networks.Problem
The
/local-fileendpoint serves arbitrary files without authentication. When the server binds to0.0.0.0, anyone on the same network can read any file:curl "http://<server-ip>:3001/local-file?path=/etc/passwd"Solution
127.0.0.1(localhost only)HOSTenv var to opt-in to network exposureVITE_HOSTenv var for the Vite dev serverUsage
Files Changed
server/index.ts- Server bind address + startup messagevite.config.ts- Vite dev server bind address