feat: Implement Domain-Based Access Control (#70)#286
Merged
adams813 merged 2 commits intobenelabs:mainfrom May 3, 2026
Merged
feat: Implement Domain-Based Access Control (#70)#286adams813 merged 2 commits intobenelabs:mainfrom
adams813 merged 2 commits intobenelabs:mainfrom
Conversation
|
@Hillzo Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Collaborator
|
Nice Implementation, LGTM! |
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.
closes #70
Summary of changes:
AccessControl Service: Introduced src/services/access-control.ts — a zero-dependency service that validates outbound HTTP destinations against an operator-defined allowlist of hostnames and IPv4 CIDR ranges.
Guards Applied: assertAllowed(url) is called inside getHorizonUrl() and getRpcUrl() before any HTTP connection is opened, covering all Horizon and Soroban RPC calls.
Operator Opt-In Model: If neither ALLOWED_DOMAINS nor ALLOWED_IP_RANGES is set, the server operates in permissive mode (backward compatible). Once any entry is configured, only matching destinations are permitted.
Configuration: Two new env vars — ALLOWED_DOMAINS (comma-separated hostnames) and ALLOWED_IP_RANGES (comma-separated IPv4 CIDRs) — documented in .env.example with the full list of all 6 built-in Stellar network endpoints.
Documentation: README.md updated under Security Considerations and Roadmap.
Reason for the changes: Pulsar is a stdio MCP server with no inbound network surface. The attack vector this addresses is SSRF via custom network configuration — an attacker who controls HORIZON_URL or SOROBAN_RPC_URL could point Pulsar at internal infrastructure (e.g., cloud metadata endpoints). The access control layer closes this gap.