fix(ssrf): add ALLOW_LOCAL_NETWORKS env var for self-hosted deployments#366
Merged
fix(ssrf): add ALLOW_LOCAL_NETWORKS env var for self-hosted deployments#366
Conversation
Self-hosted users need to access local network services (Ollama, local TTS/ASR endpoints, etc.) but the SSRF guard blocks all private addresses. Add ALLOW_LOCAL_NETWORKS env var that skips private-IP checks when set to "true" or "1", while still validating URL format and protocol. Fixes #310 Fixes #311 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
cosarah
approved these changes
Apr 7, 2026
Collaborator
cosarah
left a comment
There was a problem hiding this comment.
Clean, minimal change that solves a real pain point for self-hosted deployments. Protocol validation stays enforced, private-IP bypass is explicitly opt-in and well-documented.
Verified locally — Ollama/llama.cpp on a local network endpoint works correctly with ALLOW_LOCAL_NETWORKS=true.
Minor suggestions (non-blocking)
lib/server/ssrf-guard.ts:33— Consider.trim().toLowerCase()on the env value soTrue,TRUE, or accidental whitespace also work.
LGTM.
jaumemir
pushed a commit
to jaumemir/OpenMAIC
that referenced
this pull request
Apr 11, 2026
…ts (THU-MAIC#366) Self-hosted users need to access local network services (Ollama, local TTS/ASR endpoints, etc.) but the SSRF guard blocks all private addresses. Add ALLOW_LOCAL_NETWORKS env var that skips private-IP checks when set to "true" or "1", while still validating URL format and protocol. Fixes THU-MAIC#310 Fixes THU-MAIC#311 Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: 杨慎 <117187635+cosarah@users.noreply.github.com>
gulmarkhan-opc
pushed a commit
to tajwali/OpenMAIC
that referenced
this pull request
Apr 18, 2026
…ts (THU-MAIC#366) Self-hosted users need to access local network services (Ollama, local TTS/ASR endpoints, etc.) but the SSRF guard blocks all private addresses. Add ALLOW_LOCAL_NETWORKS env var that skips private-IP checks when set to "true" or "1", while still validating URL format and protocol. Fixes THU-MAIC#310 Fixes THU-MAIC#311 Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: 杨慎 <117187635+cosarah@users.noreply.github.com>
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
ALLOW_LOCAL_NETWORKSenv var that bypasses private-IP checks in the SSRF guard, allowing self-hosted users to use local endpoints (Ollama, local TTS/ASR, etc.).env.exampleTest plan
ALLOW_LOCAL_NETWORKS=true: private network URLs allowedpnpm check/pnpm lint/tsc --noEmitpassFixes #310, fixes #311
Partial fix for #357