Skip to content

Commit

Permalink
Use 127.0.0.1 when spinning up local loopback server (#7268)
Browse files Browse the repository at this point in the history
1. Security: 127.0.0.1 binds the server to the local machine only,
making it inaccessible from external networks. 0.0.0.0 binds the server
to all available network interfaces, potentially exposing it to external
access.
2. Performance: Binding to 127.0.0.1 can be more efficient as it
restricts traffic to the local machine, avoiding unnecessary network
overhead.
3. Simplicity: Using 127.0.0.1 ensures that only local applications can
connect, simplifying debugging and reducing the risk of unintended
access.
  • Loading branch information
TylerLeonhardt authored Aug 26, 2024
1 parent 5477a2e commit 11e8677
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Use '127.0.0.1' for the host when spinning up local loopback server",
"packageName": "@azure/msal-node",
"email": "[email protected]",
"dependentChangeType": "patch"
}
2 changes: 1 addition & 1 deletion lib/msal-node/src/network/LoopbackClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export class LoopbackClient implements ILoopbackClient {
resolve(authCodeResponse);
}
);
this.server.listen(0); // Listen on any available port
this.server.listen(0, '127.0.0.1'); // Listen on any available port
}
);
}
Expand Down

0 comments on commit 11e8677

Please sign in to comment.