Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/clean-spoons-push.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@rnx-kit/cli": patch
---

Ensure `host` is set to `localhost` by default when starting the dev server,
otherwise it will listen to external connections.
8 changes: 7 additions & 1 deletion packages/cli/src/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ export async function rnxStart(
}
}

// CVE-2025-11953: Ensure `host` is set to `localhost` by default, otherwise
// it will listen to external connections.
if (!args.host) {
args.host = "127.0.0.1";
}

// load Metro configuration, applying overrides from the command line
const metroConfig = await loadMetroConfig(ctx, {
...args,
Expand Down Expand Up @@ -109,7 +115,7 @@ export async function rnxStart(

// create middleware -- a collection of plugins which handle incoming
// http(s) requests, routing them to static pages or JS functions.
const host = args.host?.length ? args.host : "localhost";
const host = args.host;
const devServerUrl = `${scheme}://${host}:${port}`;
const devServer = createDevServerMiddleware({ host, port, watchFolders });

Expand Down