Repository navigation
fix(providers): read the SSRF Guard toggle from the dashboard, not only env - #14172
Merged
diegosouzapw merged 6 commits intoSep 29, 2026
Merged
diegosouzapw merged 6 commits into
diegosouzapw merged 6 commits into
Conversation
…ly env arePrivateProviderUrlsAllowed() read OUTBOUND_SSRF_GUARD_ENABLED from process.env only, while the Feature Flags page shows and writes it as a DB override. Switching the guard off in the dashboard did nothing, and switching it on did not undo OUTBOUND_SSRF_GUARD_ENABLED=false in env: the page showed the guard on with source db while provider validation, outbound fetches and webhooks ran with no private-host checks. Read the DB override first and fall back to env when it is unset or empty, the same way step 1 of the function reads the private-URL flag.
6 tasks done
# Conflicts: # src/shared/network/outboundUrlGuardPolicy.ts
…ests The DB overrides open the SQLite handle; without resetDbInstance() in test.after the runner never exits on its own.
diegosouzapw
merged commit Sep 29, 2026
fa7d936
into
diegosouzapw:release/v3.8.51
11 of 16 checks passed
7 of 8 tasks
woodsonl
added a commit
to woodsonl/OmniRoute
that referenced
this pull request
Oct 6, 2026
The v3.8.52 merge changed the code the corrected notes describe. Re-checked every claim by code area and fixed what no longer held: - OUTBOUND_SSRF_GUARD_ENABLED is no longer read from the environment only: its dashboard toggle (DB override) is read first (upstream diegosouzapw#14172). - Guard blocks surface as 503 (400 on model discovery), not 422, and are audited as provider.validation.ssrf_blocked events, not providerAudit.ts. - In public-only mode the safe-fetch wrapper also resolves the hostname and refuses private answers; the as-written check still runs first. - .env.selfhost.example: an empty INITIAL_PASSWORD behaves like unset.
4 tasks done
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
OUTBOUND_SSRF_GUARD_ENABLED) is a toggle on the Feature Flags page, withrequiresRestart: false. Its only reader is the legacy escape hatch inarePrivateProviderUrlsAllowed()(src/shared/network/outboundUrlGuardPolicy.ts), and that readsprocess.envonly. The toggle writes a DB override, which nothing reads.OUTBOUND_SSRF_GUARD_ENABLEDdbblock-metadatanonefalsedbnoneblock-metadatafalseenvnonenonedefaultblock-metadatablock-metadataThe second row is the one that matters. The page reports the guard as on, while provider validation, outbound fetches (
getProviderOutboundGuard) and webhooks run with no private-host checks.feature-flags/route.tshas special cases so that "the dashboard never shows a source that doesn't match actual gate behavior"; this flag has none, so it should follow the generic DB-then-env order.OMNIROUTE_ALLOW_PRIVATE_PROVIDER_URLS, and the same order asresolveFeatureFlag(). With no DB override the result is identical to before for every env value.Related Issues
Validation
outbound-url-guard-feature-flag,outbound-url-guard-local-flag,rerank-remote-provider-nodes(28/28)feature-flags-doc-sync-staticandtelegram-keycache-bounded-13165, which fail the same way on a cleanrelease/v3.8.51on Windows.tscon the changed files (temp tsconfig extending the root one): clean;eslintclean;prettier --checkcleanrelease/v3.8.51Tests Added Or Updated
tests/unit/outbound-url-guard-ssrf-flag.test.ts(new). Each case clears and restores this flag and both sibling flags, env and DB:OUTBOUND_SSRF_GUARD_ENABLED=falsein env (validation and outbound guards back toblock-metadata);192.168.xwebhook is rejected again);falsein effect;falsewith no DB override still opens private URLs, as before;With
outboundUrlGuardPolicy.tsreverted, the first three fail and the other three pass.Coverage Notes
Reviewer Notes
block-metadatatononeon upgrade, the same state the env escape hatch already gives. The flag iswarningLevel: "info"while "Allow Private Provider URLs" is"caution", and both now reachnone. I left the level alone to keep this to the precedence; raising it to"caution"is a one-line change if you want it here.