fix(security): require API server auth for non loopback binds#6223
Closed
Xowiek wants to merge 1 commit into
Closed
fix(security): require API server auth for non loopback binds#6223Xowiek wants to merge 1 commit into
Xowiek wants to merge 1 commit into
Conversation
Contributor
|
Thanks for the security-focused contribution! This is an automated hermes-sweeper review. The Evidence:
Closing as already implemented. The security posture you described is in place. |
3 tasks
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
This PR fixes a high-severity security oversight in the API server where the OpenAI-compatible endpoint could be started on external network interfaces (0.0.0.0, LAN IPs, etc.) without authentication.
Vulnerability Details
API_SERVER_KEYwas missing/empty.Changes
API_SERVER_KEYif the host is not a loopback address (e.g.,127.0.0.1,localhost,::1).api_server.pythat prevents the server from binding to public interfaces without a secure key.connect()logic to prevent unauthenticated remote connections.Verification ✅
gateway/platforms/api_server.py154 passedintests/gateway/test_api_server.py.127.0.0.1starts without key (allowed for local dev).0.0.0.0or192.168.x.xfails at startup ifAPI_SERVER_KEYis empty.0.0.0.0starts correctly when a key is provided.Security Note
This fix ensures a "Secure by Default" posture for users deploying the gateway in networked or containerized environments.