Skip to content

feat: Implement Domain-Based Access Control (#70)#286

Merged
adams813 merged 2 commits intobenelabs:mainfrom
Hillzo:fix-domain
May 3, 2026
Merged

feat: Implement Domain-Based Access Control (#70)#286
adams813 merged 2 commits intobenelabs:mainfrom
Hillzo:fix-domain

Conversation

@Hillzo
Copy link
Copy Markdown

@Hillzo Hillzo commented Apr 29, 2026

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.

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Apr 29, 2026

@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! 🚀

Learn more about application limits

@adams813
Copy link
Copy Markdown
Collaborator

adams813 commented May 3, 2026

Nice Implementation, LGTM!

@adams813 adams813 merged commit a0e96f6 into benelabs:main May 3, 2026
0 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Domain-Based Access Control

3 participants